Results 1 to 2 of 2

Thread: change behaviour of all units by trigger

  1. #1

    change behaviour of all units by trigger

    I am creating an army base master-draft.
    So I want to include a trigger, which changes the behavior of all units within the area if any opposite unit is detected. Besides I want to sound an alarm if triggered.

    What do I have to put into the OnAct box to change the behavior of all friendly units? Wouldnt matter if the behavior of all units, enemies as well, changes.

    And how do I sound the alarm? There are sounds under "Empty" ojects, even a sound for alarm. But this sound ALWAYS sounds. Unfortunately there is no proper sound under the triggers options

    thanks in advance folks =)

  2. #2
    Hiya,
    You could try this script for your alarm that I made under a different handle many moons ago
    http://www.armaholic.com/page.php?id=9179
    For a change in behavior try this.

    Code:
    //////////////////////////////////////////////////////////////////
    // Function file for [ARMA2/Combined Ops]
    // Created by: Hendo
    // in a trigger place this in the onact
    // hen = [(thislist select 0)]execVM "setbehaviour.sqf";
    //////////////////////////////////////////////////////////////////
    
    _caller = _this select 0;
    _seek_type = "MAN";
    _check_radius=30;
    _seeker_unit = [getPosASL _caller select 0,getPosASL _caller select 1,0] nearObjects [_seek_type,_check_radius];
    
    {
    /*
    "BLUE" (Never fire) 
    "GREEN" (Hold fire - defend only) 
    "WHITE" (Hold fire, engage at will) 
    "YELLOW" (Fire at will) 
    "RED" (Fire at will, engage at will) 	
    */
    	
    _x setCombatMode "BLUE";
    
    /*
    "CARELESS" 
    "SAFE" 
    "AWARE" 
    "COMBAT" 
    "STEALTH". 
    */
    
    _x setBehaviour "STEALTH";
    }forEach _seeker_unit;
    
    //DEBUG SCRIPT ==>
    hint "This has exited";
    Here is the Wiki link to the Definition on SetBehavior
    http://community.bistudio.com/wiki/setBehaviour

    GoodLuck

    Edit: fixed code to include all units within radius
    Last edited by Hendo; Jul 10 2012 at 11:19.
    Normally in dangerous situations I have a getaway car.

Similar Threads

  1. Using a Trigger to Change the Conditions of another trigger
    By vonsteimel in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Mar 26 2012, 23:35
  2. change units
    By koekto in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 1
    Last Post: Aug 10 2011, 08:22
  3. Units keep running while behaviour "safe"
    By dematti in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 13
    Last Post: Mar 4 2010, 09:55
  4. Change units side.
    By Kocrachon in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 1
    Last Post: Jan 6 2010, 10:31
  5. Behaviour trigger
    By JacobJ in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Dec 13 2009, 21:54

Posting Permissions

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