Jump to content
Sign in to follow this  
Dr. Mojo- PhD

Triggering damage to a vehicle's tire

Recommended Posts

I'm making a co-op mission wherein after going a certain distance in a car you'll hit a trigger set to detect you and blow the tire in your car. So, a couple of questions.

One: I don't want to use setDamage because that will damage the entire car, obviously. I just want the tire to blow to make it still usable in the loosest sense but useless to the player(s).

Two: Is there any way for the trigger to only trip when it detects specifically that the car is driven by any of the co-op players? I'm assuming that this would involve naming each of the nine players and then having the trigger check to see if any of them are the drivers of the car before damaging whatever vehicle they're driving.

Oh, I'd also like to blow a single headlight on a 5ton.

I apologize if any of this has been asked but after scouring thousands (figuratively -- I hope) tutorials for a solution to waypoints/triggers problem I was having, everything's sort of become a blur.

Share this post


Link to post
Share on other sites

Based on my OFP scripting, the only way to specifically damage a tire or component is it (cam)create something to damage it. I have been using this for spawning "saved" units, so the player is no-where near the vehicle when it happens. Tires are easily damaged by underground explosions, or bullets. Silenced ammo might work for your requirements. I use trig based scripts that only work properly on flat ground, uneven ground will involve more trig based on the pitch and roll of the vehicle (assuming this data can be retrieved). If you only need it to work in one exact location to one type of vehicle, just experiment with different heights to create the bullet until you get the desired effect. You may also want to make sure the vehicle is undamaged beforehand.

The trigger should be very easy, just use something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(driver vehicle == player1) OR (driver vehicle == player2) .... in the condition. I don't have ArmA so I can't be any more specific as I can't test it :/

Share this post


Link to post
Share on other sites

Ah, thank you. I think what I'll do is create a wall of suppressed M9 bullets then and just set the trigger to repeatedly. The ground itself is flat and level in the area, thankfully, but it covers a swath of road that the player could take anywhere.

Share this post


Link to post
Share on other sites

Hmm, again, it's a newbie problem, but how exactly do I use camCreate to effectively create some suppressed M9 bullets to fire into the tires of my cars?

Also, searching the BI Community Wiki, I came across armorWheels as a float. Is there any way to modify this by a trigger (take the wheel armor down to zero, say) to destroy the tires on a car?

Share this post


Link to post
Share on other sites

I dont know if its possible to give damage (scriptwise) to certain model selections...even if you succeed,the damaged wheel in ArmA is rather dodgy (burned/rusty).

What u could consider is an engine failure...

--A bang followed by the overheaten radiator sound.

--Smoke script attached to the front of the vehicle

--Engine command sets engine off.

GL

Share this post


Link to post
Share on other sites

this is a part of a test script i created in OFP. Arma would be similar, but I'm not sure as I don't have it. camCreate was never really meant to create anything but cameras, so if BI changed it you may need another create command and appropriate syntax. look at the wiki.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_ammo camCreate [(getPos testVehicle select 0) + (_dist*(sin getDir testVehicle)),(getPos testVehicle select 1)+ (_dist*(cos getDir testVehicle)),(getPos testVehicle select 2)-_depth]

where:

_ammo = the type of ammo used, eg "grenade"

testVehicle = the unit to be damaged (hardcoded in this test).

_dist = distance from 0 point of vehicle, along it's direction of facing. + = forward. To hit a specific point, change the angle: eg cos ((getDir testVehicle) + 25) should be near the front right wheel.

_depth = distance from 0 point of vehicle +1 = 1 meter under ground.

Share this post


Link to post
Share on other sites

I love you all so much. This has been a great help. The things I'm doing in this mission are so bizarre that they require so much custom crap that it's giving me a mini-stroke just trying to get it all to work properly, especially for an overly ambitious noob editor.

I think all you guys have earned yourself a place in the final mission.

Last night I found an old OFP editor class for mines that included caltrops -- was going to ghetto-rig that but both the russian and english download links were dead =(.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×