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

Is there need to use Player Variable for this things:

Status
Not open for further replies.
Hello, I will skip long talking: I have learn how to make GUI MUI spells from one map Caller ''Land of Free'' ''Begginers at Gui Mui Spelling(or triggering'', and I have saw to many people use player variable for spells for excample:::::: owner of (variable unit) is ally of (variable unit 2). So in short do I need to create variable for player or I can use Owner of (FFFFF), fffff is variable unit, is it leakless.
 
I was thinking does this leak:


Set UnitGround(Units in 256 range from V-Point(1) mathching contition(Owner of (Matching Unit) is ally of (Owner of (V-Caster(V-Times))

Does This Owner of (V-Caster(V-Times)) leak and is there need to I create new player variable. I have seen one pro GUI coder have created about 20 complicated GUI spells with-out using any player variable.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You do not actually 'need' variables all the time: player variables, for example, are very uncommon in spells.
Unit variables are more common in spells, but still not necessary.

HammerFist132 said:
does this leak:
Set UnitGround(Units in 256 range from V-Point(1) mathching contition(Owner of (Matching Unit) is ally of (Owner of (V-Caster(V-Times))
Players don't leak, but unit groups do.
The leak in that trigger would be "Units in 256 range from location".
Also, location variables shouldn't have arrays (no temporary variable should have arrays).
 
Oh man so hard to understand u. I use for excample in next loop trigger that point but lets say in way point(2) then point(5) etc. I think isnt this better than to create custon caster point variable then target point variable than movepoint variable, I can easily lose my self after a lot of variables. If u ask do I clean that point, than answer is yes.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's better to have 3 temporary location variables for the entire map.
"TempLoc1", "TempLoc2" and "TempLoc3".
If you really need to use an array, you can, but if you don't: then don't.

You don't need 'a lot' of variables. About 8-15 temporary variables for the entire map and then some system-specific variables.

I would like to see one of your triggers where you use arrays, just as an example.
 
Status
Not open for further replies.
Top