Adding Content - widberg/fmtk GitHub Wiki
There are some considerations that need to be made when adding new content to the game. This is where my notes live until its understood enough for the read the docs.
OpenBFS DATAS\TEST
LoadMaterialLib CHARACTERS\LIVERY_LIBS\TEST
CloseBFS
TT <Translation Text ID> "<Translation Text>"
AddPilotLivery <HEAD|BODY|CHEST|LEGS><Type ID> <Livery ID> <Translation Text ID> "<ALWAYS|NONE|<Race Name String>>" <NONE|<Bonus Code>>
AddPilotLiveryColor <HEAD|BODY|CHEST|LEGS><Type ID> <Livery ID> R128G0B0 R0G128B0 R0G0B128 R128G128B128
EndOfParsePilotLivery 13018790
The Livery Itself:
- Bitmap_Z referenced by the Material_Z -> diffuse and specular map
- Material_Z referenced by the MaterialAnim_Z
- MaterialAnim_Z referenced by the MaterialObj_Z -> Accessed from the MaterialObj_Z by index in the <HEAD|BODY|CHEST|LEGS> array
- MaterialObj_Z loaded by a TSC LoadMaterialLib ->
DB:>CHARACTERS>LIVERY_LIBS>TEST.TOTEMBITMAP
The Icon in the Menu:
- Bitmap_Z
Need to increment the third argument to load_vehicle_internal_names_from_trtext@00469DB0 for it to show up in the real menu. Game will crash at 00479910 if there are no liveries and you try to select the empty box in the liveries menu. the game seems fine with skipping the function if that member is null. Sidenote: you can allow the Damocles outside of its normal race by patching a jump from 004791A1 to 0047914B.
VEH_MUSCLE_ROAD_7
MESH_ID_MUSCLE_ROAD_7
DB:>CHARACTERS>LIVERY_LIBS>MUSCLE_ROAD_7.TOTEMBITMAP
DB:>GAMEOBJ>MUSCLE_ROAD_7.TGAMEOBJ
DB:>GAMEOBJ>MUSCLE_ROAD_7_DYN.TLOD
DB:>GAMEOBJ>MUSCLE_ROAD_7_SKEL.TLOD
also the userdefines have all sorts of "V:LINKR \"LeftHand\" \"MUSCLE_ROAD_6_STEER_LOD1\" LOD1\n\rV:LINKR \"LeftHand\" \"MUSCLE_ROAD_6_STEER_LOD2\" LOD2" in them.
// trtext/tt01.pc
// Text
// Insert it into the vehicle menu list
TT 3476 "MESH_ID_MUSCLE_ROAD_7"
TT 3477 "VEH_FLOTTE_BIGTRUCK_1 # Block-Out # Block-Out"
TT 15087 "DeLorean"
// clone.tsc
// Class
cloneclass MUSCLE_ROAD_7_DYN IT_Dyn_Vehicle_G
cloneclass MUSCLE_ROAD_7_SKEL BaseAgent_G
// Either patch the exe or add this to GameTsc/Story/VehLib.tsc
BSource GameTsc\Story\DeloreanLib.tsc
// GameTsc/Story/DeloreanLib.tsc
OpenBFS DELOREAN
LoadObjectLib GAMEOBJ\VEH_DELOREAN_1
LoadMaterialLib CHARACTERS\LIVERY_LIBS\VEH_DELOREAN_1
CloseBF
// VehiclesDef.tsc
// Info
AddVehicleInfo MESH_ID_MUSCLE_ROAD_7 MUSCLE ROAD 7 VEH_MUSCLE_ROAD_2 16109 1 MUSCLE
AddVehicleParams MESH_ID_MUSCLE_ROAD_7 MUSCLE_ROAD_2_DYN MUSCLE_ROAD_2_SKEL IT_PILOT_SKIN NAME_NULL NAME_NULL NAME_NULL
AddVehicleGPS MESH_ID_MUSCLE_ROAD_7 BUGGY
AddVehicleUnlock MESH_ID_MUSCLE_ROAD_7 0 "NONE" "NONE"
AddVehicleInterfaceParams MESH_ID_MUSCLE_ROAD_7 1 1 1 1 1 1 1
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R60G60B60
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R255G255B255
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R200G8B0
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R255G80B0
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R255G200B0
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R0G0B40
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R3G35B120
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R0G25B0
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R75G70B10
AddVehicleColor MESH_ID_MUSCLE_ROAD_7 R28G20B10
// Param/VehiclesParam.tsc
// Parameters
VehiclePP 0 "MESH_ID_MUSCLE_ROAD_7"
<cut for brevity>
EndOfVehiclePP
// GameTsc/Story/hubinfos.tsc
// Liveries
AddVehicleLivery MESH_ID_MUSCLE_ROAD_7 1 "Mount Rainier" 3110 ALWAYS NONE
AddVehicleLivery MESH_ID_MUSCLE_ROAD_7 2 "Mount Rainier" 3111 POI NONE -2474 -39309
AddVehicleLivery MESH_ID_MUSCLE_ROAD_7 3 "Salt Lake" 3112 POI NONE 61522 -63165
// GameTsc/Story/VehiclesUnlock.tsc
// Unlock
UnlockNeed VEHICLE MESH_ID_MUSCLE_ROAD_7 ALWAYS
The vehicle picture used in the garage is derived from the VEH_MUSCLE_ROAD_2 in AddVehicleInfo MESH_ID_MUSCLE_ROAD_7 MUSCLE ROAD 7 VEH_MUSCLE_ROAD_2 15087 2 MUSCLE. These icons are in DATA/SHARED.DPC. VEH_MUSCLE_ROAD_2 is a link name for a material anim in DATA/SHARED.DPC, and that material anim has a material and that material has a diffuse bitmap.
Even if you add liveries in the tscs they will not have an icon, it uses some default white fuel drum. These icons are in DATA/SHARED.DPC and have names like LIVERY_%s_%d or something. I'm guessing the mechanics of how it arrives at the texture is similar to in the menu icon case. The icon is overlaid on the fuel drum and does not contain the drum in the texture.
Pretty much the same story as liveries.
See the VehicleParam.tsc page on Read The Docs. Setting vp45 (num wheels) to a number less than the actual number of wheels reveals something interesting. All the wheels are still rendered but the car physically sags as if the missing wheels are not there. Also, only the first x many wheels you specify will spin when driving.
The Trident is interesting because it has flaps that move when you steer and fans that spin. It would be nice to know how that works.
See https://fmtk.readthedocs.io/en/latest/fuelcustommissions.html for race-related commands. The WORLD/USA1_CR1_57AD4EF1.DPC style bigfiles are loaded by world refs in WORLD/USA1.DPC that have an init script like "OpenBF WORLD\\USA1_CR1_57AD4EF1;LoadWorldRef DB:>LEVELS>HUBS>QUARTIER_1>3DNODEGEOMETRY>CR1.TWORLDREF;CloseBF" in them. The 57AD4EF1 is the hex crc32 of the world ref containing that init script.
000A561F:C6->90
000A5620:44->90
000A5621:24->90
000A5622:13->90
000A5623:01->90
001281E6:74->EB
0012B4B0:D9->C3
0012B4B1:05->90
0012B4B2:C0->90
0012B4B3:BF->90
0012B4B4:9D->90
0012B4B5:00->90