Jump to content
Sign in to follow this  
charlietwofive

Deadzone for Groundunits? (free for AirUnits)

Recommended Posts

Hey @ all,

after 2 1/2years of ArmA2 and a few months of playing ArmA3 I decided to start creating some missions. I've checked/watched several video tutorials, Wiki entries and Mr Murray's scripting bible but I didnt find an answer.

I want to establish a zone which is prohibited for groundunits. Only air units should be allowed to enter the 3km wide circle. Ground vehicles have to get destroyed and infantry to be killed immediately when they enter the circle.

Using the "Zone Restriction"-Module (Misc) doesn't work like I want it to. Maybe I'm using it wrong.

A trigger with "{_x Setdammage 1} Foreach thislist;" does not work either because I do not want to kill everyone just everything that doesn't fly. Moreover Pilots have to die when they are already inside the circle and get out of their air unit.

Does anyone have an idea how to solve this problem?

Share this post


Link to post
Share on other sites

{if(((getPosATL _x)select 2) < 5)then{_x Setdammage 1}} Foreach thislist;

Share this post


Link to post
Share on other sites

Hey, thanks for the fast response and your help. :-)

Entering the circle while on ground: Not possible anymore ✓

Entering the circle while flying 5m or lower: Not possible anymore ✓

Landing and getting out of air vehicle after enterning the zone while flying higher than 5 metres: Still possible ✕

Do you know a way to suppress Pilots from landing after they entered the zone with an air vehicle? Example: I enter the circle with an altitude of 6m so I dont die. Now I land and get out of my air vehicle while being inside the circle.

I'm searching a way to kill pilots instantly who leave their air vehicle after they landed inside the circle. Any ideas?

Regards,

CharlieTwoFive

Share this post


Link to post
Share on other sites

{if(!(_x isKindOf "Air"))then{_x Setdammage 1}} Foreach thislist;

_vehicle addEventHandler ["GetOut", {(_this select 2)setDamage 1}] //will kill the unit getting out

or you might just lock the aircraft

Share this post


Link to post
Share on other sites

Thanks a lot!

Do you mean a trigger which locks the vehicle when they enter the area and unlocks it when they leave it? Is that even possible?

Share this post


Link to post
Share on other sites

btw if you only use {if(!(_x isKindOf "Air"))then{_x Setdammage 1}} Foreach thislist; in a trigger then you will have a situation where a aircraft can fly into the trigger, activate it and then ground units can enter unharmed, the pilot can even eject and none will be killed because the trigger has already activated and is waiting to deactivate, the Foreach command has been run.

it would be better to put [thislist]exeVM ZoneFlyOnly.sqf in the trigger and then in ZoneFlyOnly.sqf have something like this...

if(!isServer)exitwith{};
_thislist = _this select 0;
while{true}do
{
{if(!(_x isKindOf "Air"))then{_x Setdammage 1}} foreach _thislist; 
sleep 5;
};

when you make your trigger you need to change 3 things...

activation: Anybody

Condition: true

on Act: _nul=[thislist]execVM "ZoneFlyOnly.sqf"

_thislist will activate at game start and will pass all objects to the script for the life of the game, it will destroy anything that isn't a flying vehicle.

find the wiki and play with this script to kill only west side or east side, I'm guessing that will be the next question:)

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  

×