Rally Car and Xbox One Gamepad Example

Graphical resources like models and images.
10 posts Page 1 of 1
brittscott
Posts: 7
Joined: Sun Feb 22, 2015 12:30 am
by brittscott » Sun Nov 06, 2016 5:45 am


Info
Stuff I had started working on some time ago. I wanted to see if my old xbox keybinds would work with an Xbox One gamepad. The Rally car isn't the greatest and has it's issues. Take this resource as it is and learn from my mistakes. If anyone wants to fix or use this resource, you are more than welcome to.

Download Link:
https://drive.google.com/file/d/0B4K1M7P0W_qbOWxpaERrUE50Mk0/view?usp=sharing

Setup
1. Place "art" and "scripts" folders based on their folder hierarchy. Everything else is either reference or source files.

2. Run Torque3D and open World Editor.

3. Under Scene Tree, click "Library" tab -> click "Scripted" tab
-> click "Vehicles" folder -> click "RallyCar"

4. Exit world editor and walk into car to drive.

Vehicle features:
-headlights
-turn signals
-brake lights
-reverse lights
(These all do work, but are not working as intended.)
Bloodknight
Posts: 95
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Sun Nov 06, 2016 10:01 am
Vehicle features:
-headlights
-turn signals
-brake lights
-reverse lights
(These all do work, but are not working as intended.)


by not intended you mean when you hit the brakes, the headlights come on so you can see the full horror on the face of the victim late at night?
NekoDemon117
Posts: 35
Joined: Thu Feb 19, 2015 1:09 pm
by NekoDemon117 » Sun Nov 06, 2016 6:15 pm
Bloodknight wrote:
Vehicle features:
-headlights
-turn signals
-brake lights
-reverse lights
(These all do work, but are not working as intended.)


by not intended you mean when you hit the brakes, the headlights come on so you can see the full horror on the face of the victim late at night?

Oh, deer!
brittscott
Posts: 7
Joined: Sun Feb 22, 2015 12:30 am
by brittscott » Sun Nov 06, 2016 6:18 pm
lol yep that's it.

The car has a random skin on it and sometimes the lights don't show up the best. My way of thinking is going in reverse, it should show the brakes until the car starts moving backwards. Then the reverse lights should light up, but it doesn't currently do that.
Jason Campbell
Posts: 186
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Mon Nov 07, 2016 8:34 am
Thank you! Very cool.
JeffR
Steering Committee
Steering Committee
Posts: 763
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Nov 07, 2016 3:33 pm
Most excellent of works, good sir!
kent
Posts: 35
Joined: Sun Sep 04, 2016 11:54 pm
by kent » Tue Nov 08, 2016 9:10 am
Sweet! Thanks.

I'm tossing together a kitchen-sink WheeledVehicle resource (close enough to play with, but not quite ready to release). Is it OK if I add this model to it?

@
User avatar
Jason Campbell
: I already snagged your Jeep. Thanks to you as well. :-)
kent
Posts: 35
Joined: Sun Sep 04, 2016 11:54 pm
by kent » Tue Nov 08, 2016 10:19 am
brittscott wrote:lol yep that's it.

The car has a random skin on it and sometimes the lights don't show up the best. My way of thinking is going in reverse, it should show the brakes until the car starts moving backwards. Then the reverse lights should light up, but it doesn't currently do that.

The reverse lights aren't working because $movementSpeed is a constant. It will always be 1 unless it is changed with setSpeed() (then it will always be whatever you set it to). As it sits, looks like the lights *should* toggle every time the bound button is pressed or released.

It needs a vehicle velocity check so the reverse lights can be activated/deactivated when the velocity switches between positive/negative. But I don't think you can do the check where you are hooking it ( movebackward() should only get called when the key press state changes ). Maybe make a tickable script to manage the lighting toggled in movebackward() when $mvBackwardAction > 0. That might be a sort of dirty way to do it ... but it's the best I can think of right now.
brittscott
Posts: 7
Joined: Sun Feb 22, 2015 12:30 am
by brittscott » Tue Nov 08, 2016 5:23 pm
kent wrote:
brittscott wrote:lol yep that's it.

The car has a random skin on it and sometimes the lights don't show up the best. My way of thinking is going in reverse, it should show the brakes until the car starts moving backwards. Then the reverse lights should light up, but it doesn't currently do that.

The reverse lights aren't working because $movementSpeed is a constant. It will always be 1 unless it is changed with setSpeed() (then it will always be whatever you set it to). As it sits, looks like the lights *should* toggle every time the bound button is pressed or released.

It needs a vehicle velocity check so the reverse lights can be activated/deactivated when the velocity switches between positive/negative. But I don't think you can do the check where you are hooking it ( movebackward() should only get called when the key press state changes ). Maybe make a tickable script to manage the lighting toggled in movebackward() when $mvBackwardAction > 0. That might be a sort of dirty way to do it ... but it's the best I can think of right now.


I assumed there was a way, I just haven't used Torque for so long. I'm not the greatest programmer either. lol This was just something that I had worked on a few years ago. I wanted to throw it out in the chance that it might be use to someone.
brittscott
Posts: 7
Joined: Sun Feb 22, 2015 12:30 am
by brittscott » Tue Nov 08, 2016 5:24 pm
kent wrote:Sweet! Thanks.

I'm tossing together a kitchen-sink WheeledVehicle resource (close enough to play with, but not quite ready to release). Is it OK if I add this model to it?

@
User avatar
Jason Campbell
: I already snagged your Jeep. Thanks to you as well. :-)


Yeah, you can do whatever you want with it.
10 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest