Hello, in my map I have various AI groups that can "evolve" into different units.
In order to store the chain of evolution unit types, I have create a record and then in my map initialization trigger I manually set each member of the array inside the record.
It looks like this:
Variable - Set Evolution Line. Elites[0] = Some Unit Type
Variable - Set Evolution Line. Elites[1] = Some Unit Type
....
As you can see, if I want to have multiple lines of evolution with 5+ different unit types, it's just a ton of copy paste.
Is there some better way to populate the array of unit types in my record or am I doing it the correct way? Usually outside of SC2 I would use a static XML /text/whatever file to store all of the information on what units belong where... is there something like this in the editor?
Yes you create a trigger Action, for each member of your record the action will have a parameter.
What the action does is iterate through your record array ( with For Each Integer) until it finds an entry where some value is either empty or default or whatever you know counts as "empty", then it sets each member of that entry to the parameters given and exits with Break.
Is there some better way to populate the array of unit types in my record or am I doing it the correct way? Usually outside of SC2 I would use a static XML /text/whatever file to store all of the information on what units belong where... is there something like this in the editor?
There is. In the data editor there is the catalog "User Types", with that you can create fields with different types(string, int, gamelink etc) and inatances of those fields. You can use triggers to get those values.
I'm sorry i'm not quite following.. perhaps a simple example of the usage of a User Types catalog?
@zorbotron
Not sure exactly what you mean either... do you mean setting up an action trigger with 30-40 parameters and then if some of the parameters are filled then those parts of the record variable are added? Perhaps a small example..
".NAME has been set" is where i check the current entry's Text name to determine whether the entry is empty, meaning it's the end of the list and the spot where i should add the new one, 29 is just the size of my array.
You then just use this action with the right parameters, it shows up in the same spot as normal triggers like Create Unit or whatever.
Hello, in my map I have various AI groups that can "evolve" into different units.
In order to store the chain of evolution unit types, I have create a record and then in my map initialization trigger I manually set each member of the array inside the record.
It looks like this: Variable - Set Evolution Line. Elites[0] = Some Unit Type Variable - Set Evolution Line. Elites[1] = Some Unit Type ....
As you can see, if I want to have multiple lines of evolution with 5+ different unit types, it's just a ton of copy paste.
Is there some better way to populate the array of unit types in my record or am I doing it the correct way? Usually outside of SC2 I would use a static XML /text/whatever file to store all of the information on what units belong where... is there something like this in the editor?
Thank you very much all. :)
Yes you create a trigger Action, for each member of your record the action will have a parameter.
What the action does is iterate through your record array ( with For Each Integer) until it finds an entry where some value is either empty or default or whatever you know counts as "empty", then it sets each member of that entry to the parameters given and exits with Break.
There is. In the data editor there is the catalog "User Types", with that you can create fields with different types(string, int, gamelink etc) and inatances of those fields. You can use triggers to get those values.
@Exaken: Go
I'm sorry i'm not quite following.. perhaps a simple example of the usage of a User Types catalog?
@zorbotron
Not sure exactly what you mean either... do you mean setting up an action trigger with 30-40 parameters and then if some of the parameters are filled then those parts of the record variable are added? Perhaps a small example..
".NAME has been set" is where i check the current entry's Text name to determine whether the entry is empty, meaning it's the end of the list and the spot where i should add the new one, 29 is just the size of my array.
You then just use this action with the right parameters, it shows up in the same spot as normal triggers like Create Unit or whatever.
@Swizzler101: Go Here is a good tutorial on user types: http://www.sc2mapster.com/forums/resources/tutorials/49018-data-triggers-getting-started-with-user-types/
@Exaken: Go
Thank you everyone. :)