Jump to content
macieksoft

Scripting command to detonate already placed charge.

Recommended Posts

I am looking for a script command to detonate already placed charge.

I want it to make my firing system works with charges placed by player using AGM mod.

So i need a script command to detonate this charge.

I will take particular charge by using cursortarget command that will return particular charge as object, so i only need a way to detonate it.

Something like setoff chargex;.

I do NOT want something like player action ["touch off", unit2];.

Edited by macieksoft

Share this post


Link to post
Share on other sites

Didn't realize this is your baby Killzone_Kid. Any solution/workaraound for this?

Scripted explosives are buged or lacking because they do not conform to A3 vanilla standard compatibility with "handledamage" event handler. _source returns ObjNull, because of no localization or owner.

Place an ammobox in editor named myAmmoBox and run this code in debug console then set scripted charge on myAmmoBox. Blow it up with scripted charge.

JIG_ammmoCache_damageB = {
   _cache = _this select 0;
   _damage = _this select 2;
   _source = _this select 3;
   _ammo = _this select 4;
   _out = 0;
player sidechat format ["Cache:%1 - Damage%2 - Source%3 - Ammo%4",_cache,_damage,_source,_ammo];
if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo") || (_ammo == "satchelCharge_remote_ammo_scripted") || (_ammo == "demoCharge_remote_ammo_scripted")) then {
	hint "Ammo type found";
};
diag_log text format ["ExplosiveType:%1",_ammo];
[_source] spawn {
	_source = _this select 0;
	diag_log text format ["Owner:%1",_source];
	_sidesource = side _source;
	diag_log text format ["Owner Side:%1",_source];
	};
   _out
};
publicVariable "JIG_ammmoCache_damageB";
myAmmoBox removeAllEventHandlers "HitPart";
myAmmoBox removeAllEventHandlers "handledamage"; 
myAmmoBox addeventhandler ["handledamage",{_this call JIG_ammmoCache_damageB}];

Edited by Jigsor

Share this post


Link to post
Share on other sites

Scripted charges are just extended normal charges, so if they are bugged then normal charges are bugged too. What you refer to is inability to assign originator to a scripted event. For example the same would happen if you spawn grenade ammo via script. When exploded you will also get objnull for originator. The only workaround I found is to use hitpart eh, but it is way too complicated and awkward. There is actually a ticket on FT somewhere for an abitlity to assign originator, I dont want to be negative, but reality of the situation is that this is probably at the bottom of mountain Everest of todo tasks.

Share this post


Link to post
Share on other sites

Hello ! Sorry to necro this but it looks like I  can find an answer here with you.

 

I am making an ambush mission in which the player is alredy placed in his hiding place, and the ied as well. 

 

I would like to "link" the explosive to the player to be able to remotely detonate it with a firing system.

 

I don't want the player to go to the ied to manualy activate it and go back to his hiding. It should be like he placed it.

 

thanks for your answers !

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

×