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

Periodic Unit Size Change

Status
Not open for further replies.
Level 5
Joined
Aug 7, 2016
Messages
55
So it's like this?

  • EMP Main
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to Electromagnetic Pulse
    • Actions
      • Set TargetLoc = (Target point of ability being cast)
      • Set Real = 50.00
      • Unit - Create 1 EMPdummy for (Owner of Triggering unit) facing Default building facing degrees
      • Set EMPDummy = (Last created unit)
      • Set LoopCounter = 0
      • Custom script: call RemoveLocation(udg_TargetLoc)
      • Trigger - Turn on EMP Periodic
  • EMP Periodic
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Animation - Change EMPDummy's size to (Real%, Real%, Real%) of its original size
      • Set Loopcounter = 10
      • If (Conditions) are true, Then(Actions) Else (Actions)
        • If - Conditions
          • Loopcounter is greater than 10
        • Then - Actions
          • Unit - Remove EMPDummy
        • Else - Actions
          • Trigger - Turn off this trigger
Edit: I'm staying away from JASS(Even though most of you say it's easier and faster)
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
The Set Loopcounter = 10 will make it go on forever. I think you meant Loopcounter = Loopcounter +1?

And yeah that will work but for only one unit at a time. A hacky way to do it (though it'll require local variables, which are a tiiiny bit of jass but not that much) is to give EMP Periodic no events, use a Run Trigger action to run EMP Periodic from EMP Main, and have EMP Periodic run itself again after a wait, until you don't want to run it anymore. Don't do that trick too much in your map though since excessive numbers of waits cause lag and are inaccurate.
 
Level 5
Joined
Aug 7, 2016
Messages
55
I'm okay if it's for only one unit at a time.

So I'll just set my Loopcounter to this:
  • Set Loopcounter = 0 + 10
By the way, the 10 is the number of instances the periodic event can fire before turning the trigger off(I think) and I should probably move the "Trigger - Turn off this trigger" inside the "Then - Actions"
 
Level 5
Joined
Aug 7, 2016
Messages
55
So the Loopcounter in the Periodic trigger should be:

  • Set Loopcounter = Loopcounter + 1
Sorry for bothering you, I can't understand if you explain it to me in a not simplified way or if not in a sample. :(
 
Level 5
Joined
Aug 7, 2016
Messages
55
Oh... Okay I get it. And should I change this:
  • EMP Periodic
    • Actions
      • If-Conditions
        • Loopcounter greater than 0
      • Then - Actions
        • Unit - Remove EMPDummy
      • Else - Actions
        • Trigger - Turn off this trigger
To this:
  • Emp Periodic
    • Actions
      • If-Conditions
        • Loopcounter greater than 0
      • Then - Actions
        • Unit - Remove EMPDummy
        • Trigger - Turn off this trigger
      • Else - Actions
Edit: Thanks for your help btw
 
Status
Not open for further replies.
Top