Restrict Flying Height of Aircraft - Updated

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Restrict Flying Height of Aircraft - Updated

« posted: Feb 07, 2016, 02:13 PM »
Greetings fellow armaholics !

I've recently been asked to add this to my mission as some players will sit and hover with an attach heli 2km up in the sky and just destroy everything :)


1) Create 2 triggers on the map -  (this is for Stratis). Heli height restricted to 250m, Jet height restricted to 500m. Emits a beep when you are flying above the set height with an onscreen warning and gives you 30 seconds to drop below. If you don't it disables your engines by draining all your fuel with a small explosion :)

Get the Triggers from my GIT Here!

Add the 2 scripts from my GIT Here!

To Do Still : Make sounds clearer to the pilot. Code / Trigger optimizations.Add UAV Checks.

Enjoy !
CRE4MPIE

- from the grassy knoll -

Re: Restrict Flying Height of Aircraft

« Reply #1 posted: Feb 08, 2016, 12:07 AM »
Thanks man. Works great! I added a sound effect and explosion to mine.  :)
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Restrict Flying Height of Aircraft

« Reply #2 posted: Feb 08, 2016, 06:29 AM »
Thanks man. Works great! I added a sound effect and explosion to mine.  :)

I was lazy and just added 2 separate triggers for jets and helis ^^ Probably not the best cost effective wise ^^

Added some sounds and such ! works great thanks ;)


- from the grassy knoll -
  • Offline PAR4NA
  • First Blood
  • ***
  • Posts: 76
  • www.CLANPUTOS.org

Re: Restrict Flying Height of Aircraft

« Reply #3 posted: Feb 08, 2016, 05:36 PM »
ty, now can reduce the values of Kajiman and Blackfoot

Re: Restrict Flying Height of Aircraft

« Reply #4 posted: Feb 09, 2016, 05:06 AM »
hi creampie

can i have your updated code so i can add the helis back into the game i removed them for high altitude flying and dominating the server

not sure about bringing back the cas planes with the lockons if i could disable the lockons would be good

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Restrict Flying Height of Aircraft - Updated

« Reply #5 posted: Feb 09, 2016, 10:45 AM »
Updated - Also uploaded my latest mission on GIT.

Includes some fixes , performance improvements , new statusbar and the restricted airspace triggers / scripts.

Enjoy ;)

- from the grassy knoll -

Re: Restrict Flying Height of Aircraft - Updated

« Reply #6 posted: Feb 09, 2016, 05:58 PM »
thanks creampie

i will have a try on the test server will have to run it by everyone first before i impliment it

thanks again

Re: Restrict Flying Height of Aircraft - Updated

« Reply #7 posted: Feb 09, 2016, 06:16 PM »
i added this and vehicle store owner at airfield wasnt there i went to another store and their was no desk owner was there but you could push him around when you clicked to open vehicle store it didnt show anything to buy

maybe i missed something

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Restrict Flying Height of Aircraft - Updated

« Reply #8 posted: Feb 12, 2016, 06:42 AM »
i added this and vehicle store owner at airfield wasnt there i went to another store and their was no desk owner was there but you could push him around when you clicked to open vehicle store it didnt show anything to buy

maybe i missed something

I was on your server earlier this week Pat. You should run your client with -showScriptErrors. There seems to be a ton of script errors popping up upon login / respawn etc etc. This will be causing a bunch of other issues like that and stuff like players logging back in naked etc.

Adding this doesn't touch any "scripting" in wasteland. You're just adding a 2 triggers to your mission sqm and calling the scripts directly from there.


- from the grassy knoll -

Re: Restrict Flying Height of Aircraft - Updated

« Reply #9 posted: Jul 07, 2016, 04:03 PM »
Having some issues with this one.

I create the 2 triggers from the 3D editor and then have this.

Code: [Select]
class Item560
{
dataType="Trigger";
position[]={4146.6958,213.84386,4600.9521};
class Attributes
{
name="restrictedAirspaceJet";
text="restrictedAirspaceJet";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
};
id=816;
type="EmptyDetector";
};
class Item561
{
dataType="Trigger";
position[]={4262.0078,183.43739,4603.0869};
class Attributes
{
name="restrictedAirspaceHeli";
text="restrictedAirspaceHeli";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
};
id=817;
type="EmptyDetector";
atlOffset=1.5258789e-005;
};

If I merge this with the given code of Creampie, I end up with this:

Code: [Select]

class Item560
{
dataType="Trigger";
position[]={4146.6958,213.84386,4600.9521};
class Attributes
{
name="restrictedAirspaceJet";
text="restrictedAirspaceJet";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
expCond="(vehicle player) in thislist && (vehicle player) isKindOf ""Plane"" && (getpos (vehicle player) select 2 > 1000);";
expActiv="restrictedAirspaceJet = [] execVM ""addons\restrictedAirspace\restrictedAirspaceJet.sqf"";";
expDesactiv="terminate restrictedAirspaceJet; titleText [""You have left the Restricted Airspace!"", ""PLAIN DOWN"", 3];";
class Effects
{
};
};
};
class Item561
{
dataType="Trigger";
position[]={4262.0078,183.43739,4603.0869};
class Attributes
{
name="restrictedAirspaceHeli";
text="restrictedAirspaceHeli";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
expCond="(vehicle player) in thislist && (vehicle player) isKindOf ""Helicopter"" && (getpos (vehicle player) select 2 > 500);";
expActiv="restrictedAirspaceHeli = [] execVM ""addons\restrictedAirspace\restrictedAirspaceHeli.sqf"";";
expDesactiv="terminate restrictedAirspaceHeli; titleText [""You have left the Restricted Airspace!"", ""PLAIN DOWN"", 3];";
class Effects
{
};
};
};

But when launching the mission, it says something about being unable to locate global positioning system and goes no further.

If I enter Creampie's code as is only keeping the coordinates for the two triggers I created, it looks like this:

Code: [Select]

class Sensors
{
items=2;
class Item0
{
position[]={4094.5681,134.07104,4859.1831};
name="restrictedAirspaceHeli";
text="restrictedAirspaceHeli";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
expCond="(vehicle player) in thislist && (vehicle player) isKindOf ""Helicopter"" && (getpos (vehicle player) select 2 > 500);";
expActiv="restrictedAirspaceHeli = [] execVM ""addons\restrictedAirspace\restrictedAirspaceHeli.sqf"";";
expDesactiv="terminate restrictedAirspaceHeli; titleText [""You have left the Restricted Airspace!"", ""PLAIN DOWN"", 3];";
class Effects
{
};
};
class Item1
{
position[]={3966.8821,128.86371,4862.6338};
name="restrictedAirspaceJet";
text="restrictedAirspaceJet";
sizeA=4500;
sizeB=4500;
repeatable=1;
activationBy="ANY";
isRectangle=1;
expCond="(vehicle player) in thislist && (vehicle player) isKindOf ""Plane"" && (getpos (vehicle player) select 2 > 1000);";
expActiv="restrictedAirspaceJet = [] execVM ""addons\restrictedAirspace\restrictedAirspaceJet.sqf"";";
expDesactiv="terminate restrictedAirspaceJet; titleText [""You have left the Restricted Airspace!"", ""PLAIN DOWN"", 3];";
class Effects
{
};
};
};
};

But I then get the attached crash.

Very confused at this point.


[/code]
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Restrict Flying Height of Aircraft - Updated

« Reply #10 posted: Jul 08, 2016, 10:16 AM »
seems like alot to read heh so i'll give you the tl;dr version ..


Don'y copy my code over - create the triggers using the code snippets and params in the 3D editor. I haven't done alot of editing with EDEN , in fact I haven't edited anything in the last few months so not sure about the compatibility between using the old 2D editor code and EDEN. ( I wouldn't recommend just copying it over )

After you have created the triggers with teh code snippets in the right places I don't see any reason this shouldn't work or cause your server to crash. Position system error is because your player doesn't have a map when you try and open it, and most likely not related in any way.

Goodluck :)


- from the grassy knoll -