| 03-04-2003, 12:42 PM | #1 |
I read sid67's post about the strange error he found, but it turned out to be something simple (for him). I need to add a unit at initialization of the map to a unit array. How would I go about doing this? Can I just add the unit directly into it? There will be up to 80 different units in this unit variable, example Unit[0] = Peasant Unit[1] = Paladin Unit[2] = Peon Unit[3] = Malganis ...... Unit[79] = Mountain King Except 95% of these are custom units and my code needs to be done in text, so can I just add it directly into it? Note these units aren't in the game start off with, they are just reference pieces. |
| 03-04-2003, 12:57 PM | #2 |
if they arnt in the game, but references they defantly need to be unity-type array, other wise it will not work. As far as using txt to add them: use a local string varible, set it = to the first 2 digits of the units ID code (hopefuly they are all, or alot of the same starting digits) set a 2nd local integer varible. use contanctace strings and after each one is set, just add 1 to the integer (note this will also only work if all the heroes were created at the same time) [edit] you need to use I2S( varible ) when creating the full txt of the unit code |
| 03-04-2003, 09:21 PM | #3 |
I'm using a loop to check what your hero is going to be from the password, once the check is completed it will store the value as X and create a unit "UnitGroup[X] at center of playable map area" |
