Home   Help Search Login Register  

Author Topic: How to enable AI orientation while disableAI "MOVE"  (Read 9410 times)

0 Members and 1 Guest are viewing this topic.

Offline Nachliel

  • Members
  • *
How to enable AI orientation while disableAI "MOVE"
« on: 29 Sep 2009, 08:47:25 »
I need a group of soldiers to stay down on a mountain and give suppression fire, i used disableAI "Move" command, but I noticed that they cannot change their direction.
I tried using stop, dostop commandstop, commands but the units spontaneously move...

another question, there is a command for the units to search for targets, because sometimes they have target 200 meters infront of them and they do nothing, without using dotarget.. etc commands, just search for enemy with their sight.

thanks.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #1 on: 29 Sep 2009, 10:55:42 »
You are lucky! I have a group of soldier with disableAI "MOVE" and they infinitly change their direction and turn around like a marry-go-around... :(
Fix bayonet!

Offline celoush

  • Members
  • *
  • Lazy czech mission designer
    • My czech website about mission design
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #2 on: 29 Sep 2009, 11:57:37 »
try disableai "autotarget"

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #3 on: 03 Oct 2009, 19:53:33 »
Does giving them a Hold Waypoint and using doWatch work?

Offline Nachliel

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #4 on: 04 Oct 2009, 02:53:07 »
well, no, disableAI "MOVE" disable their movment in the spot.
and HOLD WP, is not good because they will move when they will see enemy...
I just want them to stay put, and give covering fire, my mission is to create a holding force.
but without the disableAI they keep moving and not focusing on the fire and the enemies.

Offline Binesi

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #5 on: 04 Oct 2009, 06:12:06 »
Yes, disabling MOVE will totally disable the ability for the unit to move, including rotating. If anyone has seen differently they probably made a typo somewhere.

To do what you want use:

this forceSpeed 0

If you use 'doStop this' you will only have the unit stopping until it gets a new move order from it's squad leader.

By using a combination of speed 0 units, stopped units, and free moving units you can set up an entire area of defenders under a single squad leader fairly easily while letting some units maintain strategic positions either permanently or until the action starts. This is the trick to getting units to engage at higher ranges. Any members of that team will try to engage a target which is visible by any other member.

One final trick is that you may want to get these units moving again later. You could consider for example a trigger which counts how many of that squad are still alive. If they fall under a certain number then do:

this forceSpeed -1

Do this on the entire group to get them all moving normally again and let them escape are relocate.
« Last Edit: 04 Oct 2009, 06:23:02 by Binesi »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #6 on: 04 Oct 2009, 09:38:56 »
Quote
If anyone has seen differently they probably made a typo somewhere.

Just to clarify, DisableAI "move" affects only movement from one place to another. Units will still target enemy units, hence their rotation (as celoush has pointed out) and why there's also "target" and "autotarget" attributes for the disableAI command.


Offline Nachliel

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #7 on: 04 Oct 2009, 11:14:46 »
First of all----thank you very much!! :)
well, I tried forcespeed and stop, on a single unit and it's worked fine.
But, I have a script ready for a group, the script is activated when a group reach some waypoint.
[grpcommander] exec "HOLDINGFIRE.sqs" - in WP activation line.
Code: [Select]
_group1 = _this select 0
_group1 setFormation "LINE"
_group1 setSpeedMode "FULL";
;;wait for the group to be ready in formation
~4
int1=0
{_x forcespeed 0; dostop _x; _x setUnitPos "DOWN"; _x setskill ["spotDistance",1]; _x setskill ["spotTime",1]; int1=int1+1;} forEach units group _group1
;;just let me know about the script.
hint format["%1 Units are ready for suppresion.",int1]
_group1 setBehaviour "COMBAT"
_group1 setCombatMode "RED"
now, I tried this code, but they still keep moving.. what is the problem?? :confused:
I have notice that when the units recive a command from their commander they keep moving..
« Last Edit: 04 Oct 2009, 16:55:25 by Nachliel »

Offline Binesi

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #8 on: 05 Oct 2009, 20:09:03 »
Just to clarify, DisableAI "move" affects only movement from one place to another. Units will still target enemy units, hence their rotation (as celoush has pointed out) and why there's also "target" and "autotarget" attributes for the disableAI command.

Maybe this was true in some other version of ArmA but in ArmA 2 disable AI "move" will definitely, 100% of time, repeatably, without fail, remove the ability for a unit to rotate. It's a simple experiment to verify, but if you have something that acts different please post the mission and lets see. I just tested this again myself to make sure I didn't wake up on a new planet ;-)

Nachliel, you need to do one more thing. Make sure all of those group members are set to Special: "None" instead of "In Formation". The option "In Formation" will always assemble the group together regardless of placement or any other settings.

As for your script, I don't do SQS but if you are still having trouble I can post my own SQF unit initialization script which takes a few different parameters including forcing the unit to stay in place while allowing rotation. I use this script to setup entire towns as one group with various units holding static positions and rotating while some move to engage from multiple locations as soon as enemies are spotted.
« Last Edit: 05 Oct 2009, 20:25:12 by Binesi »

