Home   Help Search Login Register  

Author Topic: Random Patrol scripts Issues.  (Read 2206 times)

0 Members and 2 Guests are viewing this topic.

Offline KBourne

  • Members
  • *
Random Patrol scripts Issues.
« on: 18 Jun 2012, 12:50:52 »
Hi all,

I recently made a mission with the help of SaOk for Iron front. after the release I had a taste for more and I'm planning to take a second shot on developing a mission for ArmA2 this time.

This mission will involve various tasks which the player needs to complete before Exfil is possible, My goal on this mission is to make the player think before he acts. However I want to keep the mission as random as possible, to be more exact I like to add random patrols which the player will encounter trough the mission.

Ive been trying this script: Which uses an improved BIS fnc taskPatrol

http://community.bistudio.com/wiki/BIS_fnc_taskPatrol

Calling the script with.

Code: [Select]
null = [group Ins_GrD2,(getPos Ins_GrD2),15.5] execVM "BIN_taskPatrol.sqf"
This patrol works great to a certain point, I like to use this for simple patrolling on the units and it keeps my editing work nice and tidy without to many way points on the map, on some of the units I use even no way-points at all.

However with the above script Air patrols seem to have trouble to find a good altitude and crashes a lot in to higher Areas around the operation area e.g. mountains or trees with only a altitude change about 300 to 390, I encountered this basically on shoppers. I tried to force them to a certain altitude using this on the units initialization field.

Code: [Select]
Ins_AirPat1 setPos [getPos Ins_AirPat1 select 0,getPos Ins_AirPat1 select 1,535]
and on the first way point on act field using this together with the code for the script,

Code: [Select]
Ins_AirPat1 flyInHeight 535; null = [group Ins_AirPat1,(getPos Ins_AirPat1),15.5] execVM "BIN_taskPatrol.sqf"
I also tried:

Code: [Select]
null = [group Ins_AirPat1,(getPos Ins_AirPat1),15.5] execVM "BIN_taskPatrol.sqf"; Ins_AirPat1 flyInHeight 535;
But this seems to brake the patrol code, the Aircraft cant deter-main a correct flight path anymore and keeps changing his altitude on the spot.

To counter this I tried to use this script in stead: UPS Script http://kronzky.info/ups/index.htm

Called with this code for ground patrols:

Code: [Select]
nul=[Ins_PsQ2,"PatrMark01","random","min:",0,"max:",1] execVM "ups.sqf"
Or

Code: [Select]
nul=[Ins_PsQ3,"PatrMark01","random","min:",2,"max:",5] execVM "ups.sqf"
Called With this code for Air patrols or vehicles e.g. tanks, cars etc:

Code: [Select]
nul=[Ins_AirPat1,"PatrMark02","random"] execVM "ups.sqf"
The thing is that the same thing happens with the Air patrols, they are crashing in to the trees or higher areas which is not meant to be, also a secondary problem seems to happen with this script.

I like to use the first script on some of the units depending on what they need to do for the mission, however reading the description of the second patrol script the AI will act more natural on their patrols, standard the patrol script is written to make the AI move slowly in save mode like a normal patrol.

This works but only to a certain point, for some reason when I for example make a patrol with OPFOR side INS 4 men squad and let them spawn between 4 to 9 times in a marker area of 250 by 465 and test it with a unit on the same side no problems are detected. However when I put a BLUEFOR unit on the map then the strange thing happens and the AI will go in Alert mode instantly.

This also happens with this code:

Code: [Select]
nul=[this,"PatrMark01","random"] execVM "ups.sqf"
Whatever I do, when I place an enemy unit on the map instant alert status is applied on those groups or single units that are using the UPS scripting.

The question is now.

1: Is it possible to make the Air patrols fly higher with aether this scripts or maybe a secondary script purely for Air patrols?

2: How do I fix the alert status issue with AI containing the UPS coding because they aren't meant to go in alert before they encounter or spot the player.  

3: If you have any other suggestions Ill be glad to try them out.

Kind regards
« Last Edit: 18 Jun 2012, 14:18:09 by KBourne »

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Random Patrol scripts Issues.
« Reply #1 on: 21 Jun 2012, 22:20:34 »
Well, AI pilots crash all day long. Maxing out their skill levels and making them Colonels helps a little bit.

Are you sure you want "the maximum distance between waypoints" to be 15.5m? ;)

Did you check your RPT for errors?
try { return true; } finally { return false; }