• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

I'm a JASS noob so I would like to find out if something is possible with JASS

Status
Not open for further replies.
Level 6
Joined
Apr 27, 2006
Messages
186
I would just like to know if it's possible to make a wait command in custom script in JASS and put it into a trigger. The reason I'd like to know this is because I'm making an ability that involves moving a unit with triggers over a distance, but since the minimum wait time for the wait command is 0.1 seconds it looks really unrealistic. For this reason I would ask if someone could write for me some custom script just for a wait command in jass and also so that I would be able to modify the wait time in the command. If it's not possible please let me know too.

Thx for any help.
 
Level 8
Joined
Oct 3, 2004
Messages
101
Actually there is a difference between TriggerSleepAction and PolledWait. I prefer TriggerSleepAction, I heard (never tested) that it has something to do with the player lags window. If a player lags, triggersleepaction will keep waiting until the window goes away, and PolledWait will keep waiting without considering the lag window.

That's what I heard anyways, need to test it.
 
Level 6
Joined
Apr 27, 2006
Messages
186
The JASS TriggerSleepAction() function is the same as Wait in GUI. It's limit is 0.27. In JASS, we use timers, but they are useless in GUI.

There are hundreds of 'Sliding a unit?' threads out there. Make a search.

I made a search and I didn't get anything useful. I got a couple of sliding triggers that were made in GUI but again the minimum wait time was still the same, the JASS slides were too confusing for me to alter, and lastly I thought of an idea of making a dummy use a no damage shockwave and target the slide point with the model file of the shockwave being the target, but again I have no desire to make the few hundred shockwave dummies for each model file in my map, so again I'm back to where I started :\.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Aight, if you wish to do it the non-MUI GUI way,

Trigger 1:
A Unit Starts the Effect of an Ability
Conditions
Ability Being Cast = blah
Actions
Set Caster = Triggering Unit
//set any other variables here
Enable Trigger 2
Wait (duration of spell, or put a loop to find when the spell ends)
Disable Trigger 2

Trigger 2 (initialized as disabled):
Every (slide interval) Seconds of Game Time
Actions
Set loc = Position of Caster
Set loc2 = loc offset by (slide distance) towards (degrees)
Move Caster instantly to loc2
//do everything else here
Custom Script: call RemoveLocation( udg_loc2 )
Custom Script: call RemoveLocation( udg_loc )
 
Level 6
Joined
Apr 27, 2006
Messages
186
Just out of curiosity if this isn't a stupid question what's the point of setting the first loc?
 
Level 6
Joined
Apr 27, 2006
Messages
186
But couldn't you instead do Move Caster to Position of Caster offset by X degrees? without using all of the loc variables? Sorry if I'm being stupid but I still don't understand their importance.
 
Level 7
Joined
Nov 12, 2005
Messages
299
> It's limit is 0.27.
This is a false rumor. I'm not sure who started it, but a simple test has proven that the minimum wait time is actually 0.1 (only if you put 0 as the actual value).
As for PolledWait (wait game time seconds in GUI) the minimum wait time is below 0.01 (again only if you put 0) so you can probably use it instead.
Anyway here are my test results, check them out or make one yourself.
 
Level 11
Joined
Jul 12, 2005
Messages
764
> It's limit is 0.27.
This is a false rumor. I'm not sure who started it, but a simple test has proven that the minimum wait time is actually 0.1 (only if you put 0 as the actual value).
As for PolledWait (wait game time seconds in GUI) the minimum wait time is below 0.01 (again only if you put 0) so you can probably use it instead.
Anyway here are my test results, check them out or make one yourself.

Very interesting... The only thing i don't know is, where the hell did you get these values from?? I made my own test, and i got different ones... Check it out. I used the structure:

...
-Start TimerVar
-For each integer A from 1 to 10 do
--Wait / Polled Wait x seconds
--Display seconds remaining.
...

Check both Wait and PolledWait with the values:
0; 0.01; 0.1; 1

Commands are:
-w <n> : Wait <n> seconds using Wait
-pw <n> : Same, but with Polled Wait

I'm pretty interested in your results...
 

Attachments

  • WaitTest.w3x
    16.5 KB · Views: 116
Status
Not open for further replies.
Top