- Joined
- Jul 1, 2008
- Messages
- 1,314
Hey everybody,
I got a question about this native:
Is it possible to use its boolexpr in a way to make the event only trigger, once a specific unit leaves a specific region (which would make it a specific unit event)?
by using the boolexpr like "IsLeavingUnit == some specific unit, which is saved in a variable at the time of creating this boolexpr"
Thanks for reading this and for any help
I got a question about this native:
JASS:
native TriggerRegisterLeaveRegion takes trigger whichTrigger, region whichRegion, boolexpr filter returns event
Is it possible to use its boolexpr in a way to make the event only trigger, once a specific unit leaves a specific region (which would make it a specific unit event)?
by using the boolexpr like "IsLeavingUnit == some specific unit, which is saved in a variable at the time of creating this boolexpr"
I have a system that recognizes units of certain type and then creates other triggers for these specific units.
One of them should be a "specific unit leaves region X" trigger
(for performance reasons, I did not want every unit be able to trigger this)
So I tried to create a trigger like this (which fires upon a specific unit entering region X):
and
So, I thought, this creates a Conditional Event, where this specific unit is stored. This would be a specific unit event.
What I expected to go wrong:
Every unit leaving the region X would trigger this and sends back the assigned unit.
What actually goes wrong:
Every unit leaving triggers this and the very same unit is send back into the region X
One of them should be a "specific unit leaves region X" trigger
(for performance reasons, I did not want every unit be able to trigger this)
So I tried to create a trigger like this (which fires upon a specific unit entering region X):
JASS:
set tempTrigger = CreateTrigger()
set CattleRegisterLeavingUnit = cattle
call TriggerRegisterLeaveRegion( tempTrigger, region X, Condition( function CattleCheckLeavingTypeId))
and
JASS:
function CattleCheckLeavingTypeId takes nothing returns boolean
// only allow region triggering to be activated by the right unit (cattle)
return GetLeavingUnit() == CattleRegisterLeavingUnit
endfunction
function Actionfunction
// -> send back leaving cattle to left region X
So, I thought, this creates a Conditional Event, where this specific unit is stored. This would be a specific unit event.
What I expected to go wrong:
Every unit leaving the region X would trigger this and sends back the assigned unit.
What actually goes wrong:
Every unit leaving triggers this and the very same unit is send back into the region X
Thanks for reading this and for any help