• 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.

[Trigger] How do I make this MUI?

Status
Not open for further replies.
Level 3
Joined
Nov 11, 2007
Messages
39
  • Omni Gladiator
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Omni
    • Actions
      • Set OmniCaster = (Casting unit)
      • Set OmniTarget = (Target unit of ability being cast)
      • Set OmniHealth = (Life of OmniCaster)
      • Set OmniMana = (Mana of OmniCaster)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of OmniCaster) Equal to Player 4 (Purple)
        • Then - Actions
          • Game Cache - Store OmniCaster as OmniCaster4 of Units in GameCache
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of OmniCaster) Equal to Player 5 (Yellow)
            • Then - Actions
              • Game Cache - Store OmniCaster as OmniCaster5 of Units in GameCache
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of OmniCaster) Equal to Player 6 (Orange)
                • Then - Actions
                  • Game Cache - Store OmniCaster as OmniCaster6 of Units in GameCache
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of OmniCaster) Equal to Player 7 (Green)
                    • Then - Actions
                      • Game Cache - Store OmniCaster as OmniCaster7 of Units in GameCache
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of OmniCaster) Equal to Player 8 (Pink)
                        • Then - Actions
                          • Game Cache - Store OmniCaster as OmniCaster8 of Units in GameCache
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of OmniCaster) Equal to Player 9 (Gray)
                            • Then - Actions
                              • Game Cache - Store OmniCaster as OmniCaster9 of Units in GameCache
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 10 (Light Blue)
                                • Then - Actions
                                  • Game Cache - Store OmniCaster as OmniCaster10 of Units in GameCache
                                • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 11 (Dark Green)
                                • Then - Actions
                                  • Game Cache - Store OmniCaster as OmniCaster11 of Units in GameCache
                                • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 12 (Brown)
                                • Then - Actions
                                  • Game Cache - Store OmniCaster as OmniCaster12 of Units in GameCache
                                • Else - Actions
                                  • Do nothing
      • Special Effect - Create a special effect attached to the origin of OmniCaster using Abilities\Spells\Human\Omni\Omni.mdx
      • Set OmniEffect = (Last created special effect)
      • Custom script: call UnitAddAbilityBJ( 'Aloc', udg_OmniCaster )
      • Animation - Change OmniCaster's animation speed to 1000.00% of its original speed
      • Unit - Make OmniCaster Invulnerable
      • Unit - Set OmniCaster acquisition range to 0.00
      • Special Effect - Create a special effect at (Position of OmniCaster) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Create a special effect attached to the origin of OmniCaster using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Unit - Move OmniCaster instantly to (Position of OmniTarget), facing (Position of OmniTarget)
      • Animation - Play OmniCaster's attack,slam animation
      • Set OmniDamage = (120 + (Random integer number between (20 x ((Level of Omni for OmniCaster) - 3)) and (20 x (Level of Omni for OmniCaster))))
      • Unit - Cause OmniCaster to damage OmniTarget, dealing (Real(OmniDamage)) damage of attack type Hero and damage type Normal
      • Wait 0.10 seconds
      • Floating Text - Create floating text that reads ((String(OmniDamage)) + !) at (Position of OmniCaster) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set OmniTarget = No unit
          • Unit Group - Pick every unit in (Units within 512.00 of (Position of OmniCaster) matching ((((Matching unit) belongs to an enemy of (Owner of OmniCaster)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to OmniTargets
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (OmniTargets is empty) Equal to False
            • Then - Actions
              • Set OmniTarget = (Random unit from OmniTargets)
              • Unit Group - Remove all units from OmniTargets
              • Special Effect - Create a special effect at (Position of OmniCaster) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
              • Special Effect - Create a special effect attached to the origin of OmniCaster using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
              • Unit - Move OmniCaster instantly to (Position of OmniTarget), facing (Position of OmniTarget)
              • Animation - Play OmniCaster's attack,slam animation
              • Set OmniDamage = (120 + (Random integer number between (20 x ((Level of Omni for OmniCaster) - 3)) and (20 x (Level of Omni for OmniCaster))))
              • Unit - Cause OmniCaster to damage OmniTarget, dealing (Real(OmniDamage)) damage of attack type Hero and damage type Normal
              • Wait 0.10 seconds
              • Floating Text - Create floating text that reads ((String(OmniDamage)) + !) at (Position of OmniCaster) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
            • Else - Actions
              • Unit Group - Remove all units from OmniTargets
      • Special Effect - Destroy OmniEffect
      • Unit - Remove OmniCaster from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of OmniCaster) Equal to Player 4 (Purple)
        • Then - Actions
          • Game Cache - Restore OmniCaster4 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of OmniCaster) Equal to Player 5 (Yellow)
            • Then - Actions
              • Game Cache - Restore OmniCaster5 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of OmniCaster) Equal to Player 6 (Orange)
                • Then - Actions
                  • Game Cache - Restore OmniCaster6 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of OmniCaster) Equal to Player 7 (Green)
                    • Then - Actions
                      • Game Cache - Restore OmniCaster7 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of OmniCaster) Equal to Player 8 (Pink)
                        • Then - Actions
                          • Game Cache - Restore OmniCaster8 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of OmniCaster) Equal to Player 9 (Gray)
                            • Then - Actions
                              • Game Cache - Restore OmniCaster9 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 10 (Light Blue)
                                • Then - Actions
                                  • Game Cache - Restore OmniCaster10 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                                • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 11 (Dark Green)
                                • Then - Actions
                                  • Game Cache - Restore OmniCaster11 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                                • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of OmniCaster) Equal to Player 12 (Brown)
                                • Then - Actions
                                  • Game Cache - Restore OmniCaster12 of Units from GameCache for (Owner of OmniCaster) at (Position of OmniCaster) facing (Position of OmniTarget)
                                • Else - Actions
                                  • Do nothing
      • Set OmniCaster = (Last restored unit)
      • Unit - Set life of OmniCaster to OmniHealth
      • Unit - Set mana of OmniCaster to OmniMana
      • Selection - Select OmniCaster for (Owner of OmniCaster)




Yes, I know its huge and bloated, and probably leaks quite badly. I tried adding local variables to the top of it using the same names as the globals but nothing happened when I cast the spell :con:

The spell works excelent when only 1 unit casts it. Fell free to use the code if you help me out. :thumbs_up:
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
First as you said it will leak a lot... you made a lot of positions without variables, the special effects are without variables too (beside main one).
If it would be 1-2 whatever... like this I think it would make a game lag pretty badly if cast many times.

Now just for general knowledge, what the CACHE helps with ? never used that thing so dunno what it does.

And now atlast for your question, obivously this skill has some cast time untill it finishes so if you cast it in the middle with another unit it will surely bug the variables.
You would need to make harray's for variables to make it flawless I think (now that will be nice to see... a ~1500 lines of code :xxd:).
 
Level 3
Joined
Nov 11, 2007
Messages
39
Cache is to replace the unit atfer its had Aloc a.k.a. Locust added to it. It seems to bug when you try to remove it so it was just easier to replace the whole unit from cache.
 
Level 3
Joined
Nov 11, 2007
Messages
39
Actually I had to add more variables to get all the effects I needed ><
Heres a cleaned up version that applies for 1 unit only, i guess im going to need 1 trigger per player along with a bunch of variables. If anyone can spot any leaks left plz tell me!

  • Player4 Omni
    • Events
      • Unit - A unit owned by Player 4 (Purple) Starts the effect of an ability
    • Conditions
      • (Casting unit) Equal to Player4
      • (Ability being cast) Equal to Omni
    • Actions
      • Set Player4Unit = (Target unit of ability being cast)
      • Game Cache - Store Player4 as Player4 of Units in GameCache
      • Special Effect - Create a special effect attached to the origin of Player4 using Abilities\Spells\Human\Omni\Omni.mdx
      • Set Player4Effect = (Last created special effect)
      • Custom script: call UnitAddAbilityBJ( 'Aloc', udg_Player4 )
      • Unit - Make Player4 Invulnerable
      • Animation - Change Player4's animation speed to 1000.00% of its original speed
      • Set TempPoint = (Position of Player4)
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Special Effect - Create a special effect attached to the origin of Player4 using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempPoint = (Position of Player4Unit)
      • Unit - Move Player4 instantly to TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Unit - Make Player4 face Player4Unit over 0.00 seconds
      • Animation - Play Player4's attack,slam animation
      • Set Player4Integer = (120 + (Random integer number between (20 x ((Level of Omni for Player4) - 3)) and (20 x (Level of Omni for Player4))))
      • Unit - Cause Player4 to damage Player4Unit, dealing (Real(Player4Integer)) damage of attack type Hero and damage type Normal
      • Wait 0.02 seconds
      • Set TempPoint = (Position of Player4)
      • Floating Text - Create floating text that reads ((String(Player4Integer)) + !) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set Player4Unit = No unit
          • Set TempPoint = (Position of Player4)
          • Set Player4UnitGroup = (Units within 512.00 of TempPoint matching ((((Matching unit) belongs to an enemy of Player 4 (Purple)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
          • Custom script: call RemoveLocation( udg_TempPoint )
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player4UnitGroup is empty) Equal to False
            • Then - Actions
              • Set Player4Unit = (Random unit from Player4UnitGroup)
              • Unit Group - Remove all units from Player4UnitGroup
              • Set TempPoint = (Position of Player4)
              • Special Effect - Create a special effect at TempPoint using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation( udg_TempPoint )
              • Special Effect - Create a special effect attached to the origin of Player4 using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set TempPoint = (Position of Player4Unit)
              • Unit - Move Player4 instantly to TempPoint
              • Custom script: call RemoveLocation( udg_TempPoint )
              • Unit - Make Player4 face Player4Unit over 0.00 seconds
              • Animation - Play Player4's attack,slam animation
              • Set Player4Integer = (120 + (Random integer number between (20 x ((Level of Omni for Player4) - 3)) and (20 x (Level of Omni for Player4))))
              • Unit - Cause Player4 to damage Player4Unit, dealing (Real(Player4Integer)) damage of attack type Hero and damage type Normal
              • Wait 0.02 seconds
              • Set TempPoint = (Position of Player4)
              • Floating Text - Create floating text that reads ((String(Player4Integer)) + !) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Custom script: call RemoveLocation( udg_TempPoint )
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
            • Else - Actions
              • Unit Group - Remove all units from Player4UnitGroup
      • Special Effect - Destroy Player4Effect
      • Set Player4Health = (Life of Player4)
      • Set Player4Mana = (Mana of Player4)
      • Set Player4Exp = (Hero experience of Player4)
      • Unit - Remove Player4 from the game
      • Set TempPoint = (Position of Player4)
      • Game Cache - Restore Player4 of Units from GameCache for Player 4 (Purple) at TempPoint facing 0.00
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Set Player4 = (Last restored unit)
      • Unit - Make Player4 face Player4Unit over 0.00 seconds
      • Unit - Set life of Player4 to Player4Health
      • Unit - Set mana of Player4 to (Player4Mana - 0.00)
      • Hero - Set Player4 experience to Player4Exp, Hide level-up graphics
      • Selection - Select Player4 for Player 4 (Purple)
 
Level 11
Joined
Aug 25, 2006
Messages
971
Since it only has a .04 second cast time, it should be MUI right off the bat.
(Unless someone can cast it twice in .04 seconds)
 
Turning this...

[trigger="Your Trigger"]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 4 (Purple)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster4 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 5 (Yellow)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster5 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 6 (Orange)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster6 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 7 (Green)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster7 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 8 (Pink)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster8 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 9 (Gray)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster9 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 10 (Light Blue)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster10 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 11 (Dark Green)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster11 of Units in GameCache
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of OmniCaster) Equal to Player 12 (Brown)
Then - Actions
Game Cache - Store OmniCaster as OmniCaster12 of Units in GameCache
Else - Actions
Do nothing[/TRIGGER]
...into this...

[trigger="Sexy Trigger"]Game Cache - Store OmniCaster as (("OmniCaster") + (Player number of (Owner of OmniCaster))) of Units in GameCache[/trigger]
...looks a lot better, don't you think?
 
Level 11
Joined
Aug 25, 2006
Messages
971
I forgot to mention, TriggerSleepAction, can't wait less then a certain amount. I don't know exactly what that amount is, but its certainly larger then .01
I'm almost certain its least amount of wait time is around .1+
I would suggest using timers. Also the gamechace is notoriously slow.
 
Level 3
Joined
Nov 11, 2007
Messages
39
We had a discussion of this in anouther thread, I think it came out to be around .125- to .1 depending on the demand on the processor, atleast on my machine.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I just tested 0.01, with this:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set int = 0
  • Untitled Trigger 002
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set int = (int + 1)
  • Untitled Trigger 003
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String(int))

And every time it was exacly int+100.
How do you explain that ?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Yes. Yes, yes, yes, yes.
I made a trigger like this:
  • Actions
    • For i = 1 TO 100 DO
      • Set integer = integer + 1
      • Wait 0,01 seconds
After 1 second I displayed the current value of integer, it was at 8. I did the same with 0,1; the value of integer was 5.
It's clearly not a "simple" function, considering the fact waiting 0,1 doesn't result in an integer value of 0 but in an integer value of 5. That's also why waiting 1 second probably results in actually waiting 1 second instead of 2.
Try to explain that to me with 0,27 wait times?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
erm...

that would mean that 0,01 actually IS 0,01. Because if you add 0,01 every 0,01 seconds, after 0,27 seconds you would get a value of 0,27 if it actually updated 100 times per second.

EDIT: I tested your triggers in WE, and after 0,27 seconds, my real value is 0,03. If waiting 0,01 seconds is waiting 0,27 seconds in real time, my real value would've been 0,01 or 0,02, but NOT 0,03.

Besides, what the hell does it matter if you use a real of 0,01 or an integer of 1? the testing principle is just the same.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
That 0.27 thing isn't true.
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Set Real = (Real + 1.00)
          • Wait 0.01 seconds
      • Wait 2.00 seconds
      • Game - Display to (All players) the text: (String(Real))
End results: Real=100.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
it DOES make a difference. even in a FOR loop. a FOR loop does iteration after iteration (until your integer becomes 100). If in 1 iteration you have a wait, it'll wait 0,01 seconds before it proceeds to the next iteration.

Ghostwolf, you need to wait 1 second instead of 2 seconds after the for loop, else it still can mean that waiting 0,01 "means" waiting 0,02.

Anyway, I'm very sure it's NOT 0,27. What the exact value (if it is a constant) is I don't know.
In the end, it doesn't really matter, as long as you keep in mind that waiting short intervals might have different results than you expect to see.
 
  • Trigger 1
    • Actions
      • Trigger - Run Trigger 2 (ignoring conditions)
      • Wait 0.27 seconds
      • Game - Display String(Real) to all players blah blah
  • Trigger 2
    • Events
      • Time - every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Real = (Real + 0.01)

0.27 is displayed.



  • Trigger 1
    • Actions
      • Trigger - Run Trigger 2 (ignoring conditions)
      • Wait 0.01 seconds
      • Game - Display String(Real) to all players blah blah
  • Trigger 2
    • Events
      • Time - every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Real = (Real + 0.01)

Again, 0.27 is displayed. Not 0.01.

It's a FOR loop. No matter how long that wait is, it'll get to whatever the second number is then stop and display it.

Your logic makes no sense.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Your logic makes no sense either. You say that waiting 0,01 seconds actually is the same as waiting 0,27 seconds. As a proof you add 0,01 to real every 0,01 seconds and display your real value after 0,27 seconds. How the HELL can real be 0,27 if you only add 0,01 ONCE to real?

By the way, this is what I did:
I made 1 trigger displaying "real" after 1 second.
Then I made another that add 1 to integer every 0,01 seconds. Yet, it displayed 8 after 1 second. If waiting 0,01 seconds was equal to waiting 0,27 seconds, the displayed number should have been 3, not 8.

I'm right, you're wrong.
 
Your logic makes no sense either. You say that waiting 0,01 seconds actually is the same as waiting 0,27 seconds. As a proof you add 0,01 to real every 0,01 seconds and display your real value after 0,27 seconds. How the HELL can real be 0,27 if you only add 0,01 ONCE to real?

Because that's what the Wait thing does. You can't wait for less than 0.27 seconds. I know it's stupid, I know it may not make any sense. But that's how it goes.

Must I go and get PurplePoot or DSG to come here and prove it?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Actually, Wait works faster in Singleplayer mode than in multiplayer due to syncronization. What appears to be a 0.2 second wait in singleplayer may be as long as 0.5 seconds in multiplayer (+ or - depending on ping). Do not quote me with figgures, but fact is fact.

Howerver using game time wait (polled wait) tends to be more accurate as it uses a timer so it is recomended to do so even thoe it uses more resources to run.

There is no argument here, as others have done it before and all agreed with the above.

However pyritie, I disagree with your 0.27 thing as in multiplayer I have see wait running slower than when playing the same map (same timers and timmings) in single player.
 
Status
Not open for further replies.
Top