• 🏆 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!

[Trigger] How to continiue a animation?

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I've made a map where the Map Initialization contains
  • Actions
    • Animation - Change Unit1's animation speed to 0.00% of its original speed
    • Unit - Pause Unit1
I also made a movement trigger
  • Move
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set Unit1 = Unit 0000 <gen>
      • Unit - Unpause Unit1
      • Animation - Change Unit1's animation speed to 100.00% of its original speed
      • Wait 0.10 seconds
      • Animation - Change Unit1's animation speed to 0.00% of its original speed
      • Unit - Pause Unit1
The unit has a destination to move towards, and yes, I do want the unit to move only for 0.10 second every time I press the Up Arrow key.
My question: Every time the unit executes this trigger, the move animation starts over. Is there any way to make the move animation continiue the next time I press the Up Arrow key?
 
Last edited:
Level 15
Joined
Jan 31, 2007
Messages
502
  • Move
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set Unit1 = Unit 0000 <gen>
      • Set Queue[1] = Queue[1] + 1
      • Unit - Unpause Unit1
      • Animation - Change Unit1's animation speed to 100.00% of its original speed
      • Wait 0.10 seconds
      • Set Queue = Queue - 1
      • If Queue[1] equals 0 then
      • Animation - Change Unit1's animation speed to 0.00% of its original speed
      • Unit - Pause Frog1
      • else
      • endif
Does that work? (sry ,i dont remember the correct GUI "If" anymore)
But it should prevent the unit getting paused when this thrigger is executed and not finished before
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
You can talk to me about Array's whatever you want, but I've tried to understand and never have been able to. I simply don't know what they are, what their purpose is and what they do. I simply made the trigger you gave me, and this is the result:
  • Move
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set Unit1 = Unit 0000 <gen>
      • Set Queue[1] = (Queue[1] + 1)
      • Unit - Pause Unit1
      • Animation - Change Unit1's animation speed to 100.00% of its original speed
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Queue[1] Equal to 0
        • Then - Actions
          • Animation - Change Unit1's animation speed to 0.00% of its original speed
          • Unit - Pause Unit1
        • Else - Actions
But now the unit doesn't stop after 0.10 seconds. I want the unit to move for 0.10 seconds, then freezes, and when I press the Up Arrow key again, it continiues the animation for 0.10 again.
 
Level 24
Joined
May 9, 2007
Messages
3,563
I'll try to give you a little bit of an explanation on arrays. (It's not technically correct in some parts but it'll help you understand)

An array is a collection of variables.
Each variable is: <YourVar> [x]
<YourVar> is set as a normal variable.

So, basically. If you have a variable, Integer[1-12] it is 12 different variables.

To set these seperate variables, just fill in the brackets.

The advantages of an array, are: You can use functions like: Playe Number (Triggering Player) to set [x] = the player number of the triggernng player. If player 1 red types a chat event, it is set to <YourVar> [1], if player two blue <YourVar> [2] and so on.

Get it now?
 
Level 24
Joined
May 9, 2007
Messages
3,563
So Array 1 always represents Player 1 in a player Variable?
If so, what do the Array's represent in other Variables?

Not quite.

The variable is an certain type. For an example we'll say integer. There are anywhere from 1-8191 variables in an array.

The number afterward in brackets specifies which variable out of the possible variables it is.

If we say <YourVar> [1] = 5
We can also say <YourVar> [2] = 9

These are seperate variables.

The trick is that you can go like this.

<YourVar> [Player Number of Triggering Player] = 5

Then whatever player triggers this event, the variable in the array with the player number matching theirs, becomes equal to five.

Get it?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
So actually instead of making a new variable about the same thing, I copy the variable X times (X Array's) and give every copy a different value. Then I call the Variable type and the number attached to the value I want.

Hurray, I get it! (unless I'm again missing the point :gg:)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Ok, it seems the problem is still there. I changed the movement speed and now I see that the unit animation still resets. Only when I press the Up Arrow key fast enough to follow up the previous action, it continues the animation. If I wait just a little bit more or less, the animation is reset.
 
Level 24
Joined
May 9, 2007
Messages
3,563
Ok, I finally have enough rep to give rep to others, so both of your got a very well earned rep+!

No.

DO NOT TRIPLE POST. Delete two of them, and make them into one post, using the edit button. Also, I would delete the first two entirly. The're off topic.

But anyway, as to your problem:

Are you waiting the exact right amount of time? (From the model viewer in the editor it will tell you what that is.)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Sorry about the triple post. They're deleted.

And if you mean the animation time; That's what I want to continue. I press the Up Arrow key and the animation shows for the first 0.10 seconds, then freezes. I want the next time I press the Up Arrow key, to have animation continue, starting at 0.10 seconds and playing another 0.10 seconds.
 
Level 11
Joined
Jun 21, 2007
Messages
505
No.

Variables are commonly used to store values for later use in triggers. For example you have killed a unit. And you want to know how many units you killed in total. Then you store a value in your variable, and use it again later, for example for a leaderboard.

That's how Tower Defenses (TDs) work.

Array Variables are multiple variables with the same name. If you set a variable's array to 1, it will be 8192. If you set the array to 8192<Infinite then it won't let you. If you uncheck the "Array" box, then it is a single variable.

Array Variables are used, for example, to store how many units each player has killed.
You use event "Unit dies" and put this action at the If: "UnitsKilled[(Player Number of (Owner of (Killing Unit)))]"

I suppose you don't know about Loop A and Loop B. That's how you use it:
For each Integer A from 1 to 12 do If UnitKills[(Integer A)] Equal to ### then do Player - Victory <convert player index to player> Player[Integer A]

Seriously, open a couple of already existing maps as the point of reference.

[Off-Topic] Dang it >< One rep less for Necropost!! DAMN

  • Map Intialization
  • Events
    • Map Intialization
  • Conditions
  • Actions
    • Animation - Set unit's animation to 0%
    • -----The animation speed affects only the unit's stand and death animaions. Unit keeps walking with the speed you put at Object Editor at Animation - Walk Speed and Animation - Run Speed-----
  • Events
    • Player - Player[1] presses Up Arrow key
    • Player - Player[2] presses Up Arrow key
    • Player - Player[3] presses Up Arrow key
    • Player - Player[4] presses Up Arrow key
    • Player - Player[5] presses Up Arrow key
    • Player - Player[6] presses Up Arrow key
    • Player - Player[7] presses Up Arrow key
    • Player - Player[8] presses Up Arrow key
    • Player - Player[9] presses Up Arrow key
    • Player - Player[10] presses Up Arrow key
    • Player - Player[11] presses Up Arrow key
    • Player - Player[12] presses Up Arrow key
  • Conditions
    • UnitIsMoving Equal to False
  • Actions
    • Unit - Unpause Unit
    • Unit - Order unit to move to (Position of Unit offset by (0, 100))
    • Set UnitIsMoving = True
    • -----UnitIsMoving. That is a variable and its type is Boolean.-----
    • Wait 0.1 seconds
    • Unit - Pause Unit
    • Set UnitIsMoving = False
That is the problem in your trigger. No need to bitch everyone for rep, nor to swear, or shout, or ask anymore question again and again.
 
Status
Not open for further replies.
Top