Jump to content
Sign in to follow this  
khaosmatical

Detect unit in prone via trigger to disable trigger.

Recommended Posts

Hi gents, so I have been working on an IED set up that solely works in game without any external scripts. It does feature a triggerman that if killed deletes the trigger to destroy the IED (via setdamage 1). The IED will detonate by distance detection on a unit to simulate as jankily as I can the triggerman judging when to set off the bomb, his sight line isn't even used. What I want to know is, is there a way to temporarily disable or stop a trigger from firing in-game without any external scripting and can it be done when a unit is simply in the prone position to simulate the idea I guess of spreading out bodyweight and not triggering a pressure plate and what not. (even better if someone know's how to also detect not holding a weapon so they have to be unarmed too)

And to save creating two topics, does anyone know if a trigger sound effect can be isolated to one unit in a MP scenario, e.g. the bomb disposal unit gets a radio warning sound but no one else does.

Here is a download for an example of the IED in the editor.

https://dl.dropboxusercontent.com/u/100612052/IED%20Example.rar

Share this post


Link to post
Share on other sites

((ASLToATL (eyepos _unit)) select 2) < 0.4 AND currentweapon _unit isequalto ""

could do it.

You can also use animationState for this.

Don't know why everyone wants to do missions without "scripting" or "external scripting".

Triggers and waypoints are really cumbersome if you know what can be done with a few lines of .sqf and some basic script commands.

Share this post


Link to post
Share on other sites

(stance player) == "PRONE"

(stance player) == "CROUCH"

(stance player) == "STAND"

Share this post


Link to post
Share on other sites

Its not about not wanting to do external scripting, it's because F3 Framework is used and I don't want to hassle around things like the INIT just in-case it breaks F3.

Also what about temporarily disabling the trigger while a unit is in such a stance? I know of deletevehicle for actually removing a trigger but is it possible to halt one or would I literally write the

 ((ASLToATL (eyepos _unit)) select 2) < 0.4 AND currentweapon _unit isequalto "" 

in the condition instead of true?

Edited by Khaosmatical

Share this post


Link to post
Share on other sites

Ok scratch the previous Icaruk, if I set the condition using:

 if (stance player == "STAND") then { ied1 setdamage 1; }; 

It does detonate the ied correctly due to stance however it does it anywhere the player changes stance. Is there a way to isolate it to only inside the trigger?

Edited by Khaosmatical

Share this post


Link to post
Share on other sites

Adapting a post from another thread, try this as trigger condition:

this && {1 isEqualTo ({if(stance _x in ["STAND", "CROUCH"]) exitWith {1}} count thisList)}

This should activate the trigger if there's any non-prone unit in the triggerArea (given you set the activating units to "ANY").

Edited by Heeeere's Johnny!

Share this post


Link to post
Share on other sites

Just as I was about to say it didn't work, for some reason I though setting Activation to None would mean anybody. The last thing I just noticed, it means you can drive past the IED. Is there anyway to add it so any vehicle will set it off? I'd imagine it would be in the ["STAND", "CROUCH"] area?

---------- Post added at 00:10 ---------- Previous post was at 22:58 ----------

All I've found is to do with named vehicles whereas I am wondering whether or not it is possible to just detect any vehicle like how the script you linked Johnny had _x in

Share this post


Link to post
Share on other sites

It's actually pretty simple. All you need to add to the if statement in the condition is _x isKindOf "Car", so your statement should look like this:

this && {1 isEqualTo ({if(_x isKindOf "Car" || stance _x in ["STAND", "CROUCH"]) exitWith {1}} count thisList)}

That way, every car AND every standing or crouching unit will activate the trigger.

Share this post


Link to post
Share on other sites

Thanks everyone, you guys have been a great help! Hopefully our session tonight will be more deadly but hella more exciting!

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  

×