Jump to content
Sign in to follow this  
pvtdancer

Door breach on damage taken or explosion

Recommended Posts

Hey everyone,

I've been able to make a script to allow for a person to place a charge and then detonate that same charge as seen below. The one thing I can't get and having trouble figuring out is activating an animation on either an explosion within a radius or damage. Later on I want to be able to actually attach explosive onto the object\Door the cursor is on but I'll deal with that later. If anyone has any suggestions or knows how to do this I would appreciate the help. Thanks in advance!

	fnc_breach = {
player playActionNow "PutDown";
player addMagazine "DemoCharge_Remote_Mag";
   player selectWeapon "DemoChargeMuzzle";
   player fire ["DemoChargeMuzzle", "DemoChargeMuzzle", "DemoCharge_Remote_Mag"];
   player setWeaponReloadingTime [player, "DemoChargeMuzzle", 0];
sleep 0.5;
} forEach (units player);
c4 = [DemoCharge_Remote_Ammo_Scripted];
	_C4 = "DemoCharge_Remote_Ammo_Scripted" createVehicle (position player);
   _n = count c4;
   c4 set [_n, _c4];
   player addAction [format ["Detonate Charge #%1", _n + 1], {
       player removeAction (_this select 2);
       (c4 select (_this select 3)) setDamage 1;
}, _n];

{};

Share this post


Link to post
Share on other sites

How about using a hidden object that can actually receive damage.

"Land_runway_edgelight" <-- this object should be suitable

https://community.bistudio.com/wiki/hideObjectGlobal

If you place that object on the door, you can also attach an action to it that allows C4 to be attached and you can give it an eventhandler that breaks the door open if the object receives enough damage.

That way the door could also be breached with other explosives.

Need any further guidance?

  • Thanks 1

Share this post


Link to post
Share on other sites

The concept makes perfect since to me. Execution will be a different story as I've never played with either of those. So if I understand you right

Place Charge would place the Hidden object,

Attach explosive charge to hidden object,

Attach to nearest object door, wall etc

Add event handler to receive the damage then call the animation at an accelerated speed.

I'm assuming those would be the tasks I need to accomplish... In list form it looks easy lol but it took me the greater part of the night to get what I wrote already, I'll start working on it tonight and post back if I start running into road blocks.

Thanks again for the help.

Share this post


Link to post
Share on other sites

You don't have to wait for "place charge", you can place the hidden object in advance on every door that you want to be breachable.

That has 2 advantages:

1. You can add an action to it that allows you to attach C4 directly

2. You can breach the door with other explosives (like an RPG or something similar)

Share this post


Link to post
Share on other sites

ok I think I understand you then.

The Hidden object is attached to all doors in advance.

The hidden object is where all the scripting is IE, action to attach C4, damage taken, place charge, play animation etc.

Is it extremely difficult to attach an item to in this case a building door via a script? or is there a way to generalize all building doors with out pulling each building name (With usable doors) out of config viewer?

Sorry for needing it lay'd out so specifically, I haven't done a ton of scripting in ARMA so a lot of this is new to me and I don't want to waste a ton of time just cause I misunderstand even if you can just point me to the command\EH etc I can start following the rabbit hole from there. thanks for your guidance.

Edited by PvtDancer

Share this post


Link to post
Share on other sites

I think the best way would be to let your script fetch the required data from the config.

The doors seem to be all defined in the same way and their actions are attached to certain positions like this: "Door_2_trigger".

So if you get "numberofdoors" from the config, you should be able to iterate over them and use these triggerpositions for placement with selectionPosition.

tbh, I'm curious myself if that is all going to work ^^

ps.: While you're at it, you could use the opportunity to randomly lock some of the doors.

A Door can be "locked" by setting a variable of the building to 1.:

this setVariable["bis_disabled_Door_1",1,true];

Share this post


Link to post
Share on other sites

OK makes since. I did a quick google on fetching data from the config and didn't find much is that the same as using a function or is there a specific call you have to make?

Share this post


Link to post
Share on other sites

http://www.armaholic.com/page.php?id=22058

there's a script on armaholic that allows you to plant explosives on any object. I use it in some of my missions. problem is the creator hasnt updated since beta. hopefully you can improve on it if you find it useful. I look forward to you completing your work as it is definitely something that would make coop and multiplayer much more immersive.

Share this post


Link to post
Share on other sites

Thanks, I actually looked at that a bit and I'm still working on understanding what he did. It works for the most part but not what I really want since you have to pick up the explosive and attach it. I'll look at it more because I would love to be able to plant the explosive on the cursors location vs at player's location. but I'll also accept plant on another object like we were talking about above it would be a great start.

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  

×