Game Development Community

Brakelights

by Katrina Rose · in Torque Game Engine · 02/14/2005 (2:58 am) · 11 replies

Hi all,

I'm neck deep in production and have hit a minor snag I hope someone can assist me with.

I am trying to make our game vehicle flash it's brakelights when the player hits the right mouse button.

I've researched the issue via the forums, documentation, and resources and have uncovered some general info concerning the graphics (one map with the lights off, one with the lights on) and the use of an ifl file but nothing about scripting.

Can anyone point me in the right direction?

cheers,
k

#1
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
#2
02/18/2005 (8:39 pm)
Well !very useful !
#3
02/19/2005 (9:09 am)
Quote: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.


What code is this? I have been trying to find this. I may have over looked it. Thanks.
#4
04/22/2005 (2:21 pm)
I've been able to get brakelights to play in the ShowTool but not in the actual engine. Has anyone else had this problem?
#5
04/22/2005 (8:20 pm)
And what exactly do you apply to the mesh in order for the texture animation to play? The .ifl file or the first frame of the texture sequence? I followed the instructions in the 3DS MAX docs regarding .ifl files and it appears a text file is generated which I apply to my mesh.Is this correct?
#6
04/22/2005 (9:01 pm)
@John Cooney- I think you copy the first frame texture rename it to something you call in the script and apply that to your mesh. The text file is the 'image file list' which you include with your models frame textures. Hope that helps..
#7
04/23/2005 (4:18 am)
.
#8
04/25/2005 (10:23 am)
Thanks Eric. Unfortunately, after having tried all these recommendations, its still not working in game. The dump file recognizes an IFL sequence and it plays in the ShowTool so I don't get what I'm doing wrong. If I knew how to post screenshots on this board I would to show examples.
#9
04/25/2005 (10:29 am)
Want to use bold, italics and add links to your text? Click here to learn how)
This field is Required
#10
04/25/2005 (1:43 pm)
Yeah, but I don't have a site to post/ ftp images to.
#11
04/25/2005 (1:47 pm)
@john - www.imageshack.ws
i've used it a little, it seems decent.