I tried to create a code that will rename units of a particular regime (regime 0) to names from a predefined string list. When I run it, however, it doesn't rename anything. Would anyone be able to spot where I'm going wrong? [:o]
0) LOOPER: TempVar0 FROM 0 TO CheckTotalHistoricalUnits
1) CHECK: CheckUnitOwner(TempVar0) == 0
2) LOOPER: TempVar2 FROM 0 TO CheckTotalHistoricalUnits
3) SETVAR: TempString1 = CheckStringList(4, TempVar2, 0)
4) EXECUTE: ExecSetUnitName(TempVar0, TempString1, 0)
5) END LOOPER
6) END CHECK
7) END LOOPER
Many thanks ernieschwitz! I just started peaking into code this week and some of it seems to make a little sense to me but it's hard to get the hang of. I've been able to figure out a few mistakes on my own but it takes a lot of trial and error. This one I seem to be stuck on. [:o]
Well... the first problem is that you (apparantly) don't have any historical units in the game. Which makes the first line go from 0 to 0. That means basically 1 check or is that 0 checks... It doesn't really get to the renaming process....
I'd go with the CheckUnitTotal instead of the CheckHistoricalUnitTotal ...
I think at least this is what is wrong.
EDIT: Umm I think I got the order of the Checks command names in some strange order, but you should be able to recognize them.
Creator of High Quality Scenarios for:
Advanced Tactics Gold
DC: Warsaw to Paris
DC: Community Project.
Yes. I'm trying to create a code for action cards to create new pre-defined units. Once a unit is created, then I want it to be given a name from a string list. I'm trying to set up a game where only the human player uses action cards to create and/or reinforce units. The AI will use the standard procedure to create and reinforce units as I'm not sure it will handle unit creation action cards very well.
What exactly is a "historical" unit? I was thinking that "historical" referred to pre-placed units on the map. [&:]
This is probably not that helpful, but if you want the units named and numbered, maybe it could be a workaround. Might be workable on a smallish map where you are not creating lots of units via action cards.
Create a New Dawn random game. If you wanted to draw a map from scratch, in settings add the width you want to be to the right side of the map, then delete the hexes from the left side that have the existing map drawn on then. Change the depth if needed. This will give you a blank map to work with.
Design the units you want to place by card, give them a name if you prefer. Then add the same units in the TOE designer, again named how you want.
When you create a new (say) infantry unit via action card, you can click on the change model button and assign it to a TOE template giving you named and consecutively numbered units. Extra clicking though.