Creating an Advanced Dozer

Tutorial for Generals Gen, Zero Hour ZH

No Avatar

Hybrid

Category: Code
Level: Intermediate
Created: Wednesday July 29, 2009 - 7:44
Updated: Wednesday July 29, 2009 - 7:47
Views: 3848
Summary: How to enable more structures into your mod by creating an advanced dozer.
Rating
  • Staff-
  • Members-
  • Average-

0 votes

Page 1 2
This tutorial was designed to teach you a way to have more buildings in your mod than the dozer has space for. The Dozer has enough space to construct 11 structures, and one slot for removing mines. You may wish to remove the last one to create 1 extra slot, however in this tutorial it will stay. In this tutorial the new dozer will be an advanced dozer, and will create only more advanced structures.

First you will need these INI files:
CommandSet.ini
CommandButton.ini
Object/FactionUnit.ini
And the Generals.csf

You can find the INI files in the ini.big and the CSF file in english.big. (use a big editor like Finalbig or XCC Mixer to open .big files)

First we are going to have to create the unit in FactionUnit.ini, so open the file in notepade or wordpad and do a Find (Edit>Find) for 'Object AmericaVehicleDozer'. It should take you directly to the entry for the American Dozer, select the whole thing copy and paste the copy directly below it. Its a large entry so don't stop unitl you see all the '---'s going across the file.

Now we are going to change this entry so that it resembles a different unit rather than having an exact clone of the Dozer. Before you start, you may want to add a comment containing your name or alias so that finding your edits would be easy, because you would just have to do a find for your alias or name. After that we will have to change the name of the file, so it reads as the Advanced Dozer rather than the original Dozer.

Find:
Object AmericaVehicleDozer ;which should be on the first line
And Replace with:
Object AmericaVehicleAdvDozer

Notice how we added the 'Adv' to change the file to be identified as its own unit. Now we are going to want to skip down to ';*** Design Parameters ***'.

We are going to want to change:
DisplayName = OBJECT:Dozer
To:
DisplayName = OBJECT:AdvDozer

And:
BuildCost = 1000
To:
BuildCost = 1200

What we have just done is change the Display name to read from a different CSF entry (in which we will change later in this tutorial) and we've changed the price to be more expensive. You don't have to change the price if you don't want to, I did because its a advanced dozer and can build more advanced structures. Next we are going to want to skip down below 'ShroudClearingRange = 200'.

Here add:
Prerequisites
Object = AmericaStrategyCenter
End

What this does is makes sure that you can't build the Advanced Dozer until you have constructed a Strategy Center.

The last thing we are going to have to do to the FactionUnit.ini is make sure it reads the correct CommandSet. (in which we will create later in this tutorial)

To do this find:
CommandSet = AmericaDozerCommandSet
And Replace with:
CommandSet = AmericaAdvDozerCommandSet

That is all we have to do in FactionUnit.ini so you may save and close it now. Next we are going to open CommandButton.ini. In CommandButton.ini find 'CommandButton Command_ConstructAmericaDozer', copy the whole entry, and paste it right below it. (again you may wish to make a comment with your name) Now we are going to modify the entry to this:

CommandButton Command_ConstructAmericaAdvDozer ;add an 'Adv'
Command = UNIT_BUILD
Object = AmericaVehicleAdvDozer ;add an 'Adv'
TextLabel = CONTROLBAR:ConstructAmericaAdvDozer ;add an 'Adv'
ButtonImage = SACDozer
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipUSABuildAdvDozer ;add an 'Adv'
End

What we have done is modified the CommandButton of the Dozer to fit the neeeds of the Advanced Dozer. I'll break down what every module means, even the ones we didn't edit. The 'Command = UNIT_BUILD' means that every time the button is clicked to build the object. 'Object = AmericVehicleAdvDozer' is the object that is build every time the button is click. 'TextLabel = CONTROLBAR:ConstructAmericaAdvDozer' is the CSF entry for the label when you hover the cursor over the button. 'ButtonImage = SACDozer' is the cameo used for the button. 'ButtonBorderType = BUILD' is the Identifier for the User as to what kind of button this is. 'DescriptLabel = CONTROLBAR:ToolTipUSABuildAdvDozer' is the CSF entry for the description when you hvoer the cursor over the button. We are now done with CommandButton.ini, so you may save and close it now.

Next we will open up CommandSet.ini. This file controls what buttons are were in different construction stuctures and dozers. We will be editing 2 entries, and creating 1 new one. First off we will create the new entry, it will be much like the Dozer, only with less structures. You will enter this code below the Dozer:

CommandSet AmericaAdvDozerCommandSet
1 = Command_ConstructAmericaSupplyDropZone
2 = Command_ConstructAmericaDetentionCamp
3 = Command_ConstructAmericaParticleCannonUplink
12 = Command_DisarmMinesAtPosition
End

We just created a new CommandSet for our Advanced Dozer. This CommandSet tells the game that in the first 3 build slots of our Advanced Dozer, will be buttons for constructing the Supply Drop, Detention Camp, and Particle Uplink Cannon. And of course the Advanced Dozer can clear mines much like the original Dozer. You can add other advanced structures in your mod, you have 8 empty slots to fill up with advanced structures! Now we have to edit the original Dozer so that it can't build the advanced structures anymore. (or else our Advanced Dozer would be useless)

Get to the Dozer entry and remove the Commandsets for the Suply Drop, Detention Camp, and Particle Cannon. Be sure that all the numbers line up properly though, you don't want to have gaps in your buttons. Feel free to rearange the buttons as you please. This is what I had when I was finished modifying it:

CommandSet AmericaDozerCommandSet
1 = Command_ConstructAmericaPowerPlant
2 = Command_ConstructAmericaStrategyCenter
3 = Command_ConstructAmericaBarracks
4 = Command_ConstructAmericaSupplyCenter
5 = Command_ConstructAmericaAirfield
6 = Command_ConstructAmericaPatriotBattery
7 = Command_ConstructAmericaWarFactory
8 = Command_ConstructAmericaCommandCenter
12 = Command_DisarmMinesAtPosition
End

Now there are 3 empty spaces for your to place new buildings from your mod, and 8 empty spaces in the Advanced Dozer's CommandSet. You now have a total of 11 empty spaces for any new structures you wish to add to your mod!

Credits

Original MaterialThe_kid

Return to top