Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
shpagin

Avatar / Picture

Lieutenant
Registered:
Posts: 159
Reply with quote  #1 
Am looking for a good Zone Restriction solution to keep folks within the battle area. The one i tried kills anyone in a crew served weapon or vehice.  Otherwise it worked.  But i need players to be able to play in vehicles, especially tanks, and heavy MGs.

So if anyone has a good one, would appreciate it.
0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #2 
This one will kill anyone in a vehicle and destroy the vehicle if they move into the restricted zone.

A trigger of the required size, or a number of triggers enclosing an area.

Set for anybody to activate

in the condition put this
(vehicle player) in thislist;


In the on Activation use this
(vehicle player) setDammage 1; player setDammage 1; hint "You left the mission area!"


You would normally have a triggers prior to the above one with a message telling players they are about to leave the playing area and to turn back, use the same condition as above, but something like this in the on activation
titletext[format["DANGER!!\nOut of bounds, turn back!"],"Plain down"]

Also to keep teams away from the opposing teams spawn area you could use this:- This example is saying anybody who is not faction west will die And will name the player that tried to enter the enemy spawn area.

Again set for anybody to activate

(vehicle player) in thisList AND side player != WEST


And on activation
(vehicle player) setDammage 1; player setDammage 1; hint format ["%1 was killed for entering West Safe Zone", name (thislist select 0)]


In both the above cases it is advisable to have 2 sets of trigger borders, one to warn the person they are straying, then one to deal the death blow

Any Capture the Flag (CTF) mission will probably have similar out of bounds borders, if not happy with this one you could try unpbo'ing one of those and seeing how they have done it.
0
[EVO] Dan

Sergeant
Registered:
Posts: 85
Reply with quote  #3 

I thought there was an editor module or something for this? or is it broken? (I know one exists in A2/A3/TOH)

0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #4 
There is, but it doesnt quite work how I think it's supposed to, but it does work kind of,  basically if you leave the zone it will kill you, but it doesn't warn you first or produce an enemy group that hunts you down and also the zone is circular.

Besides it comes up with error messages when using this in your game start target "-showScriptErrors" so somethings not right.
0
shpagin

Avatar / Picture

Lieutenant
Registered:
Posts: 159
Reply with quote  #5 
Tay, I tried your top two scripts.  It still kills you at beginning of game if you are in a tank and within the fighting area. 
0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #6 

Shpagin, the codes I gave are to go in triggers that surround the playing area, they dont go in triggers within the playing area. Is that the way you did it?

trigger example 

0
Rydygier

Avatar / Picture

IFR Team
Registered:
Posts: 179
Reply with quote  #7 
I have someting here, that may prove useful. It is scripted solution:

RZ

With this user can, by placing empty triggers of any shape, define as much restriction zones, as he likes. There are two types of RZs: "in" and "out". "In" means, that player myst stay inside it, "Out" - that player can't go there.

User have to do two tings: name these triggers properly and exec the script at init by usual [] execVM "RZ.sqf". As for naming - all names have three parts. First, "RZ" is constant and common to all types. Second indicates type of zone and should be one of "in" or "out". Last part is discriminant of each zone in form "_X", where X is positive number from 1 to infinity (each subsequent zone must be named with subsequent number starting from 1, counted separatelly for both types). So for example single "in" zone should be named RZin_1. If there are needed 2 "in" and 3" out" zones: RZin_1, RZin_2, RZout_1,RZout_2,RZout_3. There are two additiona customization variables:

RydRZ_Debug = false; - if true, zones will be marked on map.
RydRZ_Active = true; - when set to false, code will stop and wait with another check until this variable become true again.

Code checks player position each second, so for fast units, eg airplanes, this time could be reduced for more frequent checking, eg to 0.1 second.

How it works? For each trigger code will create a location of same shape and position. Next will constantly monitor, if player is outside of any of defined safe zones (so it is not additive area currently) or inside any forbidden zone. If so - warning is displayed. Next, as long, as player stays in restricted area, code compares his current distance from/to center of violated zone with initial, obtained just after violation. If that distancies difference will grow up to much, player is killed (only 20 meters of buffer zone by default, if zone has radius not biger than this value, player will be only warned, never killed by this zone). If he returns into safe area, distance check is reseted. Should work fine regardless of height above ground, as distance/position in location is checked in 2D coords.

Did only few tests, but in general seems to work fine. Still - this is experimetal code, so for sure needs more attention because of some issues - if there is definded any "in" zone, and player is initially outside it, regardless of distance, player will be killed only, when distance between him and that zone will grow over 20 meters above initial distance. Similar if player starts inside restricted zone - distance must be first reduced more than by 20 meters before kill. Another strange thing may happen sometimes, if player is switching between playable units in and out restricted zone or between units in two different restricted zones. All this problems are caused by fact, that zone firstly tries to warn, only after that kills. If we set the code, so will immediatelly kill unit at any RZ violation - situation is clear and all works without issues. 

If there is interest - I can do some more work to improve code and clear some problems.
0
shpagin

Avatar / Picture

Lieutenant
Registered:
Posts: 159
Reply with quote  #8 
Tay, Yep, stupid me, that is what i did.  Will fix it tonight   Thanks for the simple graphic for this old airborne ranger to follow 
0
shpagin

Avatar / Picture

Lieutenant
Registered:
Posts: 159
Reply with quote  #9 
Tay Uk, corrected Zone restriction and it worked like a charm. Thanks again!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.