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

WHAT IS A VARIABLE

Status
Not open for further replies.
Level 2
Joined
Jul 8, 2006
Messages
9
Can some one please explain to me what a variable is/does i have no clue how to youse them..... :(
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
with a variable u r able to save things. like when u create a unit: make a variable with type 'unit'

in the trigger u will get
unit - create 1 ... for player X facing XXX degrees
Set variavle - set 'ur unit variable' = last created unit

now the game saved the unit

now u can use that unit in other triggers, this is very handy for units that r the main unit like in a rpg or anything
 
Level 2
Joined
Jul 8, 2006
Messages
9
oh...once you help me out :p while your at it would you happen to know how to make it when your in a maze you slide on ice?and how to make the ice skates....ty for all the help
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
ofcourse :) but with the way i do it, u need to place regions on the ice terrain.. so only handy if u have big squares of ice, but at least its better then nothing

events: every 0.05 sec of the game
conditions: --------
actions: Unit Group - Pick every unit in (Units in 'Ice_Region'((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by ((Current movement speed of (Picked unit)) / 20.00) towards (Facing of (Picked unit)) degrees)
(Animation - Play (Picked unit)'s walk animation)
 
Status
Not open for further replies.
Top