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

Help with Local Arrays in triggers

Status
Not open for further replies.
Level 1
Joined
Dec 17, 2004
Messages
4
Hello all

I've got a little problem; I don't know how to define local arrays in editor. I use Custom Script: "local unit udg_L_Unit" to define a non-array variable, but I don't know how to define an array. Also, Custom Script: "local unit array udg_L_Unit" won't work. When I try to launch the game with my map, it won't load nor start loading.


Help would be appreciated. :)
 
Level 1
Joined
Dec 17, 2004
Messages
4
The function doesn't happen at map initialization and if I write Custom Script: "local unit array L_Unit" instead of "local unit array udg_L_Unit" it works.. It's really weird. I'll try to experiment with it more.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
I personally haven't tried it before but you can do the following thing:

Have the whole trigger done.
Copy-paste it so you can have a backup.
Convert the original trigger to Custom Text (JASS)
At the beginning of the main function add a local unit array (Variable name).
Put anywhere you used the array the name of the variable instead of udg_Group or whatever is the name of the Array after the udg_ . This practically uses slight JASS...
 
Status
Not open for further replies.
Top