Jump to content
Sign in to follow this  
Kydoimos

Script to Make Demo Charges more Powerful Against Static Armour?

Recommended Posts

Heya - just need a script or a command or something to allow a demo charge to destroy a tank/artillery piece with one detonation. I know I can set the damage on the vehicle and make it lower, but then I'd be stuck with the half-damaged visual texture. What I would like is to be able to destroy the vehicle when the damage reaches 0.8 or something. Should be an easy one, but I don't really know how to work with the 'IF' command, if that is what is needed. Thanks guys!

---------- Post added at 21:54 ---------- Previous post was at 21:48 ----------

Apparently other people reckon you CAN destroy artillery with one demo charge. The S29 Sochor seems to need at least 5-6.

Share this post


Link to post
Share on other sites

Single explosive charge directly behind the vehicle:

qH9m5pL.jpg

Crew bailed and vehicle is not drivable. A damage vehicle player results in 0.15533. The commander turret can't turn, but can fire. Gunner turret/main gun is damaged but working fine. Vehicle won't start or move.

Edited by kylania

Share this post


Link to post
Share on other sites

Sochor's are mad tough.

Had to call in AT Mines via Artillery on MSR ahead of it. Placed Charge at intersection where I knew

it would be after that. 1 indirect explosion of small Charge disabled it. (2 cents)

Satchel Charges are super powerful, try one of those...

Share this post


Link to post
Share on other sites

Thanks all for your response. Can confirm that a single demo charge forces the crew to bail out. But then, after that, to actually destroy, it took another 2-3. I'll try a satchel charge, but I think I tested that out too and had trouble. I'll think I'll probably just use Cobra's code...

---------- Post added at 08:18 ---------- Previous post was at 07:57 ----------

It's the Hull that appears to be the problem. I tried two satchel charges with the setdamage at 0.5 and still I could not destroy it.

Share this post


Link to post
Share on other sites

You can modify the damage taken by a certain type of ammo using an eventhandler:

	TAG_handleDamage = {
	_veh = _this select 0;
	_damage = _this select 2;
	_ammo = _this select 4;



	if (_ammo == "satchelCharge_remote_ammo") then {

			//--- Increase damage
			_damage = _damage * 3; 

	} else {
		_damage = _damage;
	};
	_damage
};

sochor addeventhandler ["handledamage",{_this call TAG_handleDamage}];

Share this post


Link to post
Share on other sites

You could check the damage of the engine instead of the whole vehicle.

Share this post


Link to post
Share on other sites

Cobra, I tried your solution - no joy I'm afraid.

---------- Post added at 16:27 ---------- Previous post was at 16:09 ----------

And I'm not sure I quite understand how to use the event handlers. I need it to work on MP, so I guess I'd need to use addMPeventhandler? 2nd Ranger - does the 2nd code go in the mission's init. file? And is the first a script .sqf? Sorry, not sure where they go! I did try and watch a tutorial on event handlers but still a bit foggy...

Share this post


Link to post
Share on other sites

It can all go in the init.sqf if you name your vehicle sochor. You don't need to use addMPeventHandler, that's only for MPKilled and MPRespawn.

Share this post


Link to post
Share on other sites

You can just put them both in the init.sqf as you see it above, and it should work for everyone. Although I'm fairly sure you could run it only on the server and it would still work.

Ninja'd but yeah.

Share this post


Link to post
Share on other sites

I like 2nd Rangers solution better.

But this will work on a Slammer tank.

getDammage tankName >= 0.1;

tankName setdamage 1;

An explosive charge will do around 0.14 damage on a slammer

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Nice one guys - cheers - you're all legends in my book! :)

Share this post


Link to post
Share on other sites

Ugh - 2nd Ranger's script is coming up with an error message on Dev Build now! Any solutions?

Share this post


Link to post
Share on other sites

Make sure the classnames are correct they seem to like to change them on us. ;)

---------- Post added at 20:59 ---------- Previous post was at 20:54 ----------

I just tested his code and it still works. I used one demoCharge not satchelCharge on a slammer, it blew up no problems.

---------- Post added at 21:02 ---------- Previous post was at 20:59 ----------

Satchel charge is SatchelCharge_Remote_Mag not SatchelCharge_Remote_ammo

Share this post


Link to post
Share on other sites

SatchelCharge_Remote_Mag is the magazine class, SatchelCharge_Remote_ammo is the name of the 'projectile' that causes the damage, which is what that script is checking for.

And yeah, it still works fine, no errors.

Share this post


Link to post
Share on other sites

Interestingly, it's all been rendered superfluous now! BI have fixed the near invincible Sochor bug on Dev Build!

Share this post


Link to post
Share on other sites

One satchel or a democharge will blow up the sochor, I thought they made the democharges less damaging in the latest dev update?

* Decreased damage, range and weight of Demo charge for it was too huge and devastating for its purposes (http://feedback.arma3.com/view.php?id=14849) and causes some capacity issues for BLUFOR divers.

Share this post


Link to post
Share on other sites
You can modify the damage taken by a certain type of ammo using an eventhandler:

	TAG_handleDamage = {
	_veh = _this select 0;
	_damage = _this select 2;
	_ammo = _this select 4;



	if (_ammo == "satchelCharge_remote_ammo") then {

			//--- Increase damage
			_damage = _damage * 3; 

	} else {
		_damage = _damage;
	};
	_damage
};

sochor addeventhandler ["handledamage",{_this call TAG_handleDamage}];

That's clever. This is Sooooo added to mu snippets!

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  

×