Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Looking for help on an advanced trigger condition code

  1. #11
    Expecting too much from a 10yo engine.

  2. #12
    Gunnery Sergeant bhaz's Avatar
    Join Date
    Jun 14 2006
    Location
    Perth, Western Australia
    Posts
    493
    Quote Originally Posted by Unit19 View Post
    Ok thanks.
    But wouldnt this result in the trigger being added up each time a player JIPs?
    Init only runs once for each machine, and for JIP - only on their machine. The clients will skip past the isServer section.
    As for the rest, I guess it's possible - but complicated way beyond belief, and an impossible amount of effort for one mission.

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

  3. #13
    Ok, ill take your advice on the Iserver code you provided earlier, sounds good

    As for the advanced conditions regarding the tanks, maybe i'd have to look in setfuel > # or setdamage <# instead to make it better accomplishable.
    But i expect that setdamage wont really work with ACE right? (armor system etc)

    Just fyi, the mission im building is meant to be a template for a new original PVP concept/serie. Once the website and project have been released i'll let you know.

  4. #14
    "if (fuel object != 0) then {...};" for "I still have some fuel left".

    damage object isn't working for vehicles in ACE. It always returns 0 when not totally destroyed, and 1 when completely destroyed (Say, hitting a tank multiple times to engine and wait until it is all black).

  5. #15
    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)}}];

  6. #16
    There is no "OPFOR" side, it's "EAST".

  7. #17
    I've been working on a scripted solution for this - I think I've finally cracked it. A fun puzzle to work on, definitely the most complicated thing I have written for ArmA so far

    Place a named trigger (e.g. tanktrigger1) to define the area to be captured, then from anywhere:

    PHP Code:
     nul = [tanktrigger1execvm "tankchecker.sqf"
    This is tankchecker.sqf:

    PHP Code:
    _trigger _this select 0;
    _trigger setVariable ["captured"falsetrue];

    while {
    true} do {
        
    scopename "tankchecker";
        if (({
    _x iskindof "T90" && canmove _x && canfire _x && ({_x iskindof "RU_Soldier_Crew" && alive _xcount crew _x >= 2)} count (list _trigger)) >= 2then {
            if !(
    _trigger getVariable "captured"then {
                
    _trigger setVariable ["time"timetrue];
                
    hint format ["Tanks began to capture %1",_trigger];    
                while {
    _timer = (time - (_trigger getVariable "time"));_timer 300} do {
                    if (({
    _x iskindof "T90" && canmove _x && canfire _x && ({_x iskindof "RU_Soldier_Crew" && alive _xcount crew _x >= 2)} count (list _trigger)) < 2then {
                        
    hint format ["Tanks failed to capture %1",_trigger];
                        
    breakTo "tankchecker";    
                    };    
                        
    sleep 5;
                };
                
    _trigger setVariable ["captured"truetrue];
                
    hint format ["%1 was captured after five minutes.",_trigger];
                
    breakTo "tankchecker";

            };

        } else {
            if (
    _trigger getVariable "captured"then {hint format ["%1 was lost.",_trigger];};
            
    _trigger setVariable ["captured"falsetrue];
            
    sleep 5;
            
    breakTo "tankchecker";
        };
    }; 

Page 2 of 2 FirstFirst 12

Posting Permissions

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