Offline Nachliel

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #9 on: 05 Oct 2009, 20:36:45 »
I will glad to have a script, it's not matter to me if it's sqs or sqf..
My Holding Force mission
here is my mission.
« Last Edit: 05 Oct 2009, 20:41:25 by Nachliel »

Offline Binesi

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #10 on: 05 Oct 2009, 21:55:56 »
I don't mind taking a look at that mission but can you put it somewhere else? That site tries to open a bunch of nasty popups and my browser totally blocks it.

Oh, also - it just occurred to me that doStop and forceSpeed don't affect vehicle turret rotation (turret only, not the actual vehicle). Maybe that is what some people are getting confused with...

The relevant parts of my SQF script go like this:

Code: [Select]
/*
============================================================================
Script: BIN_initUnit.sqf v1.0
Author(s): Binesi

Description:
Unit Initialization and configuration.

Parameter(s):
_this select 0: (Object). Unit
_this select 1: (Array).  Position
_this select 2: (Number). doStop unit (stop until new orders)
_this select 3: (Number). forceSpeed 0 unit (set fixed position)
_this select 4: (String). Inventory configuration

Return(s):
Boolean - success flag

Example(s):
init = [this,"AUTO",0,0] execVM "BIN\BIN_initUnit.sqf"
init = [this,"DOWN",1,1,"ins_sniper"] execVM "BIN\BIN_initUnit.sqf"

============================================================================
*/

if (isNull (_this select 0)) exitWith {};
if (!local (_this select 0)) exitWith {};

// Define variables
_unit = _this select 0;
_pos = _this select 1;
_stop = _this select 2;
_force = _this select 3;
_items = if (count _this > 4) then {_this select 4};

// Install "killed" event handler
_unit addEventHandler ["killed",{_this call BIN_addToTrashQueue}];

// Set position
_unit setUnitPos _pos; // Set stance
if (_stop > 0) then { doStop _unit }; // Stop unit until it receives new orders
if (_force > 0) then { _unit forceSpeed 0 }; // Force speed to 0 (prevent movement except turning)

// Define equipment
switch (_items) do {

//-----------------------------------------------------------------------------------------------
// Insurgents
//-----------------------------------------------------------------------------------------------

case "ins_gl": // AK 74 GL
{
removeAllWeapons _unit;
{_unit addMagazine "30Rnd_545x39_AK"} forEach [1,2,3,4,5,6,7,8,9,10];
{_unit addMagazine "1Rnd_HE_GP25"} forEach [1,2,3,4,5,6,7,8];
{_unit addMagazine "HandGrenade_East"} forEach [1,2];
_unit addWeapon "AK_74_GL";
_unit addWeapon "NVGoggles";
_unit addWeapon "Binocular";
_unit selectWeapon "AK_74_GL";
};


etc, etc.... (the rest is just more inventory loadouts)

So if I do something like this in the unit's init line:

Code: [Select]
init = [this,"DOWN",1,1,"ins_sniper"] execVM "BIN\BIN_initUnit.sqf"

That Insurgent Sniper will go prone and stay put while still being able to rotate.

If I do:

Code: [Select]
init = [this,"DOWN",1,0,"ins_sniper"] execVM "BIN\BIN_initUnit.sqf"

That sniper will stay put until it's squad leader gives it a new order.

Now I know this isn't the same as what you are trying to do but I just want to show you that the command does work this way anyway for any or all members of a group. If I get some time tomorrow I'll see if I can reproduce something similar to what you are doing with a waypoint activated script.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #11 on: 05 Oct 2009, 21:56:46 »
Quote
Maybe this was true in some other version of ArmA...

I stand corrected. Independant tests (thanks Planck) have confirmed that in both OFP and ArmA disableAI "move" affects only the x,y,z coordinates and units will still turn to engage the enemy from that spot. In Arma2 they do not turn to engage the enemy.

I've commented in the COMREF to this effect. Thanks for the update, good to know. :good:

Offline Nachliel

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #12 on: 06 Oct 2009, 08:37:16 »
Here is a new link to my mission, thank you for the script :)
http://www.megaupload.com/?d=SZX850YH

Offline Binesi

  • Members
  • *
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #13 on: 07 Oct 2009, 08:16:55 »
Change the waypoint combat mode to "Open Fire". It looks like the group leader can override the forceSpeed command if he issues an "engage" order. Without the group leader doing that they seem pretty much glued to their spot.

I played around with this a bit and ended up using this code directly in the On Act box:

Code: [Select]
null = [this] spawn {
_leader = _this select 0;
_units = units group _leader;
sleep 2;
{
_x setUnitPos "DOWN";
_x setSkill ["spotDistance",1];
_x setSkill ["spotTime",1];
_x doWatch r1;
} forEach _units;

_leader setBehaviour "COMBAT";
sleep 2;

_leader doTarget r1;
sleep 6;

{
_x forceSpeed 0;
} forEach _units;

hint format["%1 are ready for suppresion.",_units];
};


I set the forceSpeed 0 command to be a bit later to give them more time to get into a good position and to override any engage orders that the squad leader may give early on.

Offline Binkowski

  • OFP-fanatic
  • OFPEC Patron
  • ****
    • My Personal Website
Re: How to enable AI orientation while disableAI "MOVE"
« Reply #14 on: 09 Oct 2009, 04:53:54 »
Maybe, disableAI, doTarget, and doFire?