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

Can a variable be used multiple times?

Status
Not open for further replies.
Level 6
Joined
Feb 16, 2014
Messages
193
Like a Point Variable,then that exact variable can be used in many triggers ? or can only be used in 1 trigger?
EDIT: I forgot to ask,is there any way i can change the Armor of a unit with triggers,like the armor of a unit is 10,can i change it with a trigger to 30 ?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I will add a bit of information, you can use the same Point variable in all triggers that do not use any kind of Wait, because they are instantaneous, and you cant run 2 spells at the same time without Wait, so there is no chance of you overwriting it. If you use Wait, Polled Wait, Wait for (...) or timer of some sort(e.g. you start timer and then expect at the timeout to have the same value in the variables) dont use it there
 
Indeed. I was talking in a GUI perspective, where mostly 1 trigger (actions) = 1 function.
not entirely true, because for instance (For each Unit in Group) creates new function, while still being in the same trigger, so you cant really use local variables there
Thank you for the correction.
 
Level 7
Joined
Jun 15, 2010
Messages
218
its not possible to change units armor with triggers only. However, you can create an ability that provides unit armor and add that ability to unit with triggers. If the armor is changed allot i suggest give the ability like 50 levels and set armor from 1 to 50 for each level. Then change the level of the ability with triggers.
 
Status
Not open for further replies.
Top