Post
by snoopy55 » Thu Nov 27, 2008 6:15 pm
Ok, let's start a minor debate here with a major tutorial.
Note!: the blue is the changes made to the XML code.
First, you own a railroad. I've just developed a new Good for you to deal with. It's a bean, how do you ship it? Grab a grain car, make sure it's clean, and ship it.
<TrainCar>
<szName>BNSF Grain Car</szName>
<szGood>Beans</szGood>
<szModel>Grain_Car_bnsf.Kfm</szModel>
<szDummyModel>Grain_Car_dummies.nif</szDummyModel>
<szIcon>ICON_Car_Grain.dds</szIcon>
<szGroundClackSound>AS3D_CLACK_PLANET_GROUND</szGroundClackSound>
<szBridgeClackSound>AS3D_CLACK_PLANET_BRIDGE</szBridgeClackSound>
<RunLength>30</RunLength>
</TrainCar>
Place the Beans BB into the Goods XML, put the Beans FPK and BNSF_Grain_Car FPK into your UesrMaps.
Now you want a place to grow it. You don't want that old Grain Farm or Corn Farm, so go to the New Barn DDS files thread and get that zip. There are two ways to do this. If you are making a SAM and not planning on having any Farms but the new one then take the barn DDS you wish to use and rename it "grain_elevator_diff.dds". Being the newest file by that name, it will override the original one. Note!: it will only effect the map you put it into. It will NOT effect any other maps or the Original maps. If you are able to play with the nif files, go in and change the DDS file name to the one you are using, along with any other files you are wishing to rename, and put them into a folder in your UserMaps. NOTE! When renaming a KFM set like this it is NOT necessary to rename all the files that the KFM uses! You only need to rename the files you edit, such as the KFM, NIF and the DIFF DDS files. If you feel the NMRL DDS needs to be changed, it can be. If you are unable to do it yourself, ask and be patient and I think you'll get someone to help you. One of the other two files has to do with light. If anyone can nicely explain those two files, please do so and, if possible, how to make them out of the DIFF DDS. If there is a build up file, go in and change the files name in that also.
The XML code:
<RRTIndustry>
<szName>Bean Farm</szName>
<szModel>Bean_Elevator.kfm</szModel>
<szGrowKFM>Bean_Elevator_Build_Up.kfm</szGrowKFM>
<szTerrainmap>TerrainMap_GrainElevator.tga</szTerrainmap>
<fScale>1.0</fScale>
<bIsCoastal>0</bIsCoastal>
<bIsMountainous>0</bIsMountainous>
<bHasFields>1</bHasFields>
<bInCity>0</bInCity>
<iCost>-1</iCost>
<Production>
<Resource>
<Input>None</Input>
<Output>Beans</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
<DisplayNames>
<szDisplayName>The @CITY Bean Farms</szDisplayName>
<szDisplayName>@CITY Feed Co.</szDisplayName>
<szDisplayName>@CITY Grain Company</szDisplayName>(remove this line)
<szDisplayName>@CITY Seed and Grain</szDisplayName>
<szDisplayName>@CITY Mills, Ltd.</szDisplayName>
</DisplayNames>
<szIcon>
<szFile>icon_beans_32.tga</szFile>
</szIcon>
</RRTIndustry>
The changes are simple enough. You can pack this, along with the files you use, and create a BB out of it. Just ask and I'll give a tutorial on how it's done.
The Annex for this one is simple enough:
<Depot>
<szName>Bean Farm Annex</szName>
<szModel>Grain_Elevator_Annex.kfm</szModel>
<szCreateKFM>Grain_Elevator_Annex_Creation.kfm</szCreateKFM>
<InfluenceRadius>500.0</InfluenceRadius>
<IsAnnex>1</IsAnnex>
<BuildCost>25000</BuildCost>
<fScale>1</fScale>
</Depot>
On the naming of the Annex, be sure you take the name you gave the Industry and add 'Annex' to the end of it. The game will look for the Annex using the name of the Industry. If you want, you can edit the DDS of your Annex to match the color of the Goods, in this case Beans, but it's not required. If someone has a problem with it, ask them to do it for you.
Well, we have the new Good, going into the TrainCar from the Annex. Your job as a railroad company employee is done. And forget the paycheck, it ain't gonna happen.
We have the Good sitting in a Traincar, so let's make it into Food. This can be done following the Farm editing using the Food Plant. You can go so far as to edit the looks of the Plant, or add a Beans to Food production:
<Production>
<Resource>
<Input>Grain</Input>
<Output>Food</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
<Resource>
<Input>Beans</Input>
<Output>Food</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
</Production>
Or replace Grain with Beans:
<Production>
<Resource>
<Input>Beans</Input>
<Output>Food</Output>
<InputOutputRatio>1.0</InputOutputRatio>
</Resource>
In all of this, be sure you pay strict attention to the spelling.
What we have done here is edit a resource, an Annex, a TrainCar and an Industry.
The Good itself can be edited simply by changing its name. And take that a few steps further and play with the '_64' TGA image in a graphics program and create your own Good. The various fruits were done by searching the Images in Google for a simple picture and doing a bit of editing and resizing. Give it a background color and a bit of cut, copy and pasting and you have the Icon. Name it, save it, resize it to 32, save it and resize it to 16, save it and you have the 3 required Icons. Decide how it would be most likely shipped, copy one of the CISV TGAs I made and paste the size 16 Icon into it. Check the existing Goods in the Wiki and in the Goods Are Us! thread and use the next number available for the first letter of the Goods name. Edit the name and TGA file names in the XML file, change the price if you so choose and give it some Industry Titles, serious of goofy and save it. Paste a size 64 Icon over the JPG and you have the display Icon for the thread.
Any time you create a new item for your map you can publish it as a BB. One thing I'd like to see avoided is taking existing items, making a minor change to them and posting them as a new item. Five different 'Beans' and six different colored 'Bean Farms' and four different 'Bean Cars' is a bit overkill. Creating several different colored/textured Farms would be nice. The name is not important, and they can be edited as shown above when used. Different TrainCars that haul grains that have different paint schemes sounds good also, but using the same paint scheme and posting them because you are hauling a different Good would be a bit much.
Now I said that and there will probably be people who disagree, but each to his own and I'm not going to say 'Get that off my thread!'. And I'm not going to get upset if someone posts their thoughts on all of this, positive, negative, neutral, hey, post your thoughts.
If you decide to post any of your work as BBs, please try and follow the existing forms. This makes it easier for people to use them as they will follow the structures used in the instructions.
Hey, let's do one of those dreaded "EVENTS" for those Beans......
<Event>
<szTitle>BEAN_DECREASE</szTitle>
<szHeadline>STINK BUGS INVADE BEAN CROPS</szHeadline>
<szSubHead>Farmers wearing gas masks plow plundered plants under.</szSubHead>
<szImage>event_us_graindecrease.dds</szImage>
<Effects>
<EventEffect>
<szType>Good</szType>
<szGood>Beans</szGood>
<fModifierMin>.9</fModifierMin>
<fModifierMax>1.0</fModifierMax>
<fDurationMin>180</fDurationMin>
<fDurationMax>360</fDurationMax>
<fAccel>0.1f</fAccel>
<fDecel>0.05f</fDecel>
</EventEffect>
</Effects>
<szEarliestDate>1/1800</szEarliestDate>
<szLatestDate>12/2050</szLatestDate>
<fProbability>0.2</fProbability>
<bShowNewspaper>1</bShowNewspaper>
</Event>
<Event>
<szTitle>BEAN_INCREASE</szTitle>
<szHeadline>A NEW BEAN DIET CREATED</szHeadline>
<szSubHead>Dieters clear store shelves of legume family!</szSubHead>
<szImage>event_us_graindecrease.dds</szImage>
<Effects>
<EventEffect>
<szType>Good</szType>
<szGood>Beans</szGood>
<fModifierMin>1.3</fModifierMin>
<fModifierMax>1.8</fModifierMax>
<fDurationMin>180</fDurationMin>
<fDurationMax>360</fDurationMax>
<fAccel>0.1f</fAccel>
<fDecel>0.05f</fDecel>
</EventEffect>
</Effects>
<szEarliestDate>1/1800</szEarliestDate>
<szLatestDate>12/2050</szLatestDate>
<fProbability>0.2</fProbability>
<bShowNewspaper>1</bShowNewspaper>
</Event>
The creation of new Images would be great, but I'm not getting into that here. Again, watch your spelling, and don't be afraid to use the Event file. The ONLY problem I've found in using this file is having an Event in it that does not have a matching Good in the map.
If you have any other questions or if I left anything out, do a post.
I'm correct 97% of the time..... who cares about the other 4%....