Jump to content

Recommended Posts

Hello everybody! The question is how to limit the space of a group’s action to the boundaries of a trigger? This is necessary so that the group does not retreat and does not run away from the battlefield, and fights within the boundaries of the trigger installed on the map. Is it possible to take the triggerArea and getPos commands for a group? So that the group along the route comes into the trigger, and does not leave its borders until it dies, or until another command arrives, for example, to go to another trigger? How can I do this in a script?

 

group this getPos triggerArea [trigger name] ...?

 

Something like that?

forbid to leave the trigger zone, forbid to go beyond the boundaries of the trigger, and so on

 

 

Edited by rds100

Share this post


Link to post
Share on other sites

Thanks, but i want to use trigger. May be, somebody can wright example of a script, for Arma2OA, like this

1)

IF (unit) inside of the (trigger), THEN

... some condition

 

(where unit, and  trigger is private name) - un1, groupe1, bot1, trigger1, and so on

2)

and reverse example

 

IF (unit) outside of the (trigger), THEN

... some condition

 

3)

(unit) move and get inside of the (trigger)

 

there is example, something like this, but for A3 https://steamcommunity.com/app/107410/discussions/17/135510194253178544/

Share this post


Link to post
Share on other sites
4 hours ago, rds100 said:

Thanks, but i want to use trigger.

 

Zone Restriction uses triggers.  That's what it means by "sensors".   Sensors are:  triggers.

 

On ‎1‎/‎17‎/‎2020 at 6:09 AM, rds100 said:

… how to limit the space of a group’s action to the boundaries of a trigger? This is necessary so that the group does not retreat and does not run away from the battlefield, and fights within the boundaries of the trigger installed on the map.

 

That's the whole purpose of the ZoRA module.  Keep players in an area.  If they push the envelope, warn them.  If they refuse to heed the warning, kill them.

 

If you want to change its behavior to include AI conditions, waypoints, or more, copy its scripts/FSM's into your mission folder and adjust them to suit your needs.

Share this post


Link to post
Share on other sites

Yes, this is exactly what we are talking about, that is, we need to limit the AI in a situation where groups of bots that have the task of occupying defense and standing, they run away, retreat, contrary to all the routes and triggers that are on the map. Apparently, such an algorithm is embedded in the game, retreat and run away to a safe place. I increased my courage https://community.bistudio.com/wiki/allowFleeing, raised setSkill https://community.bistudio.com/wiki/setSkill, but they still run away from the position when the enemy approaches, in the mission that I did. And so I thought that it was then necessary to create a system of triggers and scripts in order to get a full ordered retreat from one trigger to another, sequentially, and as if by command, "retreat to the next line of defense." And to make several such boundaries from the triggers located one after another. For this, I need, as I thought, such commands for working with triggers, as I wrote above. I have not tried the zone restriction, I honestly don’t know how to work with it. Here is a link to the mission itself, look, from the side of the Reds, how the flight from the positions occurs)) https://dropmefiles.com/T9sNH

Share this post


Link to post
Share on other sites

And here's about how I would like to do. The blue arrows in the diagram show the advance. Red - the forces of the defenders, who must retreat on command, from line to line, despite the losses and the intensity of the attack. And only after all the lines have been captured (according to the conditions of these triggers, for example, more than half of the troops in the position have been destroyed), then move to the reserve line (last arrow) https://dropmefiles.com/CQg8V

Share this post


Link to post
Share on other sites

Seems you're doing a retreating line defense with phases of defense lines, and want the AI to remain on line without fleeing until the order to fall back is given.  You want them to stay at the current defense line (the zone).

 

I would think disableAI / enableAI, but not sure it will work for you.  Zone Restriction doesn't prevent anyone from leaving the zone, its intended to punish someone who does.

Share this post


Link to post
Share on other sites
1 hour ago, opusfmspol said:

Seems you're doing a retreating line defense with phases of defense lines, and want the AI to remain on line without fleeing until the order to fall back is given.  You want them to stay at the current defense line (the zone). 

 

Exactly! I wanted to do this with scripts like this:

 

IF (unit) crosses the border (of the trigger) THEN

(unit) should go back inside (trigger)

 

But I myself can’t write them, due to lack of knowledge of scripting

I do not know the software mechanism of the game, so maybe I'm wrong, and this is the wrong way, with these triggers, and so it is impossible to do. I also noticed, in the course of the battle, that the COMMANDER gives his command to run away from the battlefield! It may be necessary to limit precisely this, but how? That is, a script to make changes that prohibit giving this particular command to retreat.

Share this post


Link to post
Share on other sites

 

I'm sure the intrigger function works in A2/OA, you would just run a check and if it's not in the trigger send the group  to trigger location.

 

you just need to change the triggername and mygroup names to match the names your using in your mission

null=[] spawn {
{
if !([triggername, _x] call BIS_fnc_inTrigger) then {_x domove getpos triggername };
sleep 1;
} foreach units mygroup;
};

Place the code  in a game logic init box, or  the trigger on Act box or if you know what your doing make it into  a script.

I can't test so it may have errors or simply not work.

 

It did have an error I missed the ! out of the if command, tested in A3 and it works.

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

×