Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Looking for help on an advanced trigger condition code

Hybrid View

  1. #1

    Looking for help on an advanced trigger condition code

    Hello,

    I am looking for someone who can help me with a specific trigger condition code for a capture zone trigger.
    I have browsed this forum and got some suitable code from existing PVP pack scripts but do not have the skill/knowledge to make them suitable/applicable for my PVP concept.

    Bottom side of this post describes what I am exactly trying to achieve.
    Some help, even if its small would be much appreciated.
    If you need more info, let me know.

    Best regards,

    E. Dutch
    -------------------------------

    The trigger im talking about is an area trigger.
    In order to gain control over the area within the ellipse, the OPFOR has to seize and hold this trigger zone for a certain set time (using timeout).
    Below are the intended conditions for the trigger to be activated:

    • Number of T90 tanks in triggerzone => 2 (can be any T90 vehicle on the map)
    • These two T90s when inside the triggerzone must be operational, meaning having a working turret, engine and tracks
    • The two T90s must be crewed by at least 2 or more players per tank (Only Russian crewmen class must be able to count for this)
    • These four Russian crewmen players must be alive
    • The above four conditions must be met for 5 minutes for the trigger to fire off


    Now if the above conditions seem to be too hard to realize with a code, this could be an alternative.

    • Triggerzone must contain => 2 T90 tank (can be any T90 vehicle on the map)
    • Damage level for those 2 T90A's within the trigarea must be <= 0.5
    • Russian crewmen class players in trigger zone must be => 4 and must be alive
    • The above three conditions must be met for at least 5 minutes for the trigger to activate


    Other info which may be useful to know:
    - Mission uses latest ACE version
    - JIP allowed
    - Mission uses simple vehicle respawn script for all vehicles
    - Mission uses "base" respawn for players
    - ACE wounding sys module is on

  2. #2
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    Search for isKindOf, typeOf, getDammage, on
    http://community.bistudio.com/wiki/A...:_Actions_List
    and it will probably be easier to do it in a script run from trigger instead of using the init line.
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  3. #3
    I don't if/how you can check for damage to a specific part, so I used just a overall damage check.

    Code:
    {_x iskindof "T90" && damage _x < 0.8 && ({_x iskindof "RU_Soldier_Crew" && alive _x} count crew _x >= 2)} count thislist >= 2

  4. #4
    Gunnery Sergeant bhaz's Avatar
    Join Date
    Jun 14 2006
    Location
    Perth, Western Australia
    Posts
    493
    Perhaps a combination of canMove to check the tracks / engine and canFire for the turrets?

    |-LATEST MISSION-|: CO 02 Insertion |-COMING SOON-|: Foxtrot 2 (Co-op campaign)

  5. #5
    True true...

    Code:
    {_x iskindof "T90" && canmove _x && canfire _x && ({_x iskindof "RU_Soldier_Crew" && alive _x} count crew _x >= 2)} count thislist >= 2

  6. #6
    Quote Originally Posted by shk View Post
    True true...

    Code:
    {_x iskindof "T90" && canmove _x && canfire _x && ({_x iskindof "RU_Soldier_Crew" && alive _x} count crew _x >= 2)} count thislist >= 2
    Tx for the response guys.
    I tried this code in the trig and it works on my SP editor, but im wondering , will this work when playing with 70 people on a dedi as well? And what about locality and JIP?

    And will this code work on 3 other similar trigger zones simultanously as well? Will the condition checks not lag the server?
    Last edited by Dutch; Jan 9 2011 at 13:56.

  7. #7
    It's just a trigger, so it's affected by same rules as any other. All triggers are local, which should be taken into account with JIP. I'd advice you to create the trigger only on the server with createTrigger command (or make a script loop to check the zones). Obviously, the checks will tax the server a certain amount, but if you need it checked, then it needs to be done, way or the other. It's not related to anything, so you can have any number of them.

  8. #8
    Quote Originally Posted by shk View Post
    It's just a trigger, so it's affected by same rules as any other. All triggers are local, which should be taken into account with JIP. I'd advice you to create the trigger only on the server with createTrigger command (or make a script loop to check the zones). Obviously, the checks will tax the server a certain amount, but if you need it checked, then it needs to be done, way or the other. It's not related to anything, so you can have any number of them.
    Ok lets say i go for creating the trigger on server ( i assume this makes the function/trigger global?).

    I was thinking entering something like this to create the trigger, but how/where do i do that?
    Code:
     
    red1zone=createTrigger["SomeObject",getPos red1mark];
    red1zone setTriggerArea[150,150,0,false];
    red1zone setTriggerActivation["OPFOR","PRESENT",true];
    red1zone setTriggerStatements["{_x iskindof "T90" && canmove _x && canfire _x && ({_x iskindof "RU_Soldier_Crew" && alive _x} count crew _x >= 2)} count thislist >= 2", "red1done=1", "red1done=0"];
    red1zone setTriggerTimeout [300, 300, 300, true ]
    Last edited by Dutch; Jan 9 2011 at 16:10.

  9. #9
    Gunnery Sergeant bhaz's Avatar
    Join Date
    Jun 14 2006
    Location
    Perth, Western Australia
    Posts
    493
    The simple route would be in init.sqf:

    Code:
    if (isServer) then {
       red1zone = createTrigger ["SomeObject", getPos red1mark];
       red1zone setTriggerArea [150, 150, 0, false];
       red1zone setTriggerActivation ["OPFOR", "PRESENT", true];
       red1zone setTriggerStatements ["{_x iskindof 'T90' && canmove _x && canfire _x && ({_x iskindof 'RU_Soldier_Crew' && alive _x} count crew _x >= 2)} count thislist >= 2", "red1done=1", "red1done=0"];
       red1zone setTriggerTimeout [300, 300, 300, true];
    };
    BTW, use single quotes when inside of double quotes, or the engine will shit bricks. I changed it above.
    Last edited by bhaz; Jan 10 2011 at 03:08.

  10. #10
    Quote Originally Posted by bhaz View Post
    The simple route would be in init.sqf
    Ok, i tried this and tested it both SP editor and on new created MP session on my comp but both tests failed.
    The new trigger was not created or was not working. Any idea what could be wrong?

    This is my init.sqf.
    - Red1 is how i intend the created trigger to be named.
    - Red1marker is a ellipse marker placed on map via editor.

    Code:
    setViewDistance 4000;
    enableSaving [false, false];
    
    if (isServer) then {
       red1 = createTrigger ["EmptyDetector", getMarkerPos "red1marker"];
       red1 setTriggerArea [100, 80, 0, false];
       red1 setTriggerActivation ["OPFOR", "PRESENT", true];
       red1 setTriggerType "SWITCH";
       red1 setTriggerText "text on";
       red1 setTriggerStatements ["{_x iskindof 'T90' && canmove _x && canfire _x && ({_x iskindof 'RU_Soldier_Crew' && alive _x} count crew _x >= 2)} count thislist >= 2", "red1done=1, hint 'red1 is on',red1marker setMarkerBrush 'SOLID'", "red1done=0, hint 'red1 is off',red1marker setMarkerBrush 'Border'"];
       red1 setTriggerTimeout [10, 10, 10, true];
    };
    
    waitUntil {alive player};
    player addEventHandler ["Killed", {[_this select 0] spawn {hideBody (_this select 0)}}];

Page 1 of 2 12 LastLast

Posting Permissions

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