Scripting

==Question and Answers about Scripting==
===Q: Why does my vehicle/building not do (x)?===
A: Every property of your mod is written in the script. You can add properties through the script. To see what does what, you can visit the official documentations for vehicles
	Documentation for modders - VEHICLES
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
Official documentation for script.ini file for vehicles. When new tokens will be added, documentation will be updated.
	Documentation for modders - VEHICLES
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
Official documentation for script.ini file for vehicles. When new tokens will be added, documentation will be updated.
and buildings.
	Documentation for modders - BUILDINGS
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
This is documentation for SCRIPT.INI file used by buildings.
	Documentation for modders - BUILDINGS
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
This is documentation for SCRIPT.INI file used by buildings.
We also recommend you visit the guide for vehicle skinning
	How to make a skin for vehicle
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
Short tutorial (beta version) to "Soviet Republic" game.
	How to make a skin for vehicle
A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
Short tutorial (beta version) to "Soviet Republic" game.
----
===Q: How do i set the vehicle station?===
A: See instructions in below image:
----
===Q: How do I make a building 'fire proof'?===
A: In the Building Script remove all instances of VEHICLE_STATION i.e: $COST_WORK_VEHICLE_STATION_ACCORDING_NODE this will make the building.fire file generate blank (or not at all)
----
===Q: How do I make set up an underground mesh?===
A: 3 tried and tested steps to get custom underground meshes to work (Aug2022):
Note: If you do not need a custom shaped underground and only need the piping, the game automatically adds underground piping at the positions of $CONNECTION_WATERPIPE or $CONNECTION_SEWAGE you specify.
No need to bother with anything else mentioned below.
====Step 1:====
In order to make life and debugging easier, put your underground mesh and corresponding material to use in the same folder as your building.ini
You can call the 2 files anything you want.
(In the example below I named them model_under.nmf and material_under.mtl)
Add this line in the building.ini:
$UNDERGROUND_MESH_WORKSHOP model_under.nmf
material_under.mtl
====Step 2:====
You need to specifically name the node to be nuilt from your underground mesh at any construction phase. (In the example below I name that part UnderPipes in Blender) :
$COST_WORK_BUILDING_NODE UnderPipes
====Step 3:====
This may be unnecessary but if you want to be 100% sure, make the construction phase costs where you built the underground part be calculated automatically with tech_steel:
$COST_RESOURCE_AUTO tech_steel X
So a complete example of the construction phase would be:
* $COST_WORK SOVIET_CONSTRUCTION_STEEL_LAYING 1.0
* $COST_WORK_BUILDING_NODE UnderPipes
* $COST_WORK_VEHICLE_STATION -11.5000 0.0000 11.0000 -13.0000 0.0000 11.0000
* $COST_RESOURCE_AUTO tech_steel 0.6
Your underground mesh should get built and be fully viewable in the game.
Addendum: "Some buildings which are designed to have underground stuff have a default UNDERGROUND_MESH_DEPTH_OFFSET, but you need to provide it for other buildings if your underground mesh does not show.
You have to set that "depth" value larger than the depth of your model like adding $UNDERGROUND_MESH_DEPTH_OFFSET 10 or something like that."
----
===Q: What is bbox correction for locomotives, how do i use it?===
A: It allows you to shrink the bbox to allow for articulated locomotives or trams or Tender engines. Included in the picture explanation is also a new token that allows you to fix the axle distances allowing for shorter engines than the game allows by default.