Arma 3
Vehicle damage scripting help
I'm trying to script a mobility kill on a vehicle while its in motion using "unit setDamage 60" but the script is completely destroying the vehicle and killing the crew inside, which is not the intent. Is there a script I can use to target specific modules such as the engine or tracks that will keep the vehicle from exploding?
Originally posted by MATTXYO:
Correct way:

In trigger Activation add:
v1 setHitPointDamage["hitengine",1];v1 setHitPointDamage["hitrtrack",1];v1 setHitPointDamage["hitturret",1];

Where v1 was used as the vehicle name.
< >
Showing 1-15 of 20 comments
MATTXYO Jul 4, 2019 @ 5:40pm 
You can use the setHit command to damage parts of a vehicle.
MATTXYO Jul 4, 2019 @ 7:34pm 
If you had a tank named v1 via the eden editor attributes, you could use the below as an example trigger:

Activation: BLUFOR

Condition: v1 in thislist

OnActivation:
0=[]spawn{ damagePartList = ["hit_engine_point","hit_fuel_point","hit_trackL_point","hit_trackR_point"]; { v1 setHit [_x,1] }forEach damagePartList; }
Last edited by MATTXYO; Jul 4, 2019 @ 7:34pm
Dankan37 Jul 5, 2019 @ 8:51am 
Also, setDamage 60 is wrong, the maximum is 1, so you should write .6
Originally posted by MATTXYO:
If you had a tank named v1 via the eden editor attributes, you could use the below as an example trigger:

Activation: BLUFOR

Condition: v1 in thislist

OnActivation:
0=[]spawn{ damagePartList = ["hit_engine_point","hit_fuel_point","hit_trackL_point","hit_trackR_point"]; { v1 setHit [_x,1] }forEach damagePartList; }
I put this in almost exactly the same as you have it, with changes in the variable name of the target unit and the omitting of one of the hitpoints but the script simply didn't work. rather than blowing up entirely or working correctly, the script didn't run. Any ideas on how to fix this?
MATTXYO Jul 9, 2019 @ 5:54am 
Without seeing what you have written or the setup I would be guessing, if you can post what you have that would be best.
Originally posted by MATTXYO:
Without seeing what you have written or the setup I would be guessing, if you can post what you have that would be best.
0=[]spawn{
daamgePartList =
["hit_engine_point","hit_fuel_point","hit_trackR_point"];
{ bradley setHit [_x,1]}
forEach damagePartList;};

is it worth noting that the target vehicle is from a RHS mod?
MATTXYO Jul 9, 2019 @ 8:38am 
If you have copied and pasted your code, the spelling of damagePartList is incorrect. If that is not it, the hitParts maybe named differently for the RHS vehicle.

Try the below edited code:
0=[]spawn{ damagePartList = ["hitengine","hitfuel","hitrtrack"]; { bradley setHit [_x,1] }forEach damagePartList; }
Last edited by MATTXYO; Jul 9, 2019 @ 8:57am
already tried changing the hitParts. No dice
the the typo was only here, I double checked to make sure it was not spelled incorrectly in the editor
Last edited by PapermacheSherman; Jul 9, 2019 @ 9:35am
MATTXYO Jul 9, 2019 @ 8:13pm 
The last example was tested on a RHS vehicle and it worked as intended.
PapermacheSherman Jul 10, 2019 @ 6:00pm 
is it possible that the inclusion of extra functions to be executed is causing the script to fail? in the trigger that I am attempting to execute this script, I have 6 other functions setup to kill six other entities, but each are their own function separated by semicolons.
MATTXYO Jul 10, 2019 @ 6:01pm 
Post what you have if you like, it may shed light on a potential problem.

Or you can remove the other parts of the script to test the vehicle damage and see if it works for you.
Last edited by MATTXYO; Jul 10, 2019 @ 6:07pm
PapermacheSherman Jul 10, 2019 @ 6:26pm 
I've removed the extra scripts, recopied and pasted the script that you yourself tested, set the trigger activation to blufor and set up the proper condition to activate the trigger.I know the trigger is activating because I have it setup to play an explosion effect and the task progresses once the trigger activates, (and I've even tested it without the explosion effect). still the script refuses to run. I'm attempting to run the script on an M2A2ODS Woodland varient (RHS_M2A2_wd). sorry for not specifying that sooner
MATTXYO Jul 10, 2019 @ 6:46pm 
Try:

0=[]spawn{ damagePartList = ["HitEngine","HitRTrack"]; { bradley setHit [_x,1] }forEach damagePartList; }
PapermacheSherman Jul 10, 2019 @ 6:52pm 
still nothing
MATTXYO Jul 10, 2019 @ 6:53pm 
Can you link the mod version you have.
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: Jul 4, 2019 @ 5:34pm
Posts: 20