• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 20
Joined
Aug 13, 2013
Messages
1,696
Yes below the changing unit's size func and also the 'Real' variable to increase the EMP size.
  • Set Real = Real + 50.00
^ It's size eventually grow in the looping trigger every interval.

Edit: Helping doesn't bothers me :p
 
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