|QUOTE (YossiBz @ Saturday, Jan 19 2013, 13:06)|
|how to know if my vehicle hit some vehicle?|
For immediate evidence:
if you have a car from the 90's or newer air bag will deploy, the car will stop moving, your face will hit the air bag [or steering wheel] at incredible velocity, and you will suffer intense disorientation. You may loose consciousness for a few minutes or permanently, and your car will be destroyed.
You also may:
wake up in the hospital with an intense headache like a 9.0 earthquake, and if you're lucky your bed will be surrounded by people who love you... if you have any, suffer a time lapse or loss of memory, be covered in cuts and/or bruises and/or broken bones or be covered in bandages like a kega jo.
Of course if it was a minor accident you'll notice your car suddenly stopping or changing directions and experience the G of such sudden change. Your head might hit the side window. You'll hear a loud noise. You'll probably curse and
just being humorous
I'm just coming back to the game after a break, so I haven't use the DNSH in a while and I'm not sure about what's new, but I am going to assume that there isn't a crash detection object per se. There is however an object for your vehicle's damage level. You might make a loop object that monitors the damage level. To avoid an endless loop make sure it starts and ends when you enter and exit the vehicle respectively. Have it store the initial damage level of the vehicle [from when you enter it], then have the loop compare that with the current damage level every quarter second.
While you are in the vehicle:
If you exit the vehicle end the loop
While the initial and current damage are equal, re-compare them in 250ms.
IF the damage is raised, end then restart the loop from the beginning so the new initial health level is set to the new value while giving the loop an excuse to end [endless loops are a nightmare and kill your fps and crash your game. Create every excuse to end a loop].
Else If the damage is lowered, end the loop and call the object that begins the sequence of events to unfold when you crash.
This is probably a pretty crappy example compared with the scope of possibility with this SH, but hopefully this will help your brainstorming object not to return null