Jump to content

Trickshot1994

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Trickshot1994

  • Rank
    Private First Class
  1. Trickshot1994

    Trigger to Disable AI

    I removed all code, mods and created a fresh scenario. Executed the code tog_ garrison script on 1 squad leader's init (instead of many in case it was contributing to the issue) and it was still giving me the error. For some reason, when _pos returns 0 and causes the issue. I think this may be a bug.
  2. Trickshot1994

    Trigger to Disable AI

    Gunter, I've implemented your code in a fresh scenario and it's working fine. However, when I try to do it in my existing scenario I get "Error undefined variable in expression _pos" (Line 110) What do you think could be causing this? I know I messed something up 😅 I should mention that I did what you said and put the nul = [this] execVM "tog_garrison.script"; in the group leader's init box.
  3. Trickshot1994

    Trigger to Disable AI

    Are you sure? When I checked your code I didn't see a script that would disable them from moving. The problem I have is that when I enter a location they all converge to my position. I want them in their buildings even if they're assaulted.
  4. Trickshot1994

    Trigger to Disable AI

    Thank you for your answer Pierremgi, it's really helpful. I perhaps should have mentioned this but I named the squad's variable name to alpha_1_1, alpha_1_2 to keep track of them while scripting. So I think those references are solid. However, you were correct in your statement that I should remove the <= in while { _i < count (_units)}. I will give your code a try and report back!
  5. Trickshot1994

    Trigger to Disable AI

    I have 15 units (each alpha references an entire unit not just one soldier) each one placed near a building. I want them all garrisoned with no one patrolling. I put this code in the init.sqf file but after a few successful garrisons I get the _ref undefined variable. if (isServer) then { sleep 1; _units = [alpha_1_1, alpha_1_2, alpha_1_3, alpha_1_4, alpha_1_5, alpha_1_6, alpha_2_1, alpha_2_2, alpha_2_3, alpha_2_4, alpha_2_5, alpha_2_6, alpha_3_1, alpha_3_2, alpha_3_3]; _i = 0; nul = []; while {_i <= count (_units)} do { sleep 2; _ref = _units select _i; {_x disableAI "PATH"} forEach units _ref; { nul = [_x,25,8,0,true] execVM "tog_garrison_script.sqf"} forEach units _ref; _i = _i + 1; }; }; What am I doing wrong?
  6. Trickshot1994

    LAMBS Improved Danger.fsm

    Hello, I have a particular issue with LAMBs AI task Garrison, it seems to be bugged. I did a few tests/ debugging to verify if there's actually an issue and here's what I found. For typical waypoints, once the A.I reaches the waypoint destination it's marked as complete and deletes itself. However, for LAMBS it: - Never deletes itself. I created an sqf file counting the number of waypoints for the squad leader and it never changed even after he and his squad successfully garrisoned. - Counts itself as complete before the destination is reached. As soon as the A.I starts to move, the waypoint's On Activation code is executed which is a mistake. My issue is that I'm trying to get the AI to do something after they garrison. I've attempted the following methods to get around these issues but nothing seems to work. I used triggers with various conditions count ( waypoints squad_leader 1 ), speed squad_leader1 == 0, waitUntil {unitReady squad_leader1}. I also tried a combination of all 3 along with triggers and custom made variables (bool variables that are set to false and become true when the condition is satisfied) but nothing seems to work. Can anyone suggest ideas to solve this particular issue? Any help would be greatly appreciated.
  7. Hello, I have a particular issue with LAMBs AI task Garrison, it seems to be bugged. I did a few tests/ debugging to verify if there's actually an issue and here's what I found. For typical waypoints, once the A.I reaches the waypoint destination it's marked as complete and deletes itself. However, for LAMBS it: - Never deletes itself. I created an sqf file counting the number of waypoints for the squad leader and it never changed even after he and his squad successfully garrisoned. - Counts itself as complete before the destination is reached. As soon as the A.I starts to move, the waypoint's On Activation code is executed which is a mistake. My issue is that I'm trying to get the AI to do something after they garrison. I've attempted the following methods to get around these issues but nothing seems to work. I used triggers with various conditions count ( waypoints squad_leader 1 ), speed squad_leader1 == 0, waitUntil {unitReady squad_leader1}. I also tried a combination of all 3 along with triggers and custom made variables (bool variables that are set to false and become true when the condition is satisfied) but nothing seems to work. Can anyone suggest ideas to solve this particular issue? Any help would be greatly appreciated.
  8. Trickshot1994

    Trigger to Disable AI

    Final solution Harzach was correct, I should use global variables by declaring activated instead of _activated. The trigger was not being accessed. Thank you Harzach! Now I had another issue which is that other parts of my code were also incorrect and were not being accessed. Here's the correct code: _i = 0; _units = [alpha_1_1, alpha_1_2, alpha_1_3, alpha_1_4]; while {_i <= count (_units) } do { _ref = _units select _i; {_x disableAI "MOVE"} forEach units _ref; _i = _i+1 ; }; Explanation: _units = the units I want selected. As long as _i is less than the number of elements in _units go through each element of the array _units (one by one) and put it in variable _ref. For the unit selected in variable _ref execute disableAI "MOVE" and specify that _ref contains a unit not a single soldier. increment _i each time you do this until you've gone through all 4 elements of _units. If anyone wants to amend my code (refactor) or provide a simpler/ more efficient way of doing this. Please let me know! I want to thank everyone who replied to this thread as they have all contributed a great deal to me reaching this solution.
  9. Trickshot1994

    Trigger to Disable AI

    Clarification: the reason I suspect that it's accessible throughout the mission.sqf file is because when you set a variable name (for example a trigger called trigger1) it's accessible by other objects in the file. If you initialize a variable called _activated in a group init, I believe it works similarily. Am I missing something?
  10. Trickshot1994

    Trigger to Disable AI

    Perhaps I'm mistaken but local variables are accessible all throughout mission.sqf right? Perhaps I'm mistaken though but it seems to be working here (tested it a couple of times/ unless there's a bug where it's working but shouldn't). P.S: I'm also very unfamiliar with how triggers are coded in the sqf files of the mission so perhaps I'm wrong. If someone could test this as well and let me know I'd welcome any feedback!
  11. Trickshot1994

    Trigger to Disable AI

    Thank you both for you replies! Gunther your code was of great help! It helped me understand the syntax and a few of the functions on Arma. Here's the code I used for anyone else running into this issue. I put this in the trigger activation box with a boolean variable called _activated as the trigger, the boolean variable is initiated as false in group composition init (alpha_1_1). _activated is set to true once they're done garrisoning: _i = 0; _units = [alpha_1_1, alpha_1_2, alpha_1_3, alpha_1_4]; while { i < count(_units) } do { _ref = _units select i; {_x disableAI "PATH"} forEach _ref; i = i+1; }
  12. Hello, I'm new to Arma 3 and its weird and crazy scripting language. I do have a background in computer programing in case it is relevant. I'm currently building a mission where I want the enemy AI (OPFOR) to garrison into the buildings and not move from their positions. I have given them the command to garrison (and they do it without a hitch). The issue I'm running into is that whenever someone (me) enters their territory they all leave their posts. I want them to stay in the buildings. I have created a trigger that is set off when they are all garrisoned (using a boolean variable that becomes true). The trigger has this in its "On Activation" box: _units = [alpha_1_1, alpha_1_2, alpha_1_3, alpha_1_4]; {_x disableAI "PATH"} forEach units group _units; //I have also tried _units = [alpha_1_1, alpha_1_2, alpha_1_3, alpha_1_4]; {_x disableAI "PATH"} forEach _units; each member of _units (alpha_1_1, alpha_1_2, etc...) is a whole group with at least 7 soldiers in it. The main problem with this is I get the error message "Type group expected Object." I'm not proficient enough with this scripting language, can someone tell me how to possibly get around this? Thank you! Any help would be greatly appreciated!
×