Changes

Jump to navigation Jump to search
No change in size ,  17:06, 6 February 2020
Line 307: Line 307:     
You can either write your scripts directly in your [[TyD|TyD]] file as such:
 
You can either write your scripts directly in your [[TyD|TyD]] file as such:
  '''Script_EndOfDay''' "'''if''' (Product.GetCashflow(<span style="color:blue">false</span>).Last() > <span style="color:blue">100</span>) { Product.DevCompany.MakeTransaction(-Product.GetCashflow(<span style="color:blue">false</span>).Last() * <span style="color:blue">0.1</span>, <span style="color:blue">Bills</span>); } <span style="color:green">//Pay 10% of last days income if it is more than $100"</span>
+
  '''Script_EndOfDay''' "'''if''' (Product.GetCashflow(<span style="color:blue">false</span>).Last() > <span style="color:blue">100</span>) { Product.DevCompany.MakeTransaction(-Product.GetCashflow(<span style="color:blue">false</span>).Last() * <span style="color:blue">0.1</span>, <span style="color:blue">Bills</span>); } <span style="color:green">//Pay 10% of last days income if it is more than $100</span>"
 
Or you can put your script in separate files and refer to them relative to your mod root folder, by starting with a forward slash:
 
Or you can put your script in separate files and refer to them relative to your mod root folder, by starting with a forward slash:
 
  '''Script_EndOfDay''' "/Scripts/MyScript.txt"
 
  '''Script_EndOfDay''' "/Scripts/MyScript.txt"

Navigation menu