Here's the config
Code: Select all
kuid <kuid2:132903:19216:2>
origin "USA"
rem "bogey <kuid:242091:50251>"
bogey <kuid:96914:50326>
engine 0
name "30SRRL Gondola 24ft"
mass 3864
company "SR&RL"
kind "traincar"
script "gondola"
class "ARN_Gondola"
enginespec <kuid:-1:42004201>
fonts 1
fonts-path "flatcar"
category-region-0 "US"
category-region-1 "AU"
category-region-2 "NZ"
category-region-3 "CA"
category-era-0 "1940s"
category-era-1 "1930s"
category-era-2 "1920s"
category-era-3 "1910s"
category-era-4 "1900s"
category-era-5 "1890s"
category-era-6 "1880s"
category-era-7 "1870s"
category-class "XSU"
asset-filename "srrl_271"
icon0 <kuid:-3:10164>
obsolete-table {
}
mesh-table {
default {
mesh "srrl_271_body/srrl_271_body.im"
auto-create 1
effects {
arn_g0 {
kind "attachment"
att "a.rng0"
default-mesh <kuid2:104722:2511038:2>
}
arn_g1 {
kind "attachment"
att "a.rng1"
default-mesh <kuid2:104722:2511038:2>
}
0 {
kind "attachment"
att "a.couplerB"
default-mesh <kuid:371339:60018>
}
1 {
kind "attachment"
att "a.couplerA"
default-mesh <kuid:371339:60020>
}
}
}
sideboards {
mesh "srrl_271_body/HiSides.im"
auto-create 1
use-parent-bounds 1
}
load {
mesh "load/load.im"
anim "load/load.kin"
auto-create 1
use-parent-bounds 1
effects {
product-texture {
kind "texture-replacement"
texture "load_map.texture"
}
}
}
}
queues {
ballast {
size 15857
initial-count 0
animated-mesh "load"
product-kuid <kuid:113998:9003>
allowed-categories {
0 <kuid:-3:10040>
}
conflicts-with-queues {
0 "woodchips"
1 "coal"
2 "sand"
}
}
woodchips {
size 15857
initial-count 0
animated-mesh "load"
product-kuid <kuid:-3:10002>
allowed-categories {
0 <kuid:-3:10040>
}
conflicts-with-queues {
0 "coal"
1 "ballast"
2 "sand"
}
}
coal {
size 15857
initial-count 0
animated-mesh "load"
product-kuid <kuid:44179:60013>
allowed-categories {
0 <kuid:-3:10040>
}
conflicts-with-queues {
0 "ballast"
1 "woodchips"
2 "sand"
}
}
sand {
size 15857
initial-count 0
animated-mesh "load"
product-kuid <kuid2:43955:11004:1>
allowed-categories {
0 <kuid:-3:10040>
}
conflicts-with-queues {
0 "ballast"
1 "woodchips"
2 "coal"
}
}
}
extensions {
arn_data-132903 {
number_low "200"
number_high "299"
number_colour "3"
}
}
trainz-build 2.4
thumbnail
description "Sandy River & Rangeley Lakes 30 inch gauge Gondola."
username "30ng SR&RL Gondola 24ft"
author "P.Pardoe-Matthews <Narrowgauge>"
organisation
contact-email "peterpar@internode.on.net"
contact-website
license "This item is supplied free of charge for use only by registered users of Trainz. It must not be modified, offered for sale or supplied as a part of a Payware package. It must not be provided for downloading on any site unless this is expressly permitted in writing by the copyright holder.
It is not classed as a low polygon design and no responsibility will be accepted for performance or other problems on the users computer arising from this or any other reason
If any use is made of textures supplied as part of this model, this use must be acknowledged in the Description field of the Config.tx
P.Pardoe-Matthews Copyright 2003, 2004, 2005, 2006"
kuid-table {
arn_lib <kuid2:104722:2501038:4>
arn_grid <kuid2:104722:2511038:2>
arn_icon <kuid2:104722:1959365:2>
nitrate <kuid:86661:9310230>
0 <kuid:96914:50326>
1 <kuid:-1:42004201>
2 <kuid:-3:10164>
3 <kuid:371339:60018>
4 <kuid:371339:60020>
5 <kuid:113998:9003>
6 <kuid:-3:10040>
7 <kuid:-3:10002>
8 <kuid:44179:60013>
9 <kuid2:43955:11004:1>
}
Code: Select all
// ARN (AutoRunningNumbers) script for rolling stock,
// (c)Wulf_9/TrainzProRoutes.org, December 2004.
//
// Vehicle creators/scripters are encouraged to add this
// code to their scripts (if used), or use it as-is if
// not. The only stipulation is that you make sure the
// ARN Icon, kuid2:104722:1959365:1 is specified in the
// config.txt (icon0, icon1, etc) and in the kuid-table.
// * NOT TO BE USED IN PAYWARE WITHOUT PRIOR AGREEMENT *
include "vehicle.gs"
class ARN_Gondola isclass Vehicle {
Asset meAsset;
Library arnlib;
MeshObject rng_left;
MeshObject rng_right;
Soup mySoup;
string myNumber = " ";
int myskin = 0;
void SetNumber(string iNum, int c_id) {
string[] theNum = Str.Tokens(iNum, ",");
theNum[0] = "__________" + theNum[0];
int s = c_id;
int i;
for (i = 0; i < 4; i++) {
rng_left.SetFXNameText("carnumber_a" + i, " ");
rng_left.SetFXNameText("carnumber_b" + i, " ");
rng_right.SetFXNameText("carnumber_a" + i, " ");
rng_right.SetFXNameText("carnumber_b" + i, " ");
}
rng_left.SetFXNameText("carnumber_a" + s, theNum[0]);
rng_left.SetFXNameText("carnumber_b" + s, theNum[1]);
rng_right.SetFXNameText("carnumber_a" + s, theNum[0]);
rng_right.SetFXNameText("carnumber_b" + s, theNum[1]);
}
void CheckNumber(void) {
int low = mySoup.GetNamedTagAsInt("number_low");
int high = mySoup.GetNamedTagAsInt("number_high");
int clr = mySoup.GetNamedTagAsInt("number_colour");
int n;
string[] CarNums = new string[0];
string[] NumData = new string[0];
CarNums[0] = meAsset.GetKUID().GetHTMLString();
CarNums[1] = (string)myskin; // this will always be 0 unless you have multiple skins
for (n = 0; n < (high - low); n++) {
CarNums[n + 2] = (string)(low + n);
}
// only take even numbers
myNumber = arnlib.LibraryCall("RunningNumber", CarNums, null);
NumData[0] = myNumber;
SetNumber(arnlib.LibraryCall("FormatNumber", NumData, null), clr);
SetRunningNumber(myNumber); // allows calling GetRunningNumber() on this vehicle
}
/* SetProperties is called by the game when any data which has been saved to the
session file is to be recalled. This occurs when the session is first loaded and before the
Object Property browser is called. This method is also when the user presses UNDO.in
Surveyor.
public void SetProperties(Soup soup)
*/
float BeginLoad(LoadingReport report)
{
Asset meAsset = GetAsset();
World.PlaySound(meAsset, "coal_load1.wav", 1000.0f, 20.0f, 1000.0f, me, "");
return 0.0;
}
float BeginUnload(LoadingReport report)
{
Asset meAsset = GetAsset();
World.PlaySound(meAsset, "coal_dump1.wav", 1000.0f, 20.0f, 1000.0f, me, "");
return 1.0;
}
public void Init(void) {
inherited();
meAsset = GetAsset();
string cr_ID = Str.Tokens(meAsset.GetKUID().GetHTMLString(), ":")[1];
Soup extConf = meAsset.GetConfigSoup().GetNamedSoup("extensions");
mySoup = extConf.GetNamedSoup("arn_data-" + cr_ID);
arnlib = World.GetLibrary(meAsset.LookupKUIDTable("arn_lib"));
rng_left = GetFXAttachment("arn_g0");
rng_right = GetFXAttachment("arn_g1");
CheckNumber();
AddHandler(me,"Object","","VehicleHandler");
}
};
Norm