Jump to content
Sign in to follow this  
avibird 1

Can you limit vehicle damage to allow only red status but not destroyed fully

Recommended Posts

Is there a way using the vehicle init to setup to allow the damage to only get to the status red but the vehicle can't be destroyed. I want the vehicle not to be able to move but not destroyed.

PS I know how to set the damage at the start of a mission but that is not what I need! Avibird

Share this post


Link to post
Share on other sites

addEventHandler ["HandleDamage", {.9;}];

This almost works the vehicle will take the damage very fast after 2-3 shots but will not be destroyed! however The vehicle unfortunately stays drivable. If I bring the damage to .91 the vehicle can and will be destroyed. WTF

Share this post


Link to post
Share on other sites

have you tried destroying parts of the vehicle

if I was doing it in a waypoint

vehicle this setHit ["motor", 1]

or take out some tires

vehicle this setHit ["wheel_1_1_steering", 1];
vehicle this setHit ["wheel_1_2_steering", 1];

you can also use the vehicle name instead of

vehicle this

if used in triggers

There may be other parts that can be damaged but it depends on vehicle type.

Share this post


Link to post
Share on other sites

hey F2K Sel if this is what my vehicle init looks like this addEventHandler ["HandleDamage", {.90;}];

how would I put your code above with that. I want the vehicle drivable at the start of the mission. The only reason I am going down this direction is because the mobile construction vehicle (MCV) after respawn the marker I have set on it will not spawn back with the vehicle. So my second option would be if the MCV when hit will get broken down and the blufor team will have to try to airlift it back or bring a repair trunk to the location to fix the MCV to allow them to move around the map/mission to build new FOB's.

When I put your code vehicle this setHit ["motor", 1] with mine it blow up lol going to test a bit more with your direction sir thank you. If I could get the marker thing working then I would not needs this (: Avibird

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

The damage system is dodgy at best. If you use sethit you may need to lower the other damage value as it may be added to 0.9

this addEventHandler ["handledamage",{;(_this select 0) setDamage 0.8; (_this select 0) setHit ["motor", 1]}]

Share this post


Link to post
Share on other sites

@F2k Sel after a few hrs of testing around with suggestions You are right the damage system is dodgy at best!!!

the vehicle this setHit ["motor", 1] with the setDamage still lets you drive the vehicle if you set the values < .9 and if you set values .9 or > then the trunk will blow.

vehicle this setHit ["wheel_1_2_steering", 1]; with the setDamage value to .9 will make the vehicle limited with its ability to move but it still can at a turtle pace. This will leave the trunk with one destroyed tire on the left middle side (drive side). If you up the setDamage to > .9 the trunk will blow up!

vehicle this setHit ["wheel_1_1_steering", 1]; with the setDamage value to .9 will make the vehicle more limited with its ability to move but it still can at a snail pace lol. This will leave thr trunk with one

destroyed tire on the left front side (drive side). If you up the setDamage to > .9 the trunk will blow up!

How can we add both the setHit to together in one codeline.

1. this addEventHandler ["handledamage",{;(_this select 0) setDamage .9; (_this select 0) setHit ["wheel_1_2_steering", 1]}] MIDDLE WHEEL DAMAGE.

2. this addEventHandler ["handledamage",{;(_this select 0) setDamage .9; (_this select 0) setHit ["wheel_1_1_steering", 1]}] FRONT WHEEL DAMAGE.

to make the vehicle move like a turtle/snail pace lol. Avibird.

---------- Post added at 15:58 ---------- Previous post was at 15:29 ----------

This code works which will destroy two tires on the left side

this addEventHandler ["handledamage",{;(_this select 0) setDamage .9; (_this select 0) setHit ["wheel_1_1_steering", 1];(_this select 0) setHit ["wheel_1_2_steering", 1]}]

How can you destroy more tires on the trunk if you want or is this a set value and damage model? This is a good fix for my marker issues with the respawning of the marker on a destroyed vehicle. In some ways it is better because the bluefor team needs to retrieve the vehicle now and not just have it respawn back at the main base.

Share this post


Link to post
Share on other sites

You will find a list of wheels here, http://www.kylania.com/ex/

When I try damaging the motor and use damage 0.8 it always disables the vehicle, I can't move and neither can the AI, if you damage more wheels you may need to lower overall damage again. (tested in A3)

You could also remove the fuel (_this select 0) setfuel 0;

You could also if the vehicle is empty lock the doors

this addEventHandler ["handledamage",{(_this select 0) setDamage 0.8;  if (count crew (_this select 0) ==0) then { (_this select 0) lock true }}]

Share this post


Link to post
Share on other sites

@ F2k Sel I can not get the motor to disable using 0.8 or 0.9 however if I set it to 0.91 it will blow up lol. I have the script setup so the front tire on the left side and the middle and rear tire on the right side gets damaged using the chat you gave me http://www.kylania.com/ex/. This makes the vehicle almost un drivable with no control for the direction it can go. This works well for my script for a mobile construction vehicle (MCV) . The MCV has the coin interface attach to it with the ability to switch the function on and off the vehicle so the players can build any type of fortification anywhere on the map/mission. The Marker that shows the vehicles location and identification stays with the vehicle because it never really gets destroyed. The issue I was having was getting the marker back on the MCV following respawn. J

Jigsor posted a script on my other thread that he says keeps the marker on the vehicle following respawn. I will give that script a look but for my MCV I put a construction site container on top of a MTR and it looks pretty cool. I can see a problem getting the trunk and container spawning exactly in the right setup because I needed to use some codes inside their init as well. Thanks for the help

Share this post


Link to post
Share on other sites
The damage system is dodgy at best. If you use sethit you may need to lower the other damage value as it may be added to 0.9

this addEventHandler ["handledamage",{;(_this select 0) setDamage 0.8; (_this select 0) setHit ["motor", 1]}]

Hi F2k Sel!

I like that script and make game more tactical, if will make mission without vehicles respawn. No 100% destroyed and if need, then vehicles repair. I tried with the tank different damages and it work, but problem is the tank takes damage even single pistol shot now, so the tank can destroy with rifle. How remove vehicle damage at rifle (to not disable AT damage) or is possible at all?

An example

BMP-2

// BMP-2 get all damages at the same time.

this addEventHandler ["handledamage",{;(_this select 0) setDamage 0.4;(_this select 0) setHit ["pas_l", 1];(_this select 0) setHit

["pas_p", 1];(_this select 0) setDamage 0.8}];

// but need hit series.

Hit 1. (_this select 0) setDamage 0.4;(_this select 0) setHit ["pas_l", 1] //half damage

Hit 2. (_this select 0) setDamage 0.8;(_this select 0) setfuel 0.3;(_this select 0) setHit ["pas_l", 1];(_this select 0) setHit ["pas_p", 1] //stop move

Hit 3. (_this select 0) setDamage 0.8;(_this select 0) setfuel 0;(_this select 0) setHit ["pas_l", 1];(_this select 0) setHit ["pas_p", 1] //destroyed. cool if can moment with flames?

Perhaps can make limit SQF originally, that all player vehicles don't take more damage than 0.8 and not needed set hits individually?

Cheers!

Edited by Katzok

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  

×