Skip to content

How To Create Buidable Upgrade

oelsart edited this page Feb 17, 2025 · 1 revision

Buildable Upgrade

Vehicle Framework has an upgrade system that enhances the status of vehicles and allows for the addition of crew slots and turrets.
https://docs.google.com/document/d/1eEgP7Mosyz8ruth3lLzPLLRV3F4kFRwAjQ7FVWlsoW8
This is usually provided in a vehicle-specific upgrade tree, but the Vehicle Map Framework provides a system for upgrading vehicles by building on top of the vehicle map.

CompClass

To set up a buildable upgrade, insert the following in the comps tag of the building's ThingDef.

<li Class="VehicleInteriors.CompProperties_BuildableUpgrades">
	<upgrades>
	</upgrades>
</li>

Add the upgrade content in a <li> node within <upgrades>.

StatUpgrade

It upgrades the status of a vehicle. the status defined as VehicleStatDef can be upgraded.
Example(Cargo Container)

<upgrades>
	<li Class="Vehicles.StatUpgrade">
		<vehicleStats>
			<li>
				<def>CargoCapacity</def>
				<value>120</value>
			</li>
		</vehicleStats>
	</li>
</upgrades>

VehicleUpgrade

It upgrades the vehicle's armor, health, and crew slots.
Example(Driver Seat)

<compClass>VehicleInteriors.CompVehicleSeat</compClass>
<upgrades>
	<li Class="VehicleInteriors.VehicleUpgradeBuildable">
		<roles>
			<li Class="VehicleInteriors.RoleUpgradeBuildable">
				<key>driver</key>
				<editKey>driver seat</editKey>
				<label>Driver</label>
				<handlingTypes>Movement</handlingTypes>
				<slots>1</slots>
				<slotsToOperate>1</slotsToOperate>
				<exposed>true</exposed>
				<pawnRenderer>
					<showBody>true</showBody>
					<drawOffsetNorth>(0,0,-0.15)</drawOffsetNorth>
					<drawOffsetSouth>(0,0,0.3)</drawOffsetSouth>
					<drawOffsetEast>(-0.3,0,0.15)</drawOffsetEast>
				</pawnRenderer>
			</li>
		</roles>
	</li>
</upgrades>
  • If it is a crew slot upgrade, it is recommended that the following tags be specified. Additional gizmos and float menus will be added.
<compClass>VehicleInteriors.CompVehicleSeat</compClass>
  • If it is a crew slot upgrade, it is recommended that the class be specified as follows. If it is using a pawn renderer or if it is an upgrade for a gunner slot, it is required.
<li Class="VehicleInteriors.VehicleUpgradeBuildable">
	<roles>
		<li Class="VehicleInteriors.RoleUpgradeBuildable">
		</li>
	</roles>
</li>
  • Armor and health upgrades can be written in the same way as in the Vehicle Framework.

TurretUpgrade

Turret upgrades are currently not implemented. Because it must be “drawn in place” like the driver's seat, it is not possible to use Vehicles.TurretUpgrade.
It will be implemented soon!