4. Config.txt
file entries
Once
you have successfully exported the mesh into the correct location then you
need to setup the config.txt file to show the location and the name of the
load mesh. You also need to setup the mesh table as TRS2004 will not recognize
the attachment without the mesh-table.
| script "Hopper" |
This tells TRS the name of the script file |
| class "Hopper" |
This tells TRS the class referenced by the script. |
soundscript
{
door_close
{
trigger door_close
nostartdelay 1
repeat-delay 1
distance 5, 170
sound
{
coupling_1.wav
}
}
} |
This is the sound effects that are played when the unloading sequence
is played. |
mesh-table
{
default
{
mesh Gondola_body/Gondola_body.lm
auto-create 1
} |
This tells TRS2004 where to find the main body mesh. NOTE In this
example this entry points to a level of detail file. |
shadow
{
mesh Gondola_shadow/Gondola_shadow.im
} |
This tells TRS2004 where to find the shadow file. |
load
{
mesh Gondola_body/Load/Load.im
anim Gondola_body/Load/Load.kin
auto-create 1
use-parent-bounds 1 |
This is where you type in the location of the load.im mesh file
that you just created. It is critical that you type in the path name
and the file name exactly. TRS2004 is case sensitive so you must
type in any capitals that you have in the path or filename.
Auto-create means that the mesh is created as soon as the main
body is created.
use -parent-bounds is a JET workaround. |
effects
{
product-texture
{
kind texture-replacement
texture "load.texture"
}
}
}
} |
The effects section allows for extra effects to be added to the
mesh.
Product-texture allows the coal texture to be replaced by a woodchip
or other type of load texture when an industry that supports it
is accessed. This requires the next section to reference the types
of load the gondola will accept. |
queues
{
load0
{
size 101819
initial-count 0
animated-mesh load
product-kuid <KUID:44179:60013>
allowed-categories
{
0 <KUID:-3:10040>
}
}
} |
This is the section where you need to tell TRS2004 the size of
the gondola in liters and also the default product-kuid the gondola
will accept. In this case it is setup to accept coal as the default
load. In the allowed-categories section you need to add all the types
of load that the gondola will accept. In this case it is set to accept
Bulk Load which is basically any type of loose load.i.e Sand, woodchip,
gravel, coal,etc |
smoke0 {
; "vehicle unload" particle effect
particle effect
attachment a.unload_pfx0
mode time
color 0,0,0,250
rate 8
velocity 2
lifetime 2
minsize 1
maxsize 4
enabled 0
}
smoke1 {
; "vehicle unload" particle effect
particle effect
attachment a.unload_pfx1
mode time
color 0,0,0,250
rate 8
velocity 2
lifetime 2
minsize 1
maxsize 4
enabled 0
} |
In this section you need to add the effects displayed when the
gondola is unloaded. Make sure you specify the attachment point for
the particle
effects. Also the attachment points must begin with a. and end with
_pfx0 (index the 0 for each additional attachment point). |
Once you have the config.txt file setup properly then you need to create
a script file with the following information included.
|
include "vehicle.gs"
class Hopper isclass Vehicle
{ |
This is required information that tells TRS2004 the
name of the script file referenced and also the class of the script. |
float BeginLoad(LoadingReport report)
{
Asset meAsset = GetAsset();
World.PlaySound(meAsset, "coal_load1.wav", 1000.0f, 20.0f, 1000.0f,
me, "");
return 0.0;
} |
This is the loading sequence. This will play a sound when the loading
begins. |
float BeginUnload(LoadingReport report)
{
SendMessage(me, "pfx", "+0+1");
Asset meAsset = GetAsset();
World.PlaySound(meAsset, "coal_dump1.wav", 1000.0f, 20.0f, 1000.0f,
me, "");
return 1.0;
} |
This is the begin unloading sequence. In this section you can play
sounds and also specify an animation event to occur such as the opening
of the doors. It also tells TRS2004 to begin the creation of particle
effects. This is where the name of the attachment point is required.
The pfx in this section references the pfx in the attachment name
and the +0+1 references the number on the end of the attachment name.
You can also specify other things to happen here such as texture
replacement. |
float EndUnload(LoadingReport report)
{
Sleep(1.0);
SendMessage(me, "pfx", "-0-1");
return 1.0;
}
};
|
This is the end unloading sequence. In this section you can play
sounds and also specify an animation event to occur such as the closing
of the doors. Attachment points see previous section. |
There are many different methods for the creation of the load and you
should use whatever method suits your situation the best. There are
also different methods to hide the load mesh. The above method works
best for a gondola with straight ends. If you have a hopper that tapers
as it empties then you will need to break the plane up into smaller
pieces and animate them so that as the load empties the pieces move together
so that they overlap otherwise as the hopper empties the load will be
visible outside of the hopper.
NOTE If copying and pasting from this tutorial please make sure that
the correct quotes are copied. Using the wrong type of quotes such as
those used in Word will cause errors.
Was
this tutorial helpful? Not enough or too much detail? Points not
explained properly? Suggest any improvements? Please let me know
what you think here.
|