Roku
New Member
- Reaction score
- 3
Hey, i used to work with JASS (vJass also) pretty much but then i stopped making maps and now when i started to make a new map i used GUI most of time. However i had problems with this trigger of mine so rewriting it in JASS seemed a good solution. It did work out much better too. Basically i am looking forward to people helping me improving this trigger, and maybe telling me if there's anything wrong, and maybe how to fix it. Well in-game the trigger runs almost as it is supposed to. I'll post it first:
If my Boss isn't moving, then the wisp goes there normally and does tranquility as it is supposed to with a little delay. Thats ok. But if my Boss is moved (which is how its supposed to happen in game) then the wisp goes to the location and just stays there doing nothing. If then the Boss goes into the tranqulity range (600) of the wisp, then it does cast the spell. I don't know if this is because of the trigger or the game mechanics. I barely converted this from GUI and edited some minor condition things, so you may see a lot of BJ's, help on those appreciated. Leaks also.
JASS:
function Actions takes nothing returns nothing
local unit wisp
local location p
call AddSpecialEffectLocBJ( GetRectCenter(gg_rct_P4_Boss_Pos), "Abilities\\Spells\\NightElf\\MoonWell\\MoonWellCasterArt.mdl" )
call DestroyEffect( bj_lastCreatedEffect )
call CreateNUnitsAtLoc( 1, 039;e001039;, Player(11), GetRectCenter(gg_rct_P4_Boss_Pos), bj_UNIT_FACING )
set wisp = bj_lastCreatedUnit
call UnitAddAbility( wisp, 039;A011039;)
set p = GetUnitLoc(udg_Boss)
call IssuePointOrderLoc( wisp, "move", p )
call UnitApplyTimedLife( wisp, 039;BTLF039;, 20.00)
loop
exitwhen GetUnitX(wisp) == GetLocationX(p) and GetUnitY(wisp) == GetLocationY(p)
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
call IssueImmediateOrder( wisp, "tranquility" )
endfunction
//===========================================================================
function InitTrig_Wisps_Spawn takes nothing returns nothing
set gg_trg_Wisps_Spawn = CreateTrigger()
call DisableTrigger( gg_trg_Wisps_Spawn )
call TriggerRegisterTimerEventPeriodic( gg_trg_Wisps_Spawn, 10.00 )
call TriggerAddAction( gg_trg_Wisps_Spawn, function Actions )
endfunction
If my Boss isn't moving, then the wisp goes there normally and does tranquility as it is supposed to with a little delay. Thats ok. But if my Boss is moved (which is how its supposed to happen in game) then the wisp goes to the location and just stays there doing nothing. If then the Boss goes into the tranqulity range (600) of the wisp, then it does cast the spell. I don't know if this is because of the trigger or the game mechanics. I barely converted this from GUI and edited some minor condition things, so you may see a lot of BJ's, help on those appreciated. Leaks also.