Jump to content
Sign in to follow this  
HateDread

Enforcing Quarantine?

Recommended Posts

Hey all,

In my latest Zombie/Infected mission, set in Zargabad, the town is infected, and the US army has quarantined it. I have snipers set up around it, all set to 'combat' mode, etc.

The only problem is that they don't fire - they need to be engaging OpFor, and 'Independents' (including civilians) in general, but also specifically if they escape the quarantine zone.

This results in a few questions:

1. How do I detect, in general, if a unit has exited the quarantine (I'm dealing with units generated by the zombie mod, so I can't put it in the 'init' line, or use named units).

2. How do I enable snipers to engage said targets from long-range (at night).

3. How do I get the position, etc, of the units, so I can call artillery, send in air support, etc, designed to stop the player?

(Will post more as I find them).

Thanks in advance!

- HateDread.

Share this post


Link to post
Share on other sites

for the quarantine you could place a marker

and specify the units that may not leave the zone.

than you could make a script that kills the specified units (they will probarly have a name when they spawn, so look in the files of the mod) when they leave the zone.

(If you are one of the snipers this idea wont work).

Edited by enforcer4100
zombie info

Share this post


Link to post
Share on other sites

But how do I specify that several entire factions cannot leave a marker? (Zombies become 'independent' side, plus civilians who must also not leave).

And how do I pass this along to another unit which will then engage them?

Btw, the player is not a sniper - he is inside, and he must escape out of the quarantine, so an insta-kill won't work.

Share this post


Link to post
Share on other sites
But how do I specify that several entire factions cannot leave a marker? (Zombies become 'independent' side, plus civilians who must also not leave).

And how do I pass this along to another unit which will then engage them?

Btw, the player is not a sniper - he is inside, and he must escape out of the quarantine, so an insta-kill won't work.

I think you can better ask this in the scripting section of the forum.

they may have scripts for this.

Share this post


Link to post
Share on other sites

This is my first attempt at point 1.

In trigger I manually activate (for now):

xhandler = [this]execVM "InQuarantineCheck.sqf";

In InQuarantineCheck.sqf:

_Trigger = this select 0;

{_x setVariable ["OUTSIDE", 1,true]} foreach allunits;

{_x setVariable ["OUTSIDE", 0,true]} foreach units _trigger;

This sets ALL units as Outside = 1, then sets all units within trigger as Outside = 0.

I try to check this with another script:

_ReturnVari = Player getVariable "OUTSIDE";

if (_ReturnVari == 1) then {player setdamage 1} else {hint "Negativekill"};

But even if all done within the trigger, the player is still killed. Despite the fact that it sound say 'Negativekill' and not kill the player.

Any ideas?

Edited by HateDread

Share this post


Link to post
Share on other sites

Okay, using manually-activated triggers;

Trigger One executing:

{_x setVariable ["OUTSIDE", 1,true]} foreach allunits;

Trigger Two executing:

{_x setVariable ["OUTSIDE", 0,true]} foreach allunits;

And the third using this to check:

_ReturnVari = Player getVariable "OUTSIDE";

if (_ReturnVari == 1) then {player setdamage 1} else {hint "Negativekill"};

It works as intended. Firing the first trigger (setting outside to one), then the third to check it, results in a player death. Firing the 2nd trigger then the third equals 'negativekill'. Firing the first then the second then the third equals 'negativekill'.

This means that they work individually, and the 2nd can successfully over-write the first, therefore the earlier code should work.

This testing means the problem is with the trigger area, and the selecting of the units within it. From the earlier post of mine:

_Trigger = this select 0;

{_x setVariable ["OUTSIDE", 1,true]} foreach allunits;

{_x setVariable ["OUTSIDE", 0,true]} foreach units _trigger;

This, as supported by my experiment, should have the 3rd line here over-writing the 2nd, meaning outside is set to 1 for all units, then set to 0 for all within trigger zone. Trigger executes xhandler = [this]execVM "TRIGGERSCRIPT.sqf"; so this should operate as _trigger.

What part of this final script is going wrong? Is it foreach units _trigger; at the end? Is that written incorrectly?

Cheers in advance!

Edited by HateDread

Share this post


Link to post
Share on other sites

Okay, so now it seems to work, with testing the idea itself with two triggers, one with

{_x setVariable ["OUTSIDE", 1,true]} foreach allunits;

And the other:

_Trigger = this select 0;

{_x setVariable ["OUTSIDE", 0,true]} foreach units _trigger;

And checking with the earlier script:

_ReturnVari = Player getVariable "OUTSIDE";

if (_ReturnVari == 1) then {player setdamage 1} else {hint "Negativekill"};

Now it seems to not kill the player after activating the second script, over-writing the first.

I am still unsure if this is the best way to handle point one:

1. How do I detect, in general, if a unit has exited the quarantine (I'm dealing with units generated by the zombie mod, so I can't put it in the 'init' line, or use named units).

Does anyone have any ideas, or answers for the other two? Once the first is handled, the others should be easy, I'm hoping.

2. How do I enable snipers to engage said targets from long-range (at night).

3. How do I get the position, etc, of the units, so I can call artillery, send in air support, etc, designed to stop the player?

Thank you.

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  

×