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

Remove a leak with an "extended" variable

Status
Not open for further replies.
Level 5
Joined
Mar 7, 2009
Messages
65
Hi.
I discovered how remove some leak some days ago(i mean, i only now copy some commands i saw in guide), and now i'm asking, what should i tape to remove a variable with an extension ?

For example :
Set Point(Player number of owner of triggering unit) = Position of triggering unit
Create 1 unit at Point(Player number of owner of triggering unit) ......

Usually, i write :
call RemoveLocation(udg_Point)
But as it's an extended variable (don't know if extended is the good word), what should i tape ?
call RemoveLocation(udg_Point(X)) ?
And in this specifical case, i would like to null only the "Point(Player number of owner of triggering unit)" variable, and i haven't any idea of the command (maybe set "X" = player number of owner of triggering unit, call RemoveLocation(udg_Point(X)) then i should null the integer too xD).
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
1. your "extended" variable is called an array.
Image an array as a list of variables. point[0] is the first one and so on
The number e.g. point[5] is called "index".

-> create new empty trigger
--> Create gui command set point[..] = ()
Now convert that trigger to text.

Now you see the function in jass.
-> Copy the thing in [] and add it in your custom code
--> Call removeLocation(....)
 
Level 5
Joined
Mar 7, 2009
Messages
65
set the playernumber to a integer variable and do this

call RemoveLocation(udg_point[udg_Integer])

there is a command for that one you are searching for but cant remember exactly and this is the way easier to explain
Ok, so i write a [] when i want to design the "number after the variable", and i add "udg_" everytime i design a variable, right ?
This is probably the best way to do as beginner, thanks ^^

1. your "extended" variable is called an array.
Image an array as a list of variables. point[0] is the first one and so on
The number e.g. point[5] is called "index".

-> create new empty trigger
--> Create gui command set point[..] = ()
Now convert that trigger to text.

Now you see the function in jass.
-> Copy the thing in [] and add it in your custom code
--> Call removeLocation(....)
Oh, so, most command in jass are in fact the same than in gui ? I mean, it would work if i just copy any command in a custom script ?

There is what i got when i do what you said :

Custom script: call RemoveLocation(udg_MultiPoint[(Player number of (Owner of (Triggering unit)))])

It's a little complicated to me, but it work, does it ?


Thanks to both of you, i understand better now ^^ (+rep)

EDIT : World editor tell me the command is wrong, he tell me a "(" is missing but i don't really see where.
 
Status
Not open for further replies.
Top