Jump to content

morieza

Member
  • Content Count

    53
  • Joined

  • Last visited

  • Medals

Posts posted by morieza


  1. I've never seen anything even close to it. Getting AI to do anything specific is a herculean task - even getting them to drive down the road without doing a 17-point turn at an intersection they should be driving straight through can be an issue.

    That said, there is an addon (script version also) called "All Round Defense" that manages to get AI to do something very specific, so maybe there are some answers there.

    I'd say keep the topic here, as this will end up being a scripting discussion anyway.

    I just watching "All Round Defense" demo video, but I already have made a script like that (similar but simpler) to my mission,

    Here it is, my "round defense" script.

    Please note: this is just a prove information not recommendation ('cause it's SQS format, 'cause I'm new in scripting).

    From "Take The Red On", \self\hwpog2ur.sqs

    Using for OPFOR infantry (8 group = each group have 8 guard point, 8 direction).

    OPFOR groups patrolling circle around center area, each group moving clockwise or contra clockwise, each group switch guard point every some amount of time,

    their patrol radius and switch guard timing depend on distance between player and center position, so more closer player to center position - more smaller the OPFOR radius patrol,

    and if there is casualties in an OPFOR group or not alive something, the center patrol of that group is player (example: if player kill soldier in group 1 and group 3, then the center patrol of group 1 and group 3 is player, group 2/4/5/6/7/8 still using first center position).

    This script result is kinda like "protect/defend the VIP/area and search for an unknown intruder".

    
    _tgu = _this select 0;
    _tt1 = _this select 1;
    _tt2 = _this select 2;
    _tr = _this select 3;
    _txnm = _this select 4;
    _txmx = _this select 5;
    _drn = _this select 6;
    _htpi = _this select 7;
    
    ~0.1
    _tx = _tt1 distance _tt2;
    ? (surfaceIsWater getpos _tt2 and _tx > _txmx) : _tx = _txmx;
    ? (0.2 > _txnm) : _txnm = 0.2;
    _ntrnm = _txnm *0.5;
    _txn = _tx *_txnm;
    _htpf = _htpi -_drn;
    _opx = _txn *sin(_htpf);
    _opy = _txn *cos(_htpf);
    _htp = [(getPos _tt1 select 0) -_opx, (getPos _tt1 select 1) -_opy];
    ~0.1
    
    #hwpo
    _tgun = {alive _x} count units _tgu;
    if (0 == _tgun or !alive _tt1 or !alive _tt2) then {goto "endo"};
    _ttc = _tt1;
    ? (!alive _tr) : _ttc = _tt2; _txnm = _ntrnm;
    _tdir = ((getpos _ttc select 0) - (_htp select 0)) atan2 ((getpos _ttc select 1) - (_htp select 1));
    _tdiro = _tdir +_drn;
    _tx = _tt1 distance _tt2;
    ? (surfaceIsWater getpos _tt2 and _tx > _txmx) : _tx = _txmx;
    _txn = _tx *_txnm;
    _opx = _txn *sin(_tdiro);
    _opy = _txn *cos(_tdiro);
    _htp = [(getPos _ttc select 0) -_opx, (getPos _ttc select 1) -_opy];
    ~0.5
    if (!surfaceIsWater _htp) then {_tgu move _htp} else {goto "hwpo"};
    ~_tgun +(_txn *_txnm)
    goto "hwpo";
    
    #endo
    exit
    

    select 0 = group name /defender

    select 1 = center 1 /first center orientation

    select 2 = center 2 /intruder

    select 3 = object, if not alive, change orientation from center 1 to center 2

    select 4 = multiplier (lower than 1.0), multiplying distance center 1 and center 2, for radius patrol and guard time

    select 5 = maximum distance for select 4

    select 6 = direction, 45 for moving clockwise, -45 for contra clockwise

    select 7 = direction (0/45/90), for first moving direction and first guard position

    Its been 2 weeks for mod searching, no hope.

    As you said, about to keep the topic here, I think it was a good idea, the last hope is using script.

    Thanks for your suggestions.


  2. Did you replace Condition this with !alive XXX or anything, in trigger Area (XXX present/not present) ?

    if yes, leave the 'this' if you set the trigger to trigger Area detection.

    'this and...' for add condition or 'false' to suspend.

    Assassination demo mission 2 using 'false' as a suspended condition in Trigger Area.

    Assassination demo mission 3 using 'this and...' for add condition in Trigger Area.

    Description:

    Player must kill an enemy officer, avoid detection or he will try to escape, abort mission if he board the vehicle, then player must go to next objective area (location 1 if success, location 2 if fail).


  3. Yes, but tricky.

    Make sure the second trigger (end-trigger?) should be far away /unreachable... (or add more condition check),

    then on that 'No-name bluefor Trigger' Activation: nexttriggername setpos getpos objectname.

    Using 'triggerActivated triggername' is the proper method, especially for serial objective, no need to check the whole activation from previous trigger, we can also check multiple trigger a lot easier.

    And please note, for Trigger Area don't use 'Countdown', please use 'Timeout' if the next Condition check is on Activation field.

    There is an alternative other than using triggerActivated,

    example,

    - on object init field, define:

    bla = 0;

    - on Activation field, if trigger is trigger Area detection [repeatedly, timeout]:

    trigger1: if (A or B or C) then {bla = 1};

    trigger2: if (D and E and F and bla == 1) then {bla = 2};

    trigger3: if (G or H or I) then {if (bla == 2) then {bla = 3}};

    ----------

    IMO, your thread title is a bit confusing, do you mean how to teleport the trigger?...


  4. example (for your last post /original thread title).

    (1) You can add trigger area unit present, repeatedly with 'timeout', name it to holdarea, set the number for min/mid/max,

    note: don't use 'countdown', by using 'timeout' time calculation will interrupt/cancel if the unit leave the area, so the unit activator must go back to re-calculate the timeout for activation.

    Then put something on activation, next objective (move to end trigger) or else, you can use this on activation:

    if (alive player) then {do XXX}.

    (2) On the next sequence objective/trigger, like the end-trigger in demo mission, add the condition on Activation field:

    if (triggerActivated holdarea and alive player) then {if (!alive eo1) then {endMission "end1"} else {endMission "end2"}};


  5. just an example...

    Put this code below to your init.sqf

    enmc = {alive _x and side _x == east} count allUnits; 
    {_x addEventHandler ["killed", {enmc = enmc -1; if (enmc != 0) then {hintsilent format["Enemy remaining : %1",enmc]} else {(_this select 0) cameraEffect ["Fixedwithzoom","top"]}; _mrk = createMarkerLocal [format["%1", enmc], getpos (_this select 0)]; format["%1", enmc] setMarkerTypeLocal "dot"; "_mrk" setMarkerColorLocal "ColorRed"}]} foreach allunits;
    sleep 0.5;
    player removeAllEventHandlers "killed";
    titletext ["KILL 'EM ALL","plain"];
    titleFadeOut 2;
    sleep 2;
    hintsilent format["Enemy remaining : %1",enmc];
    
    waitUntil {enmc == 0};
    sleep 3;
    cuttext ["All enemy has been eliminated.","plain down"];
    sleep 3;
    titletext ["MISSION COMPLETED","plain",0.4];
    cuttext ["","black out"];
    sleep 4;
    endMission "END1";


  6. Hi ForzaJuve,

    I made a simple demo mission, I'm just toying around, ...not sure if it's similar or not:

    player BLUFOR = move alone

    another BLUFOR = move group/alone - not listed/not counted/any

    main method = sin, cos, for moving trigger

    --> player BLUFOR must wait for another BLUFOR for completion, and vice versa

    Condition: OPFOR has been eliminated (not present) 'AND' another BLUFOR present 'AND' player BLUFOR present, in same area.


  7. I think you should set the trigger 'condition: this' if the trigger is trigger area, and make sure it's 'repeatedly' and using "timeout" (interruptable).

    About "opposite of the Activation" maybe 'cos you create the trigger at player position and there is no OPFOR present, so when OPFOR is "present" then accidentally move/leave the area a bit -it's activated,

    ---> "not present" activation has to be "present" at first.... :confused:

    If the trigger is on the fly creation, you must create that "not present" trigger on some place where the OPFOR is "present", wait for some amount of time (equal or higher than "timeout" value) then set the trigger position to player (_triggername setpos getpos player)

    ...proper command to clear 'knowsAbout', I need that too.

    CMIIW


  8. ...just some tricky idea:


    • lowering the distance between "transport unload" wp and "move" wp to bellow than 1500, to avoid bad path planning (mostly happen on Arma 2 vanilla, ...rarely on Arma 2 OA/CO)
    • set the pilot rank to higher than the squad leader rank
    • maybe the heli wait for sync, since heli already touch/complete his "transport unload" wp, so the squad must complete their "get out" wp too


  9. ttro.jpg

    by Morieza

    For ArmA 2, Arma 2 Free, ArmA 2 Combined Operations.

    Description:

    Rescue the defector (Rus), on insurgent territory.

    Features:

    - instant action, singleplayer only

    - self-adaptable, only copy-paste-rename to port to any addon islands/maps (A2, A2CO)

    - Center Peel tactic with AI teammates

    - player can set/choose:

    • any location, land or sea insertion
    • difficulty mode, each have auto increase - depend on player score & health
    • random color effect, soft-medium color balance
    • weather
    • buildings condition = destroyed, hidden, unchanged
    • skip time
    • weapons = silenced, TWS (A2CO), rifle, sniper rifle, machinegun

    - player can also set intro duration = normal/default, skip, longer, longest

    - AI Huey will fly more safely over any high cliffs/mountains

    - support/assist (AH1z Cobra), player must eliminate all air threat first

    - recover weapon after swim, sea & inland water (A2, A2F)

    - unique enemy patrol, no regular waypoint

    - autoheal, slow for player and all enemy infantry, fast for teammate

    - etc...

    Installation:

    Get into game installation folder, extract to ..\Missions folder.

    Credits & thanks:

    - Bohemia Interactive

    - Armaholic

    Changelog:

    v1.02

    • Added: Center-Peel /Aussie Peelback tactic with AI teammates, peel option: left/left-back, right/right-back, formation heading.
    • Improved: Lowering starting-skill and resetting auto-increase-skill multiplier, now the easiest mode will no longer become the hardest, now if enemy unit dead, units remaining in his group will gain an extra skill (more casualties more group skill), new 20 difficulty mode, end mission bonus = +1%..... +400%.
    • Improved: Few ruins of destroyed buildings will be hidden to avoid OPFOR AI stuck when they trying to change group formation heading direction near ruin.

    v1.01

    - Improved: Inland water check for recover weapon after swim (A2, A2F)

    - Improved: Mi-8MT hunting movement

    - Added: Weather option

    - Added: Buildings condition option

    - Removed: Enemy AI accuracy skill option (A2CO)

    - Added: Difficulty mode option

    Notes:

    Untested with any mods (ACE, ASR, etc...), if you are using mods then

    encounter a problem during a mission, please disable them.

    Download:

    Take The Red On v1.02

    This is my first mission,

    thanks to everyone who tried this mission, I hope you like it.

×