• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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