» Link Us
» The Team
» How to Use
» GenDev Utilities
» User Submitted Models
» Alpha/Beta Models
» Tutorial Downloads
» Modding Utilities
» CNC DEN
Choosing a General Ingame
Warning: This is strictly an "Advanced" tutorial, its not really suited to a step by step walkthough. If you don't understand what's going on, i suggest that you don't try it.
I've tried many different ways to get choosing a general once you're ingame working in the past, but most of them had one or two flaws that made them not worth using. I've finally got a method that works really well (without any side effects AFAIK). The only real drawback is that all the generals share the same exp menu, but thats no big deal.
It is possible (infact, its quite easy) to make this work with the default ZH Generals, but it's best for if you plan to scrap the ZH generals system altogether and do your own from scratch. Anyway, here's how you do it:
Make a copy of the default US Command Center and Construction Dozer.
Give the Dozer kindof = immobile, and get rid of all its dozer functionality (its only a dummy unit, it isn't supposed to do anything).
If you want, you can get rid of all the construction/selling animations on the command center, since you won't be able to build or sell it. Then, get rid of the radar animations - just leave the static radar model. Get rid of all the Command Centers superweapon modules, and the radar modules (since they aren't needed).
Then, make an upgrade for each general, if you don't give it a name it won't show the annoying "upgrade complete" text, give the upgrades to the command center's commandset (in the process, get rid of the rally point and sell buttons - all we want the player to be able to do is choose a general at this stage).
Now for the key bit: Give the Command Center and Dozer ReplaceObjectUpgrade modules, one for each general, which replaces the initial object with the equivalent of the general that you choose.
Then, give GrantScienceUpgrades to the generals' Command Centers, to give each general their own science to use in the exp menu (if you want them to choose different sciences).
For an extra twist, you can make the selection voice of the starting command center the "Choose your general" voice from the general's challenge, and make the researchcomplete sound the generals name....
If you do it right, you'll start off with a normal looking Command Center, (except for the radar, which isn't moving) and a normal looking Dozer that you can't do anything with (by doing some stuff with the emp logic you could have the dozer powered down for a better effect). You click on the command center, choose your general, your radar comes online, the radar dish starts moving and you'll be able to use your dozer to start building the stuff of whatever general you selected.
If you wanted to, you could have a 'select random general' option, just make an upgrade which spawns a 'switcher' object - see this thread - which creates a random object with a grantupgrade module (one for each general).
By going one step further and getting rid of the generals challenge missions, it frees up that menu for a very cool mission selection screen (as long as the campaign doesn't have IsChallengeCampaign yes" it will display the normal mission loading screen) - see attachment
This tutorial was taken from Sleipnir's Stuff. For discussion and more information on this tutorial, visit this thread.