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

Custom Script Variable

Status
Not open for further replies.
Level 2
Joined
Mar 29, 2014
Messages
11
Custom script: call SetUnitAnimationByIndex (udg_Player[1], 55)

I was wondering if its possible to set the 'Variation' (55) to an Integer.
So, ultimately, I can randomize which animation will be used.

Set AnimationInteger[1] = (Random integer number between 55 and 58)

Cheers.
 
Level 8
Joined
Jan 28, 2016
Messages
486
If you're asking if an integer variable (such as your AnimationInteger[1] variable) which gives a random number can be used, then yes.

  • Random Animations
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dance
    • Actions
      • Set TempInteger = (Random integer number between 0 and 10)
      • Custom script: call SetUnitAnimationByIndex(GetTriggerUnit(),udg_TempInteger)
This will play a random animation each time it runs.
I also tried it myself; looked pretty funny watching a Wendigo running on the spot :p

Hope this was what you meant.
 
Last edited:
Status
Not open for further replies.
Top