Jump to content

shuko

Member
  • Content Count

    2231
  • Joined

  • Last visited

  • Medals

Everything posted by shuko

  1. This is a random position generator/selector. It can choose a position from a marker area or by based on direction and distance from a position/object. 2021 update, reuploaded after billion years: https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Arma 2 thread Marker Based Selection Required Parameters: 0 String Area marker's name. Optional Parameters: 1 Number Water position. Default is only land positions allowed. 0 Find closest land. Search outwards 360 degrees (20 degree steps) and 20m steps. 1 Allow water positions. 2 Find only water positions. 2 Array or String One or multiple blacklist area markers which are excluded from the main marker area. 3 Array, Number, Object or Vehicle Type Force finding large enough empty position. 0 Max range from the selection position to look for empty space. Default is 200. 1 Vehicle or vehicle type to fit into an empty space. Examples: [...,[300,heli]] Array with distance and vehicle object. [...,350] Only distance given [...,(typeof heli)] Only vehicle type given [...,heli] Only vehicle object given Position Based Selection Required Parameters: 0 Object or Position Anchor point from where the relative position is calculated from. 1 Array or Number Distance from anchor. Optional Parameters: 2 Array of Number Direction from anchor. Default is random between 0 and 360. 3 Number Water position. Default is only land positions allowed. 0 Find closest land. Search outwards 360 degrees (20 degree steps) and 20m steps. 1 Allow water positions. 2 Find only water positions. 4 Array Road positions. 0 Number Road position forcing. Default is 0. 0 Do not search for road positions. 1 Find closest road position. Return the generated random position if none found. 2 Find closest road position. Return empty array if none found. 1 Number Road search range. Default is 200m. 5 Array, Number, Object or Vehicle Type Force finding large enough empty position. 0 Max range from the selection position to look for empty space. Default is 200. 1 Vehicle or vehicle type to fit into an empty space. Examples: [...,[300,heli]] Array with distance and vehicle object. [...,350] Only distance given [...,(typeof heli)] Only vehicle type given [...,heli] Only vehicle object given Usage Preprocess the file in init.sqf: call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; Actually getting the position: pos = [parameters] call SHK_pos;
  2. I wanted to spawn enemies in front of the player group. How to get the right direction and thus position? Using the built-in "getDir" command would be simple, but what if you happen to use it when the group leader has turned around to check up on his group? Then you would be spawning enemies in completely wrong direction. This script will tracking a group and record it's positions in given interval. You can call the function any time to get the average direction, aka a guesstimate/overall direction where the group to heading to. Starting Tracking Required Parameters: 0 Group/Object Group to track. Optional Parameters: 1 Number Recording interval, delay in seconds between position checks. 2 Number History size, number of newest positions to remember. Starting Examples: nul = dude1 execvm "SHK_intercept.sqf"; nul = grpWest1 execvm "SHK_intercept.sqf"; nul = [dude2,5,20] execvm "SHK_intercept.sqf"; Getting the Direction Function's name is SHK_intercept_getDir. It takes an object or a group as a parameter and returns a direction between 0 and 360. Required Parameters: 0 Group/Object Group to track. Optional Parameters: 1 Number Position info age when calculating direction. Given number is the Nth newest position to compare the current position. Example: positions are [a,b,c,d,e,f,g], you give 3 as info age. The position to be used for direction calculation is e. Float Range 0-1, which is applied to the size of the history. Example: size is 10 and age is 0.5, the dir will be calculated from the 5th position in the history. Or 0.2, the position would be 9th (2nd newest). 2 Number Sample size. Number of positions between newest and the one determined by info age, which is included in the average calculation as well. Examples: dir = grpWest1 call SHK_intercept_getDir; dir = [grpWest1,0.3] call SHK_intercept_getDir; dir = [grpWest1,10,5] call SHK_intercept_getDir; 2021 reupload https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  3. As I'm not going to update the Arma 2 version, and it seems this script might work on A3 with minor changes, I'll post it here so we can work on it together. zuff and cuel already made some fixes for the hint notification in the A2 thread. I've included those in the version posted here. Disclaimer: I still don't have time or motivation for the game. So, I have not tested this script in A3 myself. However, I will do my best to make this work if there are bugs/changes needed. Features: - The script is server driven; all task additions and updates are called on server side. All changes are broadcasted to players in one array variable. This enables more work to be done only on server, since most of AI-related things happen there anyway. This way the number of triggers placed goes down, as they are unnecessary for clients (players). Number of publicvariabled variables goes down also. - Only one eventhandler is created instead of one per task. - As tasks are kept in an array, no global variable is created for each task. - No "call compile format" type of coding. - Variables used to check for task states and statuses are replaced with functions, cutting down number of global variables. - Usage simplified; briefings are easier to create, some parameters are made optional. Creating a briefing in init.sqf [[ ["Task1","Task1Title","Task1Desc"], ["Task2","Task2Title","Task2Desc",true,["markerTask2",getpos obj2]] ],[ ["Note1","Hello West",WEST], ["Note2","Hello East",EAST], ["Credits","Made by: Shuko of LDD Kyllikki<br />www.kyllikki.fi"] ]] execvm "shk_taskmaster.sqf"; Task Data ["TaskName","Title","Description",Condition,[Marker],"State",Destination] Required parameters: TaskName string Name used to refer to the task Title string Task name shown in the in/game task list Description string Task description, the actual text body Optional parameters: Condition boolean/side/faction/unit/group/string/array Units the task is added to. Default is everyone Marker array Marker related to the task. It will be created only for the units who have the task. Marker will be hidden after task is completed. Can be an array of marker arrays, if you want to create multiple markers. Name string Name of the marker to create. Position string Position of the marker. Type string Marker type. Optional, default is "selector_selectedMission". Color string Marker color. Optional, default is red. State string Task state of the newly created task. Default is "created". Destination object/position/marker Place to create task destination (game's built-in waypoint/marker). If an object is given, setSimpleTaskTarget command is used, attaching the destination to it. Shape string Marker shape: Icon, Ellipse, Rectangle Size number or array Marker size. If number given, it's used for both X and Y dimension. Condition (limiting the units to who the tasks and notes are created) Examples: [...,WEST] All playable units on BLUFOR (WEST) [...,"USMC"] Faction USMC [...,grpMarine1] Units that belong to group named grpMarine1 [...,myDude] Unit named myDude Then there is the IF syntax, so you can create a condition anyway you want, where _x is the unit (=player). Examples: "((group _x == grpScouts) OR (_x == pilot1))" Members of grpScouts and unit named pilot1 "(typeof _x == ""CDF_Soldier_Sniper"")" All CDF snipers TaskState The task state of the newly created task. Valid states are succeeded, failed, canceled and assigned. Default is assigned. Note Data [NoteTitle,NoteText,Condition] Required parameters: NoteTitle string Text shown in the list NoteText string The actual note text body Optional parameters: Condition boolean/side/faction/unit/group/string Units the note is added to. Default is everyone. Updating tasks Task states are updated by calling a function. Possible states are: succeeded/failed/assigned/canceled. Example: ["Task1","succeeded"] call SHK_Taskmaster_upd; It's possible to set state of one task and set another as assigned using an optional 3rd parameter. Example: ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd; This will make task state of task Task1 to succeeded and the state of the task Task2 as current. Another optional 3rd parameter can be used to add a new task after updating another task. Example: ["Task1","succeeded",["Task2","Title","Desc"]] call SHK_Taskmaster_upd; This will make task Task1 as succeeded and create a new task Task2. Same set of parameters is used for the creation as in init.sqf or SHK_Taskmaster_add. Creating tasks during a mission Tasks can be added after briefing with the add function. Same set of parameters is used as in creating a briefing. The new task is set as current task automatically. Example: ["Task2","Extraction","Get to teh choppa!"] call SHK_Taskmaster_add; Functions SHK_Taskmaster_isCompleted This function can be used to check if task(s) is completed. Task is considered completed with states succeeded, failed and canceled. Function returns a boolean (true/false) value. Example: "Task1" call SHK_Taskmaster_isCompleted Multple task example: ["Task1","Task2"] call SHK_Taskmaster_isCompleted SHK_Taskmaster_areCompleted Same as above, but only takes an array as parameter. SHK_Taskmaster_getAssigned Returns list of tasks which have "assigned" as their state. Example: call SHK_Taskmaster_getAssigned Example result: ["Task1","Task4"] SHK_Taskmaster_getState Returns the task state (succeeded/failed/canceled/assigned/created). Example: "Task1" call SHK_Taskmaster_getState SHK_Taskmaster_hasState Checks if a task's state matches the given state. Function returns a boolean value. Example: ["Task1","succeeded"] call SHK_Taskmaster_hasState SHK_Taskmaster_hasTask Checks if a task with the given name has been created. Returns boolean. Example: "Task1" call SHK_Taskmaster_hasTask SHK_Taskmaster_setCurrentLocal Sets the given task as the current task. Example: "Task1" call SHK_Taskmaster_setCurrentLocal Multiplayer Example: ["Task1","SHK_Taskmaster_setCurrentLocal",true,true] call BIS_fnc_MP SHK_Taskmaster_addNote (client side only) Creates a briefing note. This can only be used on client side, and it's not boardcasted for other players. Parameters: ["Title","TextBody",Condition], Condition is optional. Example: ["Enemy forces","Oh noes, there will be enemy soldiers in the area of operation."] call SHK_Taskmaster_addNote Files 2021 reupload https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  4. shuko

    SHK_Taskmaster

    Blast from the past. Reuploaded https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  5. I know there are dozen of different kinds of patrol related scripts available. I will still chip in with this simple one. It is based on BIN_taskPatrol for A2 by Binesi, which is based on BIS_fnc_taskPatrol. I have simplified it even further. The way I like to use it is to create a patrol group and then paste the execvm line into it's leader's init. Then copy-paste the whole group couple of times around the mission area. Simple and fast. The script will create waypoints in a circlish manner around the starting position of the group. Waypoints placement and count is based on the distance parameter; longer it is, the more WPs there will be. Normally the group will go clock-wise around them, but each WP has a chance to make the next WP random. Thus, creating some unpredictability. SHK_patrol.sqf /* Required Parameters: 0 Object or Group The patrolling unit Optional Parameters: 1 Number Distance from the unit's starting position to create waypoints. Default is 250. Usage: Start from group leader's init field or from init.sqf: nul = [params] execVM "shk_patrol.sqf"; Examples: nul = this execVM "shk_patrol.sqf"; nul = [this,350] execVM "shk_patrol.sqf"; nul = [grpA,300] execVM "shk_patrol.sqf"; */ 2021 reupload https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  6. shuko

    SHK_Patrol

    Blast from the past. Reuploaded https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  7. shuko

    SHK_intercept

    Blast from the past. Reuploaded https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  8. shuko

    SHK_pos

    Blast from the past. Reuploaded https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂
  9. I was looking for a fast-rope script to use in a mission. I found this thread. I used the script made by zealot111 as the base for my script. All credits should go to him for the basic idea. I just rewrote it to include a queue, and other small changes. The main goal, for me, was human player usage only, but the script will also rope down AI members of a group whose leader is human player. SHK_Fastrope.sqf Example mission Usage 1. Copy the script file into your mission folder 2. Open (or create) initPlayerLocal.sqf in your mission folder 3. Add this line into the file (no semi-colon at the end of the line): #include "SHK_Fastrope.sqf" Example using Ghost Hawk (chopper leaving after all units are on the ground is done by trigger, not by the script)
  10. Don't use the command player in dedi.
  11. shuko

    SHK_pos

    Interesting, I'm glad you figured it out and got it working.
  12. shuko

    SHK_pos

    I actually reinstalled Arma just to check this out. ;) Here's the test mission with those markers: https://www.dropbox.com/s/spdysewl5t0lydn/SHK_pos.Stratis.zip?dl=0
  13. shuko

    SHK_pos

    It seems you guys are trying to use the marker based search with the position/anchor based parameters. The 2nd parameter in anchor based search is the wanted distance from the origin/anchor, while on the marker based search the 2nd parameter is the water position. In other words, marker search wants a number 0, 1 or 2 and you are giving it an array (with the min/max distance).
  14. shuko

    SHK_Fastrope

    You can do whatever you want with the script. I doubt I will do anything more with it.
  15. This is a script I made a long ago to randomly pick positions: https://forums.bistudio.com/topic/153382-shk-pos/ You can specify the direction/angle and distance etc.
  16. shuko

    SHK_pos

    The script does not have an offset option in those cases. Basically, all the positions that are on the water's edge are usually positions which were originally in water and just moved to nearest land. One workaround is to be more careful/specific with the input parameters/input marker to manually avoid water.
  17. shuko

    SHK_Taskmaster

    You're the first person in over five years to ask for task delete. ;) I never even bothered with it, since all the missions I do/did were simple missions without respawn etc., so marking a task as cancelled was good enough. :)
  18. shuko

    SHK_Taskmaster

    They are not compatible with each other. It seems like BIS uses "BIS_fnc_taskVar_" tag in front of it's task names/variables. In a shot in the dark, you could give it a go by creating Taskmaster tasks with the name "BIS_fnc_taskVar_Task1" and then try BIS_delete task "Task1". I haven't tried it, and I'll give it 0.1% probability to work. ;)
  19. shuko

    SHK_Fastrope

    You can do whatever you want with it.
  20. The new commands are preferred. However, BIS_fnc_MP should work just fine, and it's changed/will be changed to use the new commands.
  21. I used Notepad++ for a long time. Now, I've tried out Visual Studio Code (yes, there's a plugin for SQF)
  22. shuko

    SHK_Fastrope

    Thanks! I included them to the next version, which I'll release if/when I get time and brains to fix the MP issue(s). Adding them to the current version should be easy enough for everyone.
  23. shuko

    SHK_pos

    Unfortunately the command findEmptyPosition does not accept size requirement in meters. Maybe you can find a vehicle that is big enough, and use it's type as the requirement.
  24. shuko

    SHK_Fastrope

    Which version are you using?
  25. shuko

    SHK_Fastrope

    Thanks for checking it through. However, the fastrope/queue up action is available only once. The action condition includes: !(player in (_heli getVariable ["SHK_Fastrope_Queue",[]]) Though, I have not personally tested how it works in practice in MP. In SP the action is removed like it should be.
×