Jump to content
Pablo Diablo

Make IED inactive with death of spotter

Recommended Posts

Fairly new to scripting and Eden, so please forgive me if this is obvious.

 

In a scenario, I'm trying to set up several spotters in town who are stationed at various points with eyes on one or more IEDs, occasionally with overlap, so more than one spotter can set off a single IED.

 

The IEDs will be set to be "manually" triggered, not proximity base, to represent that the spotter(s) fire the explosives when a target is near.  I'll accomplish this with an area trigger around the IED to set it off when a BLUFOR unit is in range (so that it can't be circumvented by crawling into range like a normal proximity explosive).

 

However, I'm trying to figure out how to deactivate the IED/scripted trigger if the spotters have all been killed.

 

I know I can start with an

"If !alive" to check the spotters, but am not sure how to execute the following "then".  I would guess it would be something to delete the trigger, so that the IED is still technically active, but with no chance of going off?

 

Also, if I have multiple enemy spotters with eyes on the same IED, is there a danger to listing multiple units in my !alive check?

 

TIA!

Share this post


Link to post
Share on other sites

In the trigger's condition use:

 

this && (({alive _x == 0} count [spotter1,spotter2,.....]) == 0)

 

This way the trigger will only activate if at least one spotter is alive.

  • Like 1

Share this post


Link to post
Share on other sites

Awesome - thank you!

The bonus being I can customize the spotter list in each trigger for the exact spotters that might have eyes on it!

  • Like 1

Share this post


Link to post
Share on other sites

So when I try the suggested code, I get a 'Generic Error' (Depending on format, I get the initial 'call{' on its own line, or combined, as in the following):
 

Quote

 

'call{this && (({alive _x == 0} count [spotter1,spotter2,.....]) == 0)}'

Error Generic Error in Expression
Number,Object,Side,Group,Text,Config Entry,Display(dialogue),Control,Network Object,Team Member,Task,Location

 

To be clear, I do not have a 'call{' in the Condition box -that seems to be the way that Eden addresses any code in that box.  (Although I understand some argument are better served by a 'spawn' than a 'call', I'm not clear which, and suspect this isn't one....?)

 

The way I'm able to make it work is via:

 

"this && (alive spotter1 or alive spotter2)" (for multiple spotters)

or

"this && alive spotter1" (for a single spotter)

 

It seems like your option is slightly more elegant, but after an hour or three of experimentation, I can't isolate what is giving me the error.  Any ideas or paths for me to investigate?

Share this post


Link to post
Share on other sites

there are invisible special chars in code. this is a forum bug. check for invisible special chars with an editor of your choice.

also I would recommend:

this && [spotter1,spotter2,.....] findIf {alive _x} > -1

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, sarogahtyp said:

there are invisible special chars in code. this is a forum bug.

 

 

Second this. I came across this a few weeks ago and it cost me a fair bit of time before I realised it.

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

×