Menu:

GenDev
 
  » News
  » Forums
  » Downloads
  » Link Us
  » The Team

Cameo Mapper
 
  » About
  » How to Use
  » Download

Tutorials
 
  » Modding
  » Graphics
  » Mapping

Modding Resources
 
  » GenDev Utilities
  » User Submitted Models
  » Alpha/Beta Models
  » Tutorial Downloads
  » Modding Utilities

Affiliates
 
  » CNC DEN
  » SDI
  » Defcon
  » PPM
  » BattleTech Mod
  » CNC Unleashed
  » Deezire Online
  » Sleipnir's Stuff
  » Blitzkrieg 2: The Finest Hour
  » Call To Arms

Staff Only
 
  » News Post
  » File Admin
  » File Team

Adding Your General to Generals Challenge


By: Mishkin
Files we will be working with:

Location: Data/INI
Campaign.INI
ChallengeMode.INI
PlayerTemplate.INI

Location: Window/Menus
ChallengeMenu.WND

You already have your own General with all the INI's of his/her units, structures, etc. completed. Now you want to be able to select your own General on the Generals Challenge Selection Map (GCSM).

Open up PlayerTemplate.INI and have a look at the existing factions already there. Most of these parameters are self-explanitory. Copy a piece of code from one of the Generals and modify it to suit your needs.

PlayerTemplate FactionAmericaAirForceGeneral
Side = AmericaAirForceGeneral
BaseSide = USA
PlayableSide = Yes
StartMoney = 0
PreferredColor = R:0 G:0 B:255
IntrinsicSciences = SCIENCE_AMERICA
PurchaseScienceCommandSetRank1 = AirF_SCIENCE_AMERICA_CommandSetRank1
PurchaseScienceCommandSetRank3 = AirF_SCIENCE_AMERICA_CommandSetRank3
PurchaseScienceCommandSetRank8 = AirF_SCIENCE_AMERICA_CommandSetRank8
SpecialPowerShortcutCommandSet = AirF_SpecialPowerShortcutUSA
SpecialPowerShortcutWinName = GenPowersShortcutBarUS.wnd
SpecialPowerShortcutButtonCount = 11
DisplayName = INI:FactionAmericaAirForceGeneral
StartingBuilding = AirF_AmericaCommandCenter
StartingUnit0 = AirF_AmericaVehicleDozer
ScoreScreenImage = America_ScoreScreen
LoadScreenImage = SAFactionLogoPage_US
LoadScreenMusic = Load_USA
ScoreScreenMusic = Score_USA
;HeadWaterMark = SCTempSelectPortrait ; don't use unless we add a "generalshead for non selected generals
FlagWaterMark = WatermarkUSA
EnabledImage = SSObserverUSA
BeaconName = MultiplayerBeacon
SideIconImage = GameinfoAMRCA
GeneralImage = USA_Air
OldFaction = No ; This faction was NOT available in the original Generals and should NOT be available if the oldFactionsOnly flag is set
ArmyTooltip = TOOLTIP:BioStrategyLong_Pos0
Features = GUI:BioFeatures_Pos0
MedallionRegular = AirGeneral_slvr ;<----- Icon for this General on the GCSM.
MedallionHilite = AirGeneral_blue
MedallionSelect = AirGeneral_orng
End

Also, where it says GUI:Whatever, you can edit that in CSF or String formats. Strings are usually easier, since they don't require the use of a CSF editor.

Now open up ChallengeMode.INI. You will see all the generals used for the Generals Challenge. Keep in mind, that you can't have GeneralPersona12. Use numbers 0-11 ONLY. So if you want to keep the existing Generals, the most you can add is 3 more. You can achieve this by using the piece of code for the boss general and 2 that EA didn't finish. Originally, there were supposed to be "Boss" Generals for each faction, but only the Boss General for China got put into the game. Copy a piece of code from one of the Generals and modify it to suit your needs once again. Same goes for parameters - self-explanitory.

GeneralPersona0
PlayerTemplate = FactionAmericaAirForceGeneral
StartsEnabled = yes
BioNameString = GUI:BioNameEntry_Pos0
BioDOBString = GUI:BioDOBEntry_Pos0
BioBirthplaceString = GUI:BioBirthplaceEntry_Pos0
BioStrategyString = GUI:BioStrategyEntry_Pos0
BioRankString = GUI:BioRankEntry_Pos0
BioBranchString = GUI:BioBranchEntry_Pos0
BioClassNumberString = GUI:BioClassNumber_Pos0
BioPortraitSmall = PAAirGen_S
BioPortraitLarge = PAAirGen
PortraitMovieLeftName = PortraitAirGenLeft
PortraitMovieRightName = PortraitAirGenRight
DefeatedImage = PAAirGen_L
VictoriousImage = PAAirGen_W
DefeatedString = GUI:BioDefeatedEntry_Pos0
VictoriousString = GUI:BioVictoriousEntry_Pos0
SelectionSound = Taunts_Grainger009
PreviewSound = Taunts_GCAnnouncer07
TauntSound1 =Taunts_Grainger061
TauntSound2 =Taunts_Grainger062
TauntSound3 =Taunts_Grainger063
WinSound =Taunts_Grainger064
LossSound =Taunts_Grainger065
NameSound = Taunts_GCAnnouncer14
Campaign = CHALLENGE_0 ;<----- IMPORTANT! This determines what challenge you will play once you select your General. To determine this, look at Campaign.INI
END

The last part is the trickiest of all, mainly because a lot of people aren't familiar with WND files, but once you know what you're doing, you will see how easy it is. With this in mind, open ChallengeMenu.WND and have a look. Be very careful around WND editing, just like with INI's. One mistake or a typo and there is a high possibility of the game crashing or not even launching.
Now it may look a bit confusing at first, but not to worry, soon enough everything will click into place. When the click is heard, yo will be quite happy and proud of yourself.
Anyways, search the file for "Position0", "Position1", "Position2" and so on through 11. Remember, there is no such thing as "Position12" and never will be, because the game will crash if you use any number more than 11. As far as we're concerned, there is no such number as 12
These positions actually represent each of the icons on the GCSM. Position 0 is the same as Persona0 in ChallengeMode.INI, which is General Granger, the Air Force General. Same goes for all the other 8 Generals. Now then, to add your own General select icon, copy any piece of code where it says GeneralPosition#. I use Position0 here:

CHILD
WINDOW
WINDOWTYPE = PUSHBUTTON;
SCREENRECT = UPPERLEFT: 152 198, ;<----- Coordinates for Upper Left portion of icon
BOTTOMRIGHT: 179 225, ;<----- Coordinates for Bottom Right portion of icon
CREATIONRESOLUTION: 800 600;
NAME = "ChallengeMenu.wnd:GeneralPosition0"; ;<----- Use 0-11 ONLY. Must match this number to the persona number in ChallengeMode.INI
STATUS = ENABLED+IMAGE+RIGHT_CLICK+CHECK_LIKE;
STYLE = PUSHBUTTON+MOUSETRACK;
SYSTEMCALLBACK = "[None]";
INPUTCALLBACK = "[None]";
TOOLTIPCALLBACK = "[None]";
DRAWCALLBACK = "[None]";
FONT = NAME: "Arial", SIZE: 8, BOLD: 0;
HEADERTEMPLATE = "LabelSmall";
TOOLTIPDELAY = -1;
TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,
DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
HILITE: 3 196 0 255, HILITEBORDER: 0 66 4 255;
ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
IMAGE: NoImage, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
DISABLEDDRAWDATA = IMAGE: PlayerStartDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
IMAGE: NoImage, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
END

Just to be clear, the start of the code for this button (icon) is CHILD and finish is at END.

This is basically your icon on the Generals Challenge selection map. Play around wih the coordinates and you will see that the icon also moves on the GCSM. To get exactly where you want the icon to go, I personally use the GenDev cameo mapper, because it tells you the coordinates really and it is very simple to use. Special thanks to Mastermind2004 for that tool.

You are done. Now you can select your own custom General on the map, and can go challenge other generals with him. That should be fun and exciting.

Mastermind Note:
This tutorial was originally published in the Deezire.net forums. You can find it in its original form here. If that link does not work, I have included the original tutorial, with full formatting here for your convenience

Layout by Origin-Network