Antares
Spell Reviewer
- Joined
- Dec 13, 2009
- Messages
- 983
Hi,
I recently added a trigger that selects the hero skill menu each time the owner of a specific unit selects that unit. Because I didn't find the order string for it, I searched for the order id for hero skill menu, which is 852000.
The bug is that every other player also gets kicked into the hero skill menu of their respective hero, whenever the trigger is executed.
No idea why that happens. Does anyone know a workaround? Is there some other function that I should be using instead?
I recently added a trigger that selects the hero skill menu each time the owner of a specific unit selects that unit. Because I didn't find the order string for it, I searched for the order id for hero skill menu, which is 852000.
The bug is that every other player also gets kicked into the hero skill menu of their respective hero, whenever the trigger is executed.
No idea why that happens. Does anyone know a workaround? Is there some other function that I should be using instead?
JASS:
//on hero initialization
call CreateNUnitsAtLoc( 1, 'H019', GetOwningPlayer(udg_wolflord), udg_temppoint, bj_UNIT_FACING )
set udg_companiontalents = GetLastCreatedUnit()
call TriggerRegisterUnitEvent( gg_trg_select_companion_talents, udg_companiontalents, EVENT_UNIT_SELECTED )
//the trigger itself
function Trig_select_companion_talents_Conditions takes nothing returns boolean
if ( not ( GetHeroSkillPoints(udg_companiontalents) != 0 ) ) then
return false
endif
return true
endfunction
function Trig_select_companion_talents_Actions takes nothing returns nothing
call IssueImmediateOrderById(udg_companiontalents , 852000)
endfunction
//===========================================================================
function InitTrig_select_companion_talents takes nothing returns nothing
set gg_trg_select_companion_talents = CreateTrigger( )
call TriggerAddCondition( gg_trg_select_companion_talents, Condition( function Trig_select_companion_talents_Conditions ) )
call TriggerAddAction( gg_trg_select_companion_talents, function Trig_select_companion_talents_Actions )
endfunction