Results 1 to 6 of 6

Thread: AI Sitdown and Wait

  1. #1

    AI Sitdown and Wait

    Hi Guys,

    Having some major problems getting the OpFor Enemy to sit down around a Fire and move to their designated Waypoints once BluFor are detected by a Trigger.

    I have the AI all sitting down no problem using this script

    this setBehaviour "SAFE";
    _this disableAI "ANIM";
    _this action ["SITDOWN",_this];
    sleep 5;
    waitUntil{
    if(animationState _this != "amovpsitmstpsraswrfldnon")then{
    sleep 8+random(3);
    _this action ["SITDOWN",_this];
    waitUntil{animationState _this == "amovpsitmstpsraswrfldnon"}
    };
    behaviour _this != "SAFE"
    };
    _this enableAI "ANIM";


    I then Synched the AI's first waypoint to the Trigger where BlueFor has been detected by OpFor but the dummies just continue to sit around the fire.

    Any help would be greatly appreciated as im losing my hair in frustration.

  2. #2
    Ok, what you've done is too complicated and provides the units from behaving normally when spotting enemies.

    So :

    1) Put the squad on the map, chosing for each soldier "none" instead of "in formation" in the soldier menu under "special menu". Thanks to that, you'll be able to position them where you want around the fire.

    2) In the init line of the squad leader, write this :

    Code:
    g1 = group this;{doStop _x;_x setCombatMode "safe"} forEach units g1
    3) Put a trigger on the map, which condition must be set to TRUE (instead of THIS), with the following in the on activation line :

    Code:
    {_x playmove "amovpsitmstpsraswrfldnon_weaponcheck1"} foreach units g1
    And that's all.

  3. #3
    Thanks very much shall implement it now and let you know how it went. Much appreciated.

  4. #4
    Quote Originally Posted by ProfTournesol View Post
    Ok, what you've done is too complicated and provides the units from behaving normally when spotting enemies.
    He's using code I posted a while ago, and I still use that code to great effect. He must be doing something wrong. Also, your alternative will not work. Yea it will get them to sit down, but at some point, the AI will stand up, and your code does not compensate for this so once they stand up they will not sit back down.

    [45Cdo]Kotp, please make sure you have the underscore (_) in front of the first "this". Also, I did notice since OA that the bevaiour of AI is a little odd now when they are not group leader, so try this:
    Code:
    _grp = group _this;
    [_this] joinSilent grpNull;
    _this setBehaviour "SAFE";
    _this disableAI "ANIM";
    _this action ["SITDOWN",_this];
    sleep 5;
    waitUntil{
    if(animationState _this != "amovpsitmstpsraswrfldnon")then{
    sleep 8+random(3);
    _this action ["SITDOWN",_this];
    waitUntil{animationState _this == "amovpsitmstpsraswrfldnon"}
    };
    behaviour _this != "SAFE"
    };
    _this enableAI "ANIM";
    [_this] joinSilent _grp;
    _this doFollow (leader _grp);
    I have used this modification recently and it works very well.
    VBS2 Designer

    Quote Originally Posted by Armored_Sheep View Post
    I like to call Arma a sandbox game that works pretty much like LEGO - you buy it not just because you want to have a nice car from the main picture on its box, do you?

  5. #5
    Quote Originally Posted by Big Dawg KS View Post
    Also, your alternative will not work. Yea it will get them to sit down, but at some point, the AI will stand up, and your code does not compensate for this so once they stand up they will not sit back down.
    I'm sorry to somehow disagree with you but i've been editing missions for quite a long time now, and i'm used to extensively testing what i'm proposing (well, most of the time ). Moreover i faced this very problem since OFP and know how to manage it without heavy scripting.

    So what i've written is working very nicely (try and you'll see), i've waited almost 15 minutes and nobody stood up.

    EDIT : 60 minutes now, and everybody is still sitting !
    Last edited by ProfTournesol; Jul 16 2010 at 16:27.

  6. #6
    Quote Originally Posted by ProfTournesol View Post
    15 minutes and nobody stood up.

    EDIT : 60 minutes now, and everybody is still sitting !
    Try approaching him and saying hi...

    Anyway, it's not important. The above modification I posted should work very well now. I find that seperating them from the rest of the group also helps them seem more "relaxed".
    Last edited by Big Dawg KS; Jul 16 2010 at 20:52.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •