View Single Post
Old 03-14-2003, 06:45 AM   #1 (permalink)
DeeZire
Administrator
 
DeeZire's Avatar
 
Join Date: Dec 2002
Posts: 1,913
Send a message via ICQ to DeeZire
Default Extending Command Sets Beyond 12

Seems people are coming up against the old 'but theres only 12 spaces on the Command bar' issue when adding new objects for things to be built.

Heres the way I got around that problem without the need for the player to be inconvenienced or penalised by having to build another Dozer or Worker type.

As an example, lets take the USA Dozer. This ones a classic, as its CommandSet is full, so if you want it to build any more USA structures you're stuck.

I gave the Dozer two Command Sets in CommandSet.INI;-

CommandSet AmericaDozerDefaultCommandSet
1 = Command_ConstructAmericaPowerPlant
2 = Command_ConstructAmericaStrategyCenter
3 = Command_ConstructAmericaBarracks
4 = Command_ConstructAmericaWarFactory
5 = Command_ConstructAmericaSupplyCenter
6 = Command_ConstructAmericaCommandCenter
7 = Command_ConstructAmericaPatriotBattery
8 = Command_ConstructAmericaAirfield
9 = Command_Waypoints
10 = Command_DisarmMinesAtPosition
11 = Command_Stop
12 = Command_UpgradeUSADozerCommandsAux
End

CommandSet AmericaDozerAuxilliaryCommandSet
1 = Command_ConstructAmericaWall
2 = Command_ConstructAmericaParticleCannonUplink
3 = Command_ConstructAmericaDetentionCamp
4 = Command_ConstructAmericaSupplyDropZone
5 = ; new one can go here
6 = ; new one can go here
7 = ; new one can go here
8 = ; new one can go here
9 = Command_Waypoints
10 = Command_DisarmMinesAtPosition
11 = Command_Stop
12 = Command_UpgradeUSADozerCommandsDef
End

Then in FactionUnit.INI I changed the Dozers CommandSet = to the 'Default' one above.

Then I gave the Dozer these modules;-

Behavior = CommandSetUpgrade ModuleTag_nn
CommandSet = AmericaDozerDefaultCommandSet
TriggeredBy = Upgrade_AmericaDozerCommandSetDef
End
Behavior = CommandSetUpgrade ModuleTag_nn
CommandSet = AmericaDozerAuxilliaryCommandSet
TriggeredBy = Upgrade_AmericaDozerCommandSetAux
End

In Upgrade.INI, I defined those two upgrades;-

Upgrade AmericaDozerCommandSetDef
DisplayName = ; GUI: More Options string
Type = OBJECT
BuildTime = 0
BuildCost = 0
End

Upgrade AmericaDozerCommandSetAux
DisplayName = ; GUI: More Options string
Type = OBJECT
BuildTime = 0
BuildCost = 0
End

Finally in CommandButton.INI I defined the two buttons;-

CommandButton Command_UpgradeUSADozerCommandsAux
Command = OBJECT_UPGRADE
Upgrade = AmericaDozerCommandSetAux
TextLabel = ; GUI: More Options string
ButtonImage = ; best if you use an 'up arrow' image
ButtonBorderType = SYSTEM
DescriptLabel = ; GUI:Click Here for more options string
PurchasedLabel = ; GUI:Using 2nd Command Set string
End

CommandButton Command_UpgradeUSADozerCommandsDef
Command = OBJECT_UPGRADE
Upgrade = AmericaDozerCommandSetDef
TextLabel = ; GUI: More Options string
ButtonImage = ; best if you use a 'down arrow' image
ButtonBorderType = SYSTEM
DescriptLabel = ; GUI:Click Here for more options string
PurchasedLabel = ; GUI:Using 1st Command Set string
End

An elegant solution and a little tricky I guess, but it provides the perfect illusion to the user that they have an 'up' and 'down' button on their Dozers Command Set that simply switches between extra options

If you change the upgrades and command buttons so it becomes a player upgrade rather than an object one, then clicking the 'switch' on one Dozer will change the command sets on all of your Dozers at the same time

Try it out and let me know how it goes, havent tested that in the final yet. One problem you might come across is the '0' BuildTime = setting - if that causes a prob change it to something real small like 0.1.
DeeZire is offline   Reply With Quote