Jump to content
Sign in to follow this  
OppiFjellet

Restricted areas for OpFor and BluFor

Recommended Posts

Hello,

for tl;dr see bolded text only :)

I am working on my first "big battle" mission, lots of troops, a frontline etc.

I placed a marker line from Zelenogorsk to Krasnostav and want to prevent opfor units from uncontrolled "leaking"

past this border (the mission requires several jumps between the zones, which results in some units losing their sh*t

and following players to their base, while I want them to "fear" rushing behind the enemy lines and let them run away after a short chase).

Anyone knows what should I use to kill/redirect any opfor unit that goes past the frontline (marker)?

I thought of using two triggers detecting opFor all along the border, both activated repeatedly by trespassers,

but I can't find a command/script that would affect only the unit that is within it's detection zone...

And for those who like redirecting others to search engines - searched here and everywhere and

no post solved this (at least not directly. Yes I am stupid, but at least I try to fight it ;)).

Share this post


Link to post
Share on other sites

Trigger >> Opfor Present >> once - size of the marker area

Condition:

call {if (count thislist > 0) then {{if (alive _x) then {_x setDamage 1}} forEach thislist};false}

No activation is needed.

Share this post


Link to post
Share on other sites

Placing scripts (especially with foreach) in trigger conditions is a bad practice - it eats FPS. Trigger conditions are checked each frame.

Besides, your script will be also compiled each frame.

Better off:

Activation:

OPFOR Present, repeatable

Condition (default):

this

On activation:

{_x setDamage 1} forEach thislist;

Edited by DarkWanderer

Share this post


Link to post
Share on other sites
Besides, your script will be also compiled each frame.

Oh so just using call without compile still compiles it? Now I'm confused for sure! In any case the condition is evaluated before the forEach is ran. If the condition isn't true, how does it still run the forEach thus eating fps confused.png Unless there are constantly alot of enemies in the kill trigger I don't see the problem. I'm sure you know what you're talking about though as I'm only a novice tinkerer.

Edited by Iceman77

Share this post


Link to post
Share on other sites

Thank you all, works great!

It's so simple and I didn't think of that... Time to quit smoking weed :p

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  

×