Hi Guys,
I have problems with my first self wirtten JASS trigger. The trigger is supposed to spawn an unit for each player (it's a very basic trigger so I assume that my map is only played by 6 persons) and then add an special effect to the unit. This should happen at map initialisation.
Used Globals:
udg_Quest1Unit
udg_Quest1Gebiet
so here's my code
It does not cause the game to crash but if I start the game the trigger does simply nothing.
I have spent more than two hours to make it work but I can't figure out what's wrong.
Can someone help me please?
Thanks in advance.
I have problems with my first self wirtten JASS trigger. The trigger is supposed to spawn an unit for each player (it's a very basic trigger so I assume that my map is only played by 6 persons) and then add an special effect to the unit. This should happen at map initialisation.
Used Globals:
udg_Quest1Unit
udg_Quest1Gebiet
so here's my code
JASS:
function Trig_CreateHero1_Actions takes nothing returns nothing
local integer p =0
local unit array a
loop
exitwhen (p > 5)
call CreateNUnitsAtLoc (1, udg_Quest1Unit, ConvertedPlayer(p), GetRandomLocInRect(udg_Quest1Gebiet), bj_UNIT_FACING )
set a =GetLastCreatedUnit()
call AddSpecialEffectTargetUnitBJ( "hand, right", a, "war3mapImported\\Odd Sword.mdx" )
call SelectUnitForPlayerSingle( a, ConvertedPlayer(p) )
set p =p+1
endloop
endfunction
//==== Init Trigger CreateHero1 ====
function InitTrig_CreateHero1 takes nothing returns nothing
set gg_trg_CreateHero1 = CreateTrigger()
//call TriggerRegister__(gg_trg_CreateHero1, )
call TriggerAddAction(gg_trg_CreateHero1, function Trig_CreateHero1_Actions)
endfunction
It does not cause the game to crash but if I start the game the trigger does simply nothing.
I have spent more than two hours to make it work but I can't figure out what's wrong.
Can someone help me please?
Thanks in advance.
Last edited: