Jump to content
  • 0

Prevent Building at an Ai Island


blueman

Question

We created two Ai islands on Taviana map. Trying to prevent building on those two islands.
We use AGN for safe zones, and thought we'd use sensors on those two islands to prevent
players from building there.

 

However, when players approach the islands, they get the "entering safe zone" message,
and their weapons are deavtivated; which defeats the purpose of having an Ai island or base.

 

Any advice?

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Get a custom player_build.sqf in your mission.pbo.

Edit your compiles to point to it.

 

add a line like this:

if ((player distance [X,Y,Z]) < 500) exitWith { DZE_ActionInProgress = false; cutText ["You cannot build in an AI City!","PLAIN DOWN"]; };

Coordinates would be the coords of the center of your city, 500 is the radius in meters.

Link to comment
Share on other sites

  • 0

In the sqm find where the sensor is

 

EXAMPLE ONLY

expActiv="TitleText[""Welcome to the camp, stay quiet"",""PLAIN""]; canbuild = false;";
expDesactiv="TitleText[""Leaving the camp"",""PLAIN""]; canbuild = true;";

Make it look like this

expActiv="TitleText[""Welcome to the camp, stay quiet"",""PLAIN""]; canbuild = false;Safezone= false";
expDesactiv="TitleText[""Leaving the camp"",""PLAIN""]; canbuild = true;Safezone= true;";

In other words just add the safezone part to the sensors 

in the safezone script change
canbuild to safezone

Now you can see the safezone true ans false is backwards
Just leave it like that or you have to change more in the safezone script

EDIT
I would use this
http://pastebin.com/ht7djVGH
 

Link to comment
Share on other sites

  • 0

If you really wanted to do this without editing those other scripts you could just open your mission.sqm cut and paste one of the triggers for your trader cities and change the location. Each trader city has two triggers, one to clear zeds and stop people from building and the other is for making it a safezone so just use the one that doesn't mention safezone and delete the part about zombies. Make sure you update the item count for sensors by +1.

Example:

class Item40
{
position[]={22570.555, -44, 19610.85};
a=1200;
b=1200;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="zoneSectorB";
expCond="(player distance zoneSectorB) < 1200;";
expActiv="canbuild = false;  titleText [""\n\nNow entering Sector B"", ""PLAIN DOWN"", 1];";
expDesactiv="canbuild = true; titleText [""\n\nNow leaving Sector B"", ""PLAIN DOWN"", 1];";
class Effects
{
};
};
 
That's basically what I used to keep people from building on SectorB on the Epoch Origins server I play on.
Link to comment
Share on other sites

  • 0

 

If you really wanted to do this without editing those other scripts you could just open your mission.sqm cut and paste one of the triggers for your trader cities and change the location. Each trader city has two triggers, one to clear zeds and stop people from building and the other is for making it a safezone so just use the one that doesn't mention safezone and delete the part about zombies. Make sure you update the item count for sensors by +1.

Example:

class Item40
{
position[]={22570.555, -44, 19610.85};
a=1200;
b=1200;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="zoneSectorB";
expCond="(player distance zoneSectorB) < 1200;";
expActiv="canbuild = false;  titleText [""\n\nNow entering Sector B"", ""PLAIN DOWN"", 1];";
expDesactiv="canbuild = true; titleText [""\n\nNow leaving Sector B"", ""PLAIN DOWN"", 1];";
class Effects
{
};
};
 
That's basically what I used to keep people from building on SectorB on the Epoch Origins server I play on.

 

The safe zone script uses the cant build to activate.

 

waitUntil { !canBuild };
Link to comment
Share on other sites

  • 0

Get a custom player_build.sqf in your mission.pbo.

Edit your compiles to point to it.

 

add a line like this:

if ((player distance [X,Y,Z]) < 500) exitWith { DZE_ActionInProgress = false; cutText ["You cannot build in an AI City!","PLAIN DOWN"]; };

Coordinates would be the coords of the center of your city, 500 is the radius in meters.

 

I would give this a try Vampire, but I'm just a noob. The guys that were helping with that server don't have much time for it, or are burned out. So, it's just me; a coding noob. Well, calling my self a coding noob would imply that I know something about what I'm doing; I don't. :(

 

I tried the suggestions the other guys had on here with no success; probably my own fault. But, your idea seems to be the easiest. Now all l need to do is figure out how; build custom player_build.sqf and point compiles to it.

 

I would assume I just create a file in the mission folder root, called player_build.sqf, and paste that code you put up there in it. Does anything else go in that file? I mean, will that file only have one line in it? Since I have two ai bases, will it then have two lines? one for each, only varying by the coords? And where is that compiles file?

 

Sorry for all the jibber jabber, but like I said, I'm extremely new at this. Finding it very intimidating. But, maybe one day I will know enough to contribute my own code to this forum. :rolleyes:

 

EDITED: I already have a player_build.sqf file, which is being used by the "building snap" script. Does that change anything now?

Link to comment
Share on other sites

  • 0

I would give this a try Vampire, but I'm just a noob. The guys that were helping with that server don't have much time for it, or are burned out. So, it's just me; a coding noob. Well, calling my self a coding noob would imply that I know something about what I'm doing; I don't. :(

 

I tried the suggestions the other guys had on here with no success; probably my own fault. But, your idea seems to be the easiest. Now all l need to do is figure out how; build custom player_build.sqf and point compiles to it.

 

I would assume I just create a file in the mission folder root, called player_build.sqf, and paste that code you put up there in it. Does anything else go in that file? I mean, will that file only have one line in it? Since I have two ai bases, will it then have two lines? one for each, only varying by the coords? And where is that compiles file?

 

Sorry for all the jibber jabber, but like I said, I'm extremely new at this. Finding it very intimidating. But, maybe one day I will know enough to contribute my own code to this forum. :rolleyes:

 

EDITED: I already have a player_build.sqf file, which is being used by the "building snap" script. Does that change anything now?

 

You can just edit that file if you already have it working ;)

 

Add the line I posted under these two lines:

// disallow building if too many objects are found within 30m
if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];};
Link to comment
Share on other sites

  • 0

 

The safe zone script uses the cant build to activate.

 

waitUntil { !canBuild };

Yes, if you are in a safezone, the safezone waits for that variable to change in order to turn the safe zone off. It doesn't work the other way around. That's why each trader has TWO triggers that go off, one that starts the safezone and the other clears zeds and stops building. Enabling canBuild does nothing but bypass the ability to build in a certain area. My sector b uses exactly the trigger I showed above and the only effects are you can't build or log out there. Which not using brings up the issue of allowing a player to clear the ai, log out in a spot they would otherwise not be able to get to with all the ai and more easily defeat the 'event' you set up after a restart. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...