| 07-27-2006, 04:59 PM | #1 |
What do i type in for the boolexpr condition argument when i call this function? JASS:function WaitForPlayerEvent takes handle whichForceOrPlayer, playerevent whichPlayerEvent, boolexpr condition, real interval returns nothing local trigger bj_temp = bj_delayedSuspendDecayTrig local trigger t local triggercondition c local player whichPlayer = WaitForPlayerEvent_H2P(whichForceOrPlayer) local force whichForce = WaitForPlayerEvent_H2F(whichForceOrPlayer) if whichForceOrPlayer == null or whichPlayerEvent == null then set whichForce = null return elseif interval < 0 then set interval = 0 endif set t = CreateTrigger() set bj_delayedSuspendDecayTrig = t set bj_forceCountPlayers = WaitForPlayerEvent_PE2I(whichPlayerEvent) call ForForce(whichForce, function WaitForPlayerEvent_Enum) call TriggerRegisterPlayerEvent(bj_delayedSuspendDecayTrig, whichPlayer, whichPlayerEvent) if condition != null then set c = TriggerAddCondition(bj_delayedSuspendDecayTrig, condition) endif set bj_delayedSuspendDecayTrig = bj_temp loop call TriggerSleepAction(interval) exitwhen GetTriggerExecCount(t) != 0 endloop if condition != null then call TriggerRemoveCondition(t, c) set c = null endif call DestroyTrigger(t) set t = null set whichForce = null endfunction |
| 07-27-2006, 05:08 PM | #2 |
JASS:Condition(function SomeConditionFunctionThatReturnsBoolean) |
| 07-27-2006, 05:10 PM | #3 |
ummmm, huh? |
| 07-27-2006, 05:13 PM | #4 |
You need to create a boolean expression for that argument. JASS:local boolexpr b = Condition(function MyBool) It would look something like this in game. JASS:function MyBool takes nothing returns boolean return true endfunction function OtherFunc takes nothing returns nothing local player p = Player(0) local boolexpr b = Condition(function MyBool) call WaitForPlayerEvent(p, EVENT_UNIT_DAMAGED, b, 20.0) endfunction Or something like that, of course modified to fit your needs. |
| 07-27-2006, 05:25 PM | #5 |
well for this function i don't know what it wants but thanks |
| 07-27-2006, 06:20 PM | #6 |
... Waiting for PlayerEvents fails. Why not plain create a new dynamic trigger which gets destroyed later? |
