Installing Building Blocks 101

Various bits and pieces that are useful for creating new mods
Locked
snoopy55
Posts: 1962
Joined: Mon Nov 06, 2006 5:13 am
Location: Centralia, Ill, USA

Installing Building Blocks 101

Post by snoopy55 » Sun Jun 08, 2008 1:53 am

There have been some questions about adding things to maps, so I guess it's time those questions were answered.

This is part of the reason that Building Blocks (BB) were originally created. The FPK file is the data the game needs and the XML file is the basic programming that it needs. I say basic because sometimes it does need to be edited, but I'll get to that later.

The easiest place to start is adding an Engine. The adding of an Engine requires three edits. First is the FPK file, second is the RRT_Trains XML and last is the RRT_Names file. For this example, and others to come, I'll use the attached version of Hill Valley Mess. Go into 'Construction Set', 'Building Blocks Are Us announces Engines Are Us!' and download one of the Engines Building blocks. You might want to look into Jancsika's 'Tested Building Blocks' thread for a tested BB. I'll use the 'AC4400' here. Extract the files from the ZIP directly into UsersMaps. This will put the needed FPK where it needs to be. Open 'RRT_Trains_Hill_Valley_Mess.xml' and the Engine's BB XML. In the BB, copy everything from <Train> to </Train>. The pasting part is where a lot of people mess up. You can put the addition anywhere in the XML, but you must keep from breaking up existing code and make sure you put it in the correct place. For this one, go to the bottom of the file and place it before </RRTTrains>. Do not leave any empty lines. In some cases this can cause trouble, so it is best to avoid it all together. Here is what the bottom of the XML looks like after the paste:

<szSharpAngleSqueal>AS3D_CURVE_SQUEAL</szSharpAngleSqueal>
<szAverageAngleSqueal>AS3D_CURVE_SQUEAL_MEDIUM</szAverageAngleSqueal>
<szSlightAngleSqueal>AS3D_CURVE_SQUEAL_LIGHT</szSlightAngleSqueal>
</Train>
<Train>
<szName>TAG_NAME_AC4400</szName>
<Year>1994</Year>
<szManufacturerName>GE</szManufacturerName>
<szModel>GE_AC4400.kfm</szModel>
<szDummyModel>GE_AC4400_Dummies.nif</szDummyModel>
<szCar>_v2</szCar>
<szNewTrainImage>event_newtrain_AC4400.dds</szNewTrainImage>
<szGroundClackSound>AS3D_CLACK_PLANET_GROUND</szGroundClackSound>
<szBridgeClackSound>AS3D_CLACK_PLANET_BRIDGE</szBridgeClackSound>
<MaxSpeed>12</MaxSpeed>
<Speed0>15</Speed0>
<Power>18</Power>
<Cost>300000</Cost>
<MaintenanceCost>4000</MaintenanceCost>
<Diesel>1</Diesel>
<RunLength>80</RunLength>
<HasEngineer>0</HasEngineer>
<rgbDefaultColor>65,139,255</rgbDefaultColor>
<BitmapIcon>
<szFile>routing_F3.tga</szFile>
</BitmapIcon>
<fStartSoundCrossFade>2.0</fStartSoundCrossFade>
<szStartSound>AS3D_TR_DIESEL_ENGINE_START_3</szStartSound>
<szStopSound>AS3D_TR_DIESEL_ENGINE_STOP_3</szStopSound>
<fSpeedStartWait>0.25</fSpeedStartWait>
<fSpeedCrossFade>3.0</fSpeedCrossFade>
<iPitchChange>2000</iPitchChange>
<SpeedSounds>
<szSpeed>AS3D_TR_DIESEL_ENGINE_SLOW_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_SLOW_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_MID_SLOW_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_MID_SLOW_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_MID_FAST_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_MID_FAST_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_FAST_LP_3</szSpeed>
<szSpeed>AS3D_TR_DIESEL_ENGINE_FAST_LP_3</szSpeed>
</SpeedSounds>
<szSharpAngleSound>AS3D_CURVE_SQUEAL</szSharpAngleSound>
<szAverageAngleSound>AS3D_CURVE_SQUEAL_MEDIUM</szAverageAngleSound>
<szSlightAngleSound>AS3D_CURVE_SQUEAL_LIGHT</szSlightAngleSound>
</Train>

</RRTTrains>

You should have indentations. At this point save your changes. Now you need to add the name. Open 'RRT_Names_Hill_Valley_Mess.xml'. Copy The second part of the code from the Engine XML if there is one. (they will be added to existing BBs) If there isn't one, leave it alone for now, there will just not be a description when the Engine is displayed in the Roundhouse. If the '<RRTTrains>' is in the Names XML, copy this part:

<TextKey>
<Tag>TAG_NAME_AC4400</Tag>
<Text>AC4400</Text>
<Gender>M</Gender>
</TextKey>

Paste this inside <RRTTrains> </RRTTrains>. If not, copy the whole section of code and paste it. You should get something to this effect:

<Names>
<RRTTrains>
<TextKey>
<Tag>TAG_NAME_AC4400</Tag>
<Text>AC4400</Text>
<Gender>M</Gender>
</TextKey>
</RRTTrains>
<RRTCities>
<TextKey>
<Tag>TAG_MP_08_NAME_BASS</Tag>
<Text>Bass</Text>
<Gender>M</Gender>
</TextKey>

Save the file and test the map. The fastest way to test an Engine entry is to set the <Year> for '1800'. This puts it as one of the first Engines to show in the Roundhouse. If you don't see it in the map you are editing, go to the left as there may be a few other Engines before it. Once you are sure the editing was correct, change the Year back to what it was.

If you have any questions, let me know.

I'll get to work on the next BB installation explanation ASAIC.
Attachments
Hill_Valley_Mess.zip
(4.16 MiB) Downloaded 460 times
Last edited by snoopy55 on Tue Sep 30, 2008 9:59 pm, edited 1 time in total.
I'm correct 97% of the time..... who cares about the other 4%....

Locked