- Joined
- Jul 25, 2009
- Messages
- 3,091
So I'm doing a squad system, all of the information pertaining to each squad type is saved in a table like so:
Squad Setups
Events
Map initialization
Conditions
Actions
-------- Chaos Marauders --------
Set GLeaderIsDifferent[1] = False
Set GLeaderUnitType[1] = Chaos Marauder
Set GRealMaxSize[1] = 6
Set GCurrentMaxSize[1] = 6
Set GUpgradeItem01[1] = Chaos Chosen Marauder
Set GMoraleDamageAmount[1] = 1
-------- Chaos Warriors --------
Set GLeaderIsDifferent[2] = False
Set GLeaderUnitType[2] = Chaos Warrior
Set GRealMaxSize[2] = 3
Set GCurrentMaxSize[2] = 3
Set GUpgradeItem01[2] = Chaos Chosen Warrior
Set GMoraleDamageAmount[2] = 20
-------- Chaos Warhounds --------
Set GLeaderIsDifferent[3] = False
Set GLeaderUnitType[3] = Chaos Warhound
Set GRealMaxSize[3] = 4
Set GCurrentMaxSize[3] = 4
Set GUpgradeItem01[3] = (Item-type of No item)
Set GMoraleDamageAmount[3] = 1
My problem is that the indexes are tied to the point values of the units (and obviously I don't want to do this as I want it to be lightweight and customizable for future upload here at THW). How can I get around using the point value? I need an integer value to be tied to each unit type, is this possible with hashtables perhaps? To clarify what I use the point value for, when a unit is trained, takes damages, loses members, etc the relevant data is assessed using this table and the point value is tied to the associated table data through its index.
Squad Setups
Events
Map initialization
Conditions
Actions
-------- Chaos Marauders --------
Set GLeaderIsDifferent[1] = False
Set GLeaderUnitType[1] = Chaos Marauder
Set GRealMaxSize[1] = 6
Set GCurrentMaxSize[1] = 6
Set GUpgradeItem01[1] = Chaos Chosen Marauder
Set GMoraleDamageAmount[1] = 1
-------- Chaos Warriors --------
Set GLeaderIsDifferent[2] = False
Set GLeaderUnitType[2] = Chaos Warrior
Set GRealMaxSize[2] = 3
Set GCurrentMaxSize[2] = 3
Set GUpgradeItem01[2] = Chaos Chosen Warrior
Set GMoraleDamageAmount[2] = 20
-------- Chaos Warhounds --------
Set GLeaderIsDifferent[3] = False
Set GLeaderUnitType[3] = Chaos Warhound
Set GRealMaxSize[3] = 4
Set GCurrentMaxSize[3] = 4
Set GUpgradeItem01[3] = (Item-type of No item)
Set GMoraleDamageAmount[3] = 1
My problem is that the indexes are tied to the point values of the units (and obviously I don't want to do this as I want it to be lightweight and customizable for future upload here at THW). How can I get around using the point value? I need an integer value to be tied to each unit type, is this possible with hashtables perhaps? To clarify what I use the point value for, when a unit is trained, takes damages, loses members, etc the relevant data is assessed using this table and the point value is tied to the associated table data through its index.