quicky "how to" to get the doors nicely to fit:
-build body complete with doors and door frames. no special a.point required
-"save selected" doors and frames to separate door-file
-delete doors in body file
-in door file:
-- tree is b.r.main - b.r.doors - doors
-- freeze door-frames for reference and animate doors as usual (I' still go with 36 frames for 90 deg swing - only
2 keys)
-- hide left doors and left dummies - export .im and .kin to unload-right folder
-- repeat for other side.
...done
mesh-table
{
default
{
mesh Railbus2_body/Railbus2_body.IM
auto-create 1
}
right-passenger-door
{
mesh Railbus2_body/unload_left.IM
anim Railbus2_body/unload_left.KIN
auto-create 1
}
left-passenger-door
{
mesh Railbus2_body/unload_right.IM
anim Railbus2_body/unload_right.KIN
auto-create 1
}
}
think that this gets heavy if you want the sounds to match up with the animation. You have to use GMax to
export key frame links from the animation along with the kin file. There is a one page FM
(TRS2004_Animation_Events.pdf) somewhere on Auran's site. My copy is corrupted so I can't actually read it
until this evening but from memory it cross refers to the game script reference for allowable parameters - not for
the faint hearted.
There have been some problems lately with the DLS trashing sound entries in configs - don't know if that's been
fixed.
Stand clear of the doors, please mind the gap.
Stand clear of the doors, please mind the gap.
Stand clear of the doors, please mind the gap.
Stand clear of the doors, please mind the gap.
Andi
Again, if I understand correctly, "door_open" doesn't do anything, it's just a section
name. "trigger open" assigns "open" as the trigger for the sound event. I'm not sure
what the next line does, but it was in both examples, with no explanation. The "distance
5100" should be the distance which the sound can be heard from, anything closer than
that should hear the sound. "sound" then specifies what sound should be played.
I've got this bit of script in the main config.txt file, not the mesh table. Anybody know if
this is correct? Also, anyone know what the "nostartdelay 1" line does? Third, the .wav
file is in the _body directory. Does it need to have that specified before the name of the
.wav file? Seeing as everything else seems to have that, maybe I'll go back and try
that...
As I suspected, that was the culprit. Now the sound plays, and won't shut off
There's probably some way to make it play only once, but I guess Auran doesn't want to
give us that information...
Changing my event file to:
1 Generic_Event animstop
1 Sound_Event /open
2 Sound_Event open
28 Sound_Event open
29 Sound_Event /open
Starts the sound when the doors start to open. Stops the sound when the animation
stops. Upon closing, it plays the sound again when the animation starts in reverse, and
stops it when the doors are closed.
Adding the "Generic_Event animstop" prevents the sound from continuing after the
animation forward-reverse cycle.
Adding a "Sound_Even /open" in the next frame after a "Sound_Event open" seems to
prevent the sound from playing. It might actually play, but at 1/20th of a second (based
on 30 frames/sec), you don't hear anything.
Obviously, your sound can't be longer than your animation in this example. As I'm just
adding the sound of doors opening/closing, it doesn't need to be. If you wanted an
announcement, say, when the doors opened (which might be longer than the animation),
changing the trigger names should work, like this:
1 Generic_Event animstop
1 Sound_Event /announcement
1 Sound_Event /open
2 Sound_Event announcement
2 Sound_Event open
28 Sound_Event open
29 Sound_Event /open
In this example, at frame 2 of the animation, both the door sound and the
announcement would be played. The door sound would stop at frame 29, while the
announcement continues playing until its end, or the animation reverses and gets to
frame 1, whichever comes first. When the doors start to close, and the animation is
reversed, the door sound plays at frame 28, and stops at frame 1. The annoucement isn't
played, or plays for 1/20th of a second, and isn't heard.
You could also use a different sound for the door opening and closing if you wanted. I
haven't actually tested this with more than one sound, so there might be the possibilites
of problems as Marlboro mentions.
Remember to make your .wav files mono. Even using the "ambient 1" setting, stereo files
sound funny.
Marl, here are the maps that I used for the interior. They are all taken from the main
interior tga, just made much smaller for the exterior mesh.
In MAX, the material uses these maps:
Diffuse Color
Opacity
Reflection
Marl, here are the settings"
Opacity: 17
Reflection: 46 (yes, it's used as a .tga)
kuid
bogey
enginespec
interior
enginesound
hornsound
kind traincar
engine 1
mass 45600
origin USA
company BREDA
name MARTA-TRS
username MARTA-TRS
fonts 0
kuid-table {
0
1
2
passenger
}
mesh-table {
default {
mesh marta_trs_body/marta_trs_body.im
auto-create 1
}
left-passenger-door {
mesh marta_trs_body/left_door/left_door.im
anim marta_trs_body/left_door/left_door.kin
auto-create 1
att a.door0
}
right-passenger-door {
mesh marta_trs_body/right_door/right_door.im
anim marta_trs_body/right_door/right_door.kin
auto-create 1
att a.door1
}
}
queues {
passengers {
passenger-queue 1
size 11
initial-count 6
product-kuid
attachment-points {
0 a.passit00
1 a.passit01
2 a.passit02
3 a.passit03
4 a.passit04
5 a.passit05
6 a.passit06
7 a.passit07
8 a.passit08
9 a.passit09
10 a.passit10
}
allowed-products {
0
}
}
}
cabinsway 1.0
category-region-0 US
category-era-0 1980s
category-era-1 1990s
category-era-2 2000s
category-class
Trainz GamePack switches off the Time Slider - IMO it's easier to work without it.
For animating continuously-rotating parts like wheels, keyframes are fiddly and un-
necessary, use a Float Expression Controller instead, which is much smoother, takes only
a few seconds to do, AND you can copy/clone the dummy and the controller will be
copied with it (not sure if this applies to keyframes, I've not copied/cloned a keyed
animation).
I'll try and give a brief summary, this applies to a 3-axle loco bogie but the principle still
holds for other objects. If you follow these steps exactly you will wonder why you did it
any other way
Preparation :-
a) Select the Move button on the main toolbar and, using the LH viewport, click on each
axle in turn and note the Y coordinate of the axle centres. It is important to have a
standard, and the only really useful datum is to place the axle centres at Z = 0 (move it
all down if not). This makes the ride height independant of wheel diameter for any given
bogie.
b) Click on the Time Configuration button at lower right of screen and set the animation
frame-count to 30 (which gives frames from 0 to 29). Make sure 'real time' is ticked and
the speed is set to 1.0 and Ok it.
Implementation :-
1) Click in the top viewport, create a dummy (helper), name it b.r.main and locate it at
0,0,0 - don't make it huge, it only needs to exist, not take over the screen
Now create b.r.wheel0 and move it to the front axle position, ensuring X = 0 and Y = the
measurement you just took. Height is Z = 0 of course. You should now have the first
wheel dummy located precisely at the centre of the front axle. Now click the Rotation
button on the main toolbar.
2) Select the LH viewport and maximise it, then select the wheel dummy b.r.wheel0. Go
to the Motion tab on the flyout panel, and click the + sign next to 'Assign Controller' to
expand the parameter dialog, you should now be looking at a small pane with the default
controllers listed there.
3) Click on Rotation : TCB Rotation to select it. You should now see the little button
above that pane with the green triangle light up. Click on it to open the 'Assign Rotation
Controller' window and select Euler XYZ and Ok it. You should now see that the Euler
controller has replaced the TCB one.
4) Click the + sign next to Euler XYZ to expand the axis list, then click on X Rotation :
Bezier Float and once again use the little button with the green triangle to assign the
next controller. From the list, select 'Float Expression' and Ok it.
5) You should now be looking at a new window titled 'Expression Controller : b.r.wheel0 \
X rotation'. Click in the text area under the label 'Expression' and delete the zero that's
there. Now type in the following expression (you can copy-paste this)
360*sin(NT)
then press 'Evaluate' then 'Close'.
( As an aside, you can play around with the angular component to change the speed and
direction of rotation, e.g. 720 will give 2x speed, while -360 will give reverse rotation at
1x speed, etc. but don't do this on a wheel, it would look VERY odd )
6) If you've got it right, you should see b.r.wheel0 smoothly turning in a forwards
direction when you play the animation. Ok, we're cooking on gas! Stop the anim and
reset to frame 0.
With this dummy still selected, go to the Edit menu and select 'Clone' . Change the name
to b.r.wheel1 and make sure it is set to 'copy' NOT 'instance', then Ok it. Now move this
new dummy to the previously-noted Y dimension of the next axle centre. Repeat for the
third dummy (if it's a triple-axle setup), naming it b.r.wheel2. You can now play the anim
again and ensure all 3 dummies are rotating smoothly around their respective axle
centres. ALWAYS reset the animation to frame 0 after running it, or you will likely as not
see some odd things happen in-game.
7) Link each axle to its respective dummy, then link each dummy back to b.r.main.
Deselect all and export as usual. Remember the animation for a bogie MUST be called
'anim.kin' in order for it to work correctly in Trainz.
All of the above is brought to you courtesy of JoshEH who first showed us how to do it in
another post which I couldn't find
__________________
TRS2004 v2.4 Build 2365
Last edited by Wulf_9 on 7th Jan 2005 at 01:33 PM
Report this
Wulf
Search for 'Euler XYZ' and you will find the lost thread.
I am annoyed, I replied to it but didn't click 'Notify' and missed the explanation.
However, your post goes into more detail.
If you look in the 'Steam animation thread' you will find a post by AltoDave who has
developed this method further and laid out a method of animating steam engine cranks
and crossheads using expressions.
I have done some trials with it and it is very powerful. I am looking forward to another
loco so that I can use the method. It is certainly a timesaver and produces very accurate
results.
One result is that once the basic animation is created, it can be applied to any new
locomotive simply by inserting new values as constants in the respective Controllers. All
the helpers are positioned automatically, and the wheel and crank objects only need to
be linked to complete the animation. He has also extended this system further to allow
for inclined pistons.
Hopefully, we can persuade Phil to create one of his excellent tutorials to spread the
message.
Cheers
Peter
__________________