Game Development Community

Brakelights

by Katrina Rose · in Technical Issues · 02/09/2005 (5:58 am) · 5 replies

Hi all,

I would like my vehicle to flash it's brakelights whenever the players use their brakes.

I've found a lot of info here in the forums saying that it's possible to do this using a sequence helper named 'brakelight' and a two frame ifl animation - one showing the brakelights off, the other showing them on.

Sounds simple enough.

Q. Does anyone out there have any idea how to setup the brakelight ifl file correctly?

Currently my ifl file is:

brakelight_off.png 1
brakelight_on.png 1

Brakelight_off 1 the vehicle texture map with the lights off, Brakelight_on is the vehicle texture map with the lights on.

Q. Are there specific frames I need to add keyframes on in the brakelight sequence helper in Max6?

Currently I have keyframes on the first and second frames of the sequence helper...these coincide with the frames listed in the ifl file.

Q. Is there any scripting I need to add to the car.cs file to make sure Torque sees and uses the brakelight ifl animation at the correct time?

Q. Is there an easier way to accomplish the brakelight effect?

thanks for any help that you folks can give,
k

#1
02/09/2005 (2:48 pm)
There is a working brakelight in the recent update to the BraveTree Car Pack
#2
02/11/2005 (5:46 am)
Coolness...thanks for the tip!

Is there a way I can get the brakelights to function without purchasing the car pack?

cheers,
k
#3
02/14/2005 (5:57 am)
Hi all,

After many cups of coffee I was able to answer my own question this morning...I dont need to add any extra scripting code! :)

For the benefit of anyone else out there who runs across the same issues I did I'll cobble together the highlights that I found on other threads. I used 3dMax 6 to create and export the vehicle model.

1. Create two texture maps - one showing the brakelights off, one showing the brakelights on.

2. Create an .ifl file that plays the brakelights off for 1 frame and the brakelights on for 1 frame.

3. Create a sequence helper and name it 'brakeLight'. Set two keyframes (I placed them at frame 1 and 2). Do not attach or link the helper to the vehicle mesh.

4. Open the sequence helper (brakeLight) modifer tab and expand the Export Control menu. Uncheck the transform animation box and CHECK the IFL animation box. Also uncheck the Cyclic sequence box and CHECK the Complete cycle box.

5. Export the vehicle (make sure the Collapse Transform box in unchecked in the DTS Export Utility Parameters menu).

6. The code to display the brakelights when the brakes are used is already in the engine so the graphics should swap with each other at the appropriate time without any problems.

cheers,
k
#4
02/14/2005 (5:37 pm)
Easy enough, thanks for sharing.
#5
04/25/2005 (10:31 am)
This isn't working for me, here are some sections from my dump file since the brakelight sequence seems to be generating okay in the exporter.

---------------------------------

Adding 1 ifl materials...

Adding ifl material "brakelight001.ifl".

Adding 2 sequences...

Adding sequence 0 named "brakelight"
One-shot sequence. Enabled animation: I , Forced animation: , Default priority = 1.
Duration = 0.03333, secPerFrame = 0.00175, # frames = 20
Sequence includes 0 nodes, 2 objects, 0 decals, and 1 ifl materials
0 rotations, 0 translations, 0 scales
--------------------------------------------------------
Sequences:
0: brakelight
1: root

Material list:
material #0: "". Place holder for ifl.

Any assistance on this would be appreciated