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

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.

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

A Guide for Workers & Resources: Soviet Republic
By: LovelyPL
Short tutorial (beta version) to "Soviet Republic" game.

### 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.