3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: skids marks, on what event?  (Read 4017 times)

« on: August 17, 2009, 08:37:33 PM »
hello
im new at 3D RAD and im investigating everything i want in my game.

skids marks are one of those things since i saw this video:
http://www.youtube.com/watch?v=AAQJSXfK-gE

ive searched in this forum and readed some posts about making these skids marks with trails, wich looks ok to me, but my question is, what event i have to use?

i think i could use brake o acceleration on it's first seconds using some custom script to measure these values, BUT! then again, i'd like to make skids marks when the car slides on its side, like drifting right?
i think that happens in that video AND... i was looking at the available events for both cars and wheels and in the objects menu and cannot find any event that would trigger up my skids marks.

i think THE event would be when the car lose traction, but i cant find anything like that.

any idea about how can i setup this?

thank very much, loop!  :)
« Last Edit: August 17, 2009, 08:39:26 PM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #1 on: August 18, 2009, 11:31:57 PM »
Ha ha, I was thinking of posting this exact question. I'd love to know how to do this.

psikotropico

« Reply #2 on: August 18, 2009, 11:59:07 PM »
Hi loop

You can get a realistic effect with tire marks if you use a script, showing them when you turn a bit... for that, you need to know the car's steering angle in runtime and activate the trails only when the steering angle is not equal to 0 or is between a range, i.e: between 5 and 30 (if you turn right) and between -5 and -30 (if you turn left)

Also, you can accomplish this with a skid sound and dust particles, and you will get a bit more realistic simulation...

hope it helps


« Reply #3 on: August 19, 2009, 05:57:27 AM »
hey psikoT, it definitly helps!

also, another idea came to me today earlier while i was checking the Script Object Reference and saw this: iObjectSpin(OBJ_X,Vector3)

i think i could link that to the traction wheels and monitoring these wheels'spining and the car velocity (or the other wheels, the one that spin faster is burning!) i should know when it loses traction. i could even know what wheel loses traction! and show the skid mark for that wheel!! pretty complex but it the final result should be great...
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #4 on: August 19, 2009, 07:29:21 AM »
first test!!  8)

i put this in a script:
Code: [Select]
   if (IN_22 > (IN_0+1.5) || IN_22 > (IN_44+1.5) || IN_22 > (IN_66+1.5)) {OUT_89=0.8;} else {OUT_89=0;}
   if (IN_44 > (IN_0+1.5) || IN_44 > (IN_22+1.5) || IN_44 > (IN_66+1.5)) {OUT_111=0.8;} else {OUT_111=0;}

where IN_22 and IN_44 are speed for the rear wheels (the ones that lefts marks) and the other IN_s are the speed for the other 3 wheels.
the OUT_s are the opacity for the trails, and voiala!



now i just need to produce them only when the car is sticked to the ground, those skids marks in the middle of the air dosnt rule that much  :D

---------------------------
i could use some help with that last point (check that the car is on the ground). tried a couple of things (on contact, on proximity) but didnt work. on contact checked via script works but only with the car not the mesh wheelss, but the car is not an option because even on its roof is on contact
« Last Edit: August 19, 2009, 09:53:46 AM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!

Mic

« Reply #5 on: August 19, 2009, 09:01:46 PM »
You might have to have a monitor an event on contact object to know when the wheels are in contact with the ground.
« Reply #6 on: August 19, 2009, 10:07:18 PM »
yeah.. well, as i said i already tried event on contact, and the problem with that is the wheels are meshes and not objects, and it looks the thing wont detect the contact of the mesh (wheel) with the ground. so that didnt work.

what works with event on contact is link it to the car, but... the car can make contact with its roof and there gonna be skids marks floating all around...  :-\
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #7 on: August 20, 2009, 03:03:10 AM »
You need to link the EventOnContact to individual Car object wheels. To do so make sure the wheel (part of Car object, not the SkinMesh) has the crosshair cursor on it, before linking it to the EventOnContact.

The procedure is the same you use to attach SkinMesh wheel to the Car object wheels, as shown here.
« Reply #8 on: August 20, 2009, 04:06:49 AM »
this is a nice little thread! iv been trying this for ever, unfortunatly im no good at script
« Reply #9 on: August 20, 2009, 06:17:35 AM »
Thank you Fernando!

it works now  :)
well, kinda  :-\
on big crashes there still a few flying skids, but i think the cause could be that the ground, barriers, circuit, etc is the same and only rigid object. maybe with a rigid object for the ground alone the anomaly dissapear.

is looking good, yes!
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #10 on: December 11, 2009, 03:28:28 PM »
Loop could you post a Project with your script in?
So far i have the marks working okay on the ground and not in the air (i get the odd bit here and there) see attached project.

When in contact with the ground i only want the marks to show when im skidding, i tryed the above script but i dont know how you are getting the ins for all the wheels?

« Reply #11 on: December 11, 2009, 03:52:16 PM »
When in contact with the ground i only want the marks to show when im skidding, i tryed the above script but i dont know how you are getting the ins for all the wheels?

Im getting the INs for the wheels from the skinmeshes wheels and not from the actual car wheels?

follow me? the skinmeshes wheels you attach to the car wheels to make it looks nice? I link those skinmeshes to the script, and since those skinmeshes spin along with the car wheels, them give me the INs values relative to the wheels that I need.

try it, if you still cannot make it work Ill try to post a sample later... preferably before march  :P
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
« Reply #12 on: December 11, 2009, 07:25:49 PM »
Loop: is this a good example of your skid method?:

I kind of made it into a drifting game where you can slalom around the rocks. It should help some of you sharpen your winter driving skills anyway.. :P  ;D
« Reply #13 on: December 11, 2009, 07:57:50 PM »
I cannot open your file Rush3Fan  :P

I'll be able to take a look at it in 3 months or so :P :P
« Last Edit: December 11, 2009, 08:01:46 PM by loop »
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!

psikotropico

« Reply #14 on: December 12, 2009, 12:59:55 AM »
f***ing 6.41
Pages: [1] 2