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

Avoiding waits?

Status
Not open for further replies.
Level 7
Joined
Aug 31, 2011
Messages
125
How can i avoid a wait with a Periodic Trigger turning on then off? for a example:
  • Exam
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Some Random Spell
    • Actions
      • Set CasterPosition = (Position of (Triggering unit))
      • Trigger - Turn on Exam2 <gen>
      • Wait 3.00 seconds
      • Trigger - Turn off Exam2 <gen>
      • Custom script: call RemoveLocation (udg_CasterPosition)
  • Exam2
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set CasterPosition2 = CasterPosition
      • Special Effect - Create a special effect at CasterPosition2 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_CasterPosition2)
How can i make this MUI?
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
Use Integer/Real loops, or timers.

Integer/Real loop example -> In the Eaxm2 trigger do:

  • Set r = (3.00 - 0.30) ------// Your "wait" minus your periodic time.\\------
  • Custom script: if udg_r <= 0 then
  • Trigger - Turn off (This trigger)
  • Custom script: endif
To make it MUI you probably have to work with Hashtables. Let me(us) know what you want to achieve, and I'll try to help you in a better way.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Fire that goes around the caster two times... Is it channeling? Does Damage? I mean... give all the details you can.

To do things that move around you, you have to use Loops.

Event: Every 0.03 sec
Actions ->
-> Set Point = Position of Your unit
-> Set real = real + 1
-> Set Point2 - Point with 400 offset towards real degrees
-> Move Fireball Instantly to Point 2

Call RemoveLocations Point and Point2.

Every 0.03 it will move 1 degree more... And will round over and over.

I can help you make it if you give all posible details.
 
Level 7
Joined
Aug 31, 2011
Messages
125
Edit - I only need one trigger now, i just realized i cant do it with periodic event, i have to do it with loops. But even still, i needa avoid the wait so then it can still be MUI

Rofl, nevermind i seem to have gotten it by messing around and guessing :p it is MUI (i think) i casted it two times at the same with 2 different units. Tell me if im wrong at this:

  • Exam
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ring of Fire
    • Actions
      • For each (Integer A) from 1 to 48, do (Actions)
        • Loop - Actions
          • Wait 0.03 seconds
          • Set CasterPosition = (Position of (Triggering unit))
          • Set Offset = (CasterPosition offset by 500.00 towards (15.00 x (Real((Integer A)))) degrees)
          • Special Effect - Create a special effect at Offset using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 512.00 of (CasterPosition offset by 500.00 towards (15.00 x (Real((Integer A)))) degrees) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal)
          • Custom script: call RemoveLocation (udg_Offset)
      • Custom script: call RemoveLocation (udg_CasterPosition)
-Edit
nevermind found a mistake but cant find it.
When i cast the spell two times at once, it works. but! if cast again while there is already one, the flame starts at what the first one is at and it will repeat the whole trigger one more time on one of them, i forgot what one.
 
Last edited by a moderator:
Waits cannot be used in a looping trigger even if it's NOT MUI coz it will create leaks in
the creation of effects/locations etc...

A way to do this is to use systems for MUI spells like...
- Hashtables
- http://www.hiveworkshop.com/forums/...a-197329/?prev=search=unitindexer&d=list&r=20
- http://www.hiveworkshop.com/forums/...late-144325/?prev=search=indexing&d=list&r=20

if WAIT cannot be avoided, then use local variables...

sample;

MUI:
  • Local
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Custom script: local unit u = GetTrainedUnit()
      • Wait 3.00 seconds
      • Custom script: call KillUnit(u)
      • Custom script: set u = null
NOT MUI:
  • Global
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set U = (Trained unit)
      • Wait 3.00 seconds
      • Custom script: call KillUnit(udg_U)
 
Status
Not open for further replies.
Top