• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[JASS] No Problem = A Problem

Status
Not open for further replies.
Level 6
Joined
Oct 10, 2009
Messages
1,426
FIXED
thanks to watermelon_1234

well, i have a vJass trigger that has no errors in it that JNPG can pick up, but when i enable it i cannot test my map. WE crashes... anybody know why?

JASS:
function Trig_CreateUnitByChat_Actions takes nothing returns nothing
    local integer i = 0
    loop
        call CreateUnitByName(Player(1),GetEventPlayerChatString(),87.8,907.3,90)
        set i = i + 1
        exitwhen i == 13
    endloop
endfunction

//===========================================================================
function InitTrig_CreateUnitByChat takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerChatEvent(t,Player(0),"",false)
    call TriggerAddAction(t, function Trig_CreateUnitByChat_Actions)
endfunction

+Rep and a big thanks to whoever helps or fixes :/
 
Last edited:
The code works fine for me as well. Do you think there might be another trigger that conflicts with this?

On an unrelated note:
JASS:
function Trig_CreateUnitByChat_Actions takes nothing returns nothing
    local integer i = 0
    loop
        call CreateUnitByName(Player(1),GetEventPlayerChatString(),87.8,907.3,90)
        set i = i + 1
        exitwhen i == 13
    endloop
endfunction

//===========================================================================
function InitTrig_CreateUnitByChat takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerChatEvent(t,Player(0),"",false)
    call TriggerAddAction(t, function Trig_CreateUnitByChat_Actions)
endfunction
Using a loop is much better than manually copying the function 13 times.

On an even more unrelated note: Please don't use rainbow tags for stating your problem.
 
Hm, I phrased that badly. What I meant: The trigger seems to work fine for me, so I think something else (As in not what the code is actually doing) might be causing the problem.

Do you know what error it is exactly? Is it just a crash?

Try using my code. Make sure the trigger name is CreateUnitsByChat.


and well i tried enabling/disabling all my triggers until i got it down to just this one trigger causing it.

i phrased my "crash" bad as well, very bad:P whenever i go to test it, it brings up the wc3 home screen. no map. and if i try to go to it via create custom game it wont let me.

ahh, [rainbow]I LOVE YOU[/rainbow] J/K:grin: but seriouly Thanks a lot.(for optimising as well:P) and yes, now i see why it wasnt working, WE is very picky:P simple name messed everything up:ugly: but anyways thanks and +rep :wsmile:
 
Status
Not open for further replies.
Back
Top