• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How can I use TriggerSleepAction?

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

How can I use it?

Can I use it in scenario as:
JASS:
function someFunc takes nothing returns nothing
	call TriggerSleepAction(1000)
	call BJDebugMsg("1 second...")
endfunction
function on0sec takes nothing returns nothing
	call someFunc()
	call BJDebugMsg("0 seconds...")
endfunction

Given as I suspect I can't use it on Conditions, does it work if use TriggerEvaluate() on a trigger which has action attached to it?

Does TriggerSleepAction() work on ExecuteFunc()?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
TriggerSleepAction should never be used. Ever. Don't even try to find workarounds.
 

Deleted member 219079

D

Deleted member 219079

Then what should I make to create a jass representive for
  • Trigger
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Welcome to my map!
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Blah blah...
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
how do you use TriggerSleepAction? you dont. It will not work with TriggerEvaluate, because that only runs conditions attached to trigger. To run actions attached to trigger you should use TriggerExecute.

I dont know if it is safe to use TriggerSleepAction within ExecuteFunc or TimerStart, or even Or, And.

You may have to test that out
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Then what should I make to create a jass representive for
  • Trigger
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Welcome to my map!
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Blah blah...

this is something I did a while ago. But the problem I ran into was obviously how do I pause the trigger. The only thing I came up with was to create a infinite loop and break it once the time had passed. Sadly it caused extreme lag so I never published it.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
no, if you use TriggerSleepAction inside triggercondition block for instance, you will immediately crash the running execution, also Wait does not give a shit if dialog box is opened, or if your game is even opened(alt-tab and the waits still run like nothing ever happened)
 
Status
Not open for further replies.
Top