Jump to content
Sign in to follow this  
thecoolsideofthepillow

Can I Prevent a Player from Placing/Touching Off a Bomb?

Recommended Posts

I am wanting to know if it would be possible to give a player a satchel charge, but prevent them from arming it until a condition is met.

 

If they meet the condition and arm the device, I want it to automatically set the timer (bonus if I can change it from 40 seconds to something else) and not give them the option of detonating remotely.

 

I am not sure how to even start, if removing those actions is even possible.

Share this post


Link to post
Share on other sites

Try checking for a nearby satchel, once it has been placed, using nearObjects. Then you can replace the satchel with a scripted satchel, "SatchelCharge_Remote_Ammo_Scripted" , which you can explode once your condition is met. 

 

Have a look at scripted charges HERE.

Share this post


Link to post
Share on other sites

A different solution would be to add addAction to the object where the satchel should be attached to ( given that there is an object). Afterwards you could simply spawn a satchel and detonate it via script.

Share this post


Link to post
Share on other sites

Problem: While everything works for the item in terms of placing and detonating, I can't get the defusal part to work.

c4 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle position bCarrier;
c4 addAction ["Defuse Bomb", "de_nuke.sqf"];

The action does not appear on the bomb at all. If I ask for a hint str of c4, I get the item. If I do a hint str for the planted bomb (using cursorTarget and looking at it) it gives <NULL-OBJECT>. I have a feeling it's related to the problem.

 

It should work like any other vehicle, right? I can do a similar thing to add an action to a car. Why is it not working for the satchel?

Share this post


Link to post
Share on other sites

It's probably not working becaue it's a scripted satchel, a workaround would be a to spawn another small items and attach the action to that.

Share this post


Link to post
Share on other sites

Weird. You'd think the scripted satchel would let me run an addAction script to it. It still recognizes it as an object, though, and it does call the correct item from the variable name I gave it, and knows it's position.

 

So instead of making a new object, I just made a new trigger that gives the correct side's players an addaction while they are in range of the bomb.

 

I am wondering now if, using one of the intersecting line commands I could incorporate a condition that requires the player to not only be in range, but also be looking at the object. This would have been no problem with the addAction on the bomb itself, since when using a condition (such as only showing up for one side) on the addAction itself, it forces you to be in a smaller range *and* to look at the object. I am not exactly sure what the result of setting the condition for the player's side on an addAction that would be on the players themselves. They can't look at themselves.

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  

×