Jump to content
Knoxtheace

Trigger (Condition Help)

Recommended Posts

I am using the code below on the "Old Laptop (Open)". Source: http://simhq.com/forum/ubbthreads.php/topics/4224752/Having_fun_with_ACE_3.

 

This code in the Old Laptop init works great, however I have created a trigger for once the laptop is hacked for OPFOR units to move along a certain path to a location. I have already created the hold point for the OPFOR units and sync'd it with the trigger, trigger: activation set to "Skip Waypoint", but after laptop_hacked the units won't move. 

 

Could use some getting the opfor to move after "laptop_hacked". Thanks in advance.

 

laptop_hacked = false;  
laptop_linked = false;  
laptop_hacker = objNull; 

  this,  
  0,  
  ["ACE_MainActions"],  
  [ 
    "tech",  
    "Technology",  
    "",  
    {true},  
    {(!laptop_linked || !alive laptop_hacker) && !laptop_hacked} 
  ] call ace_interact_menu_fnc_createAction 
] call ace_interact_menu_fnc_addActionToObject; 

  this,  
  0,  
  ["ACE_MainActions", "tech"],  
  [ 
    "link_to_laptop",  
    "Link Hacking Device",  
    "",  
    { 
      laptop_hacker = _this select 1; 
      [laptop_hacker] call ace_common_fnc_goKneeling; 
      [laptop_hacker, "Acts_carFixingWheel"] call ace_common_fnc_doAnimation; 
      [ 
        10,  
        [],  
        { 
          hint format["Uplink Established."];  
          laptop_linked = true; 
          [ 
            laptop_hacker,  
            1,  
            ["ACE_SelfActions"],  
            [ 
              "tech",  
              "Technology",  
              "",  
              {true},  
              {laptop_linked && !laptop_hacked} 
            ] call ace_interact_menu_fnc_createAction 
          ] call ace_interact_menu_fnc_addActionToObject; 
          [ 
            laptop_hacker,  
            1,  
            ["ACE_SelfActions", "tech"],  
            [ 
              "hack_laptop",  
              "Hack Laptop",  
              "",  
              { 
                _hack_time = 120; 
                if ([laptop_hacker] call ace_common_fnc_isEngineer) then {_hack_time = _hack_time / 4}; 
                [ 
                  _hack_time,  
                  [],  
                  { 
                    hint format["Laptop Successfully Hacked."];  
                    laptop_hacked = true;  
                    laptop_linked = false; 
                  },  
                  { 
                    hint format["Uplink Failure."]; 
                    laptop_hacked = false;  
                    laptop_linked = true; 
                  },  
                  "Hacking Laptop..." 
                ] call ace_common_fnc_progressBar; 
              },  
              {!laptop_hacked && laptop_linked} 
            ] call ace_interact_menu_fnc_createAction 
          ] call ace_interact_menu_fnc_addActionToObject; 
        },  
        { 
          hint format["Uplink Failure."]; 
          laptop_linked = false; 
          laptop_hacker = objNull; 
        },  
        "Attaching Device..." 
      ] call ace_common_fnc_progressBar;  
    },  
    {(!laptop_linked || !alive laptop_hacker) && !laptop_hacked} 
  ] call ace_interact_menu_fnc_createAction 
] call ace_interact_menu_fnc_addActionToObject;

Share this post


Link to post
Share on other sites

what's your trigger activation condition?

Share this post


Link to post
Share on other sites

My trigger expression condition is laptop_hacked = true;

 

But when I use this it seems like it sets the value laptop_hacked = true rather than waiting for the condition to be true. I say this because my opfor units bypass the hold waypoint, and the return hints, "Uplink Failure", from the ace interaction code lead to this.

 

https://drive.google.com/file/d/1w7Prn0HGZc5_VMUabOpXKG39mDsMdRTp/view?usp=sharing

Share this post


Link to post
Share on other sites

Just put laptop_hacked without =true. BTW if you're planning to use it in mp it won't work as is, you have to make the variable public

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×