Jump to content

stuguy

Member
  • Content Count

    102
  • Joined

  • Last visited

  • Medals

Community Reputation

15 Good

About stuguy

  • Rank
    Sergeant

core_pfieldgroups_3

  • Interests
    Hockey, Music
  • Occupation
    Network Administrator

Contact Methods

  • Skype
    stuguy909
  • Biography
    I am a career system engineer with US military experience, US private sector IT experience, and I now manage my own IT company in Japan. Collectively, I have been in the IT field of over 14 years. I also attended University and worked towards a Computer Information Science degree, or programming, though I didn't attend my senior year. I love to code as a hobby, and often do small projects for small businesses. I mostly consult oil companies back in the USA with their seismic acquisition systems operating on Linux.
  • Google+
    stuguy909@gmail.com
  • Linkedin
    stuart-anderson-23a3312

Profile Information

  • Gender
    Male
  • Location
    Okinawa, Japan
  • Interests
    American Football, baseball, computer programming, Geo-politics, history, philosophy, astronomy, chemistry, martial-arts.
  1. support ticket created: https://feedback.bistudio.com/T123456 just realized it is ticket 123456...
  2. So nobody can explain why children aren't closing out with parents then?
  3. Just good practice when scripting in SQF to use semicolons after each command in your then {}; block. Also close out the then block with the semi colon. if (condition) then {command1; command2;}; if (condition) then {command1; command2;} else {command3;}; if (condition) exitWith {command1;}; I use isEqualTo instead of == so I can use the script in multiplayer.
  4. That's what I gathered so far. Though the documentation says otherwise.
  5. I made a work around, though I am still not sure why my child tasks will not clear automatically when I set the parent to succeed. I created a trigger that activates when the Connors character joins my group. The trigger then executes this command to clean up the mission a bit: {if (_x find "rand_ally" isEqualto 0) then {deleteMarker _x;};} forEach allMapMarkers; {if (taskDescription _x find "Search location for Connors" isEqualto 1) then{_x setTaskState "Succeeded"; player removeSimpleTask _x;};}forEach simpleTasks player; task04 setTaskState "Succeeded"; I manually succeed and remove all of the child tasks that have the "Search location for Connors" string so the task list isn't populated with redundant child tasks that aren't relevant anymore. They are indeed child tasks, so I am still curious why they do not complete with the parent?
  6. @serena I read Lou Montana's entry, hence I came to the forum and asked if there was something amiss with how I was scripting my tasks. When I succeed the parent, the remaining children (and cancelled ones) should also succeed, but they aren't. If I am not doing something goofy, I will make a bug report. Who knows, it could be a mod that I am using or something? I appreciate you submitting a code, but it doesn't work because you forgot semicolons and a few other things. You also need to use isEqualTo instead of ==.
  7. //A trigger in mission editor activates startingIslandTasks myCreateTask2 = { params ["_unit", "_pos", "_name", "_desc", "_brief","_task"]; _newTask = _unit createSimpleTask [_name,_task]; _newTask setSimpleTaskDescription [_desc, _brief, _name]; _newTask setSimpleTaskDestination (_pos); _newTask setTaskState "CREATED"; _newTask; }; myCreateTask3 = { params ["_unit", "_name", "_desc", "_brief"]; _task = _unit createSimpleTask [_name]; _task setSimpleTaskDescription [_desc, _brief, _name]; _task setTaskState "CREATED"; _task; }; //A trigger in mission editor activates startingIslandTasks startingIslandTasks = { "rand_ally1" setMarkerAlpha 1; "rand_ally2" setMarkerAlpha 1; "rand_ally3" setMarkerAlpha 1; "rand_ally4" setMarkerAlpha 1; "rand_ally5" setMarkerAlpha 1; "rand_ally6" setMarkerAlpha 1; "rand_ally7" setMarkerAlpha 1; task02 = [player, getMarkerpos "tuvanaka_radio", "Reconnoitre GSM Station.", "Reconnoitre the GSM radio broadcasting station. Gather any possible intelligence about the facility or island. If possible, sequester the station and recruit any personnel willing to fight against the QDA. Should the facility be under QDA protection, it is recommended that you do not engage in hostilities until you comprehend the full capability of the local QDA forces.", "Reconnoitre GSM Station.",taskEnd] call myCreateTask2; task03 = [player, getMarkerpos "tuvanaka_comms", "Reconnoitre Comms Whiskey", "Reconnoitre the Comms Whiskey military broadcasting station. This station is likely the hub for all local military short range radio communications. If possible, do not engage in open hostilities with the local QDA forces. It is highly likely that Dedrianna's generals will order reestablishment of communications at this facility should they be disrupted.", "Reconnoitre Comms Whiskey",taskEnd] call myCreateTask2; task04 = [player, "Find Michael Connors", "Search possible remote locations for insights to the whereabouts of Michael Connors.", "Find Michael Connors"] call myCreateTask3; task04a = [player, getMarkerpos "rand_ally1", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04b = [player, getMarkerpos "rand_ally2", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04c = [player, getMarkerpos "rand_ally3", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04d = [player, getMarkerpos "rand_ally4", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04e = [player, getMarkerpos "rand_ally5", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04f = [player, getMarkerpos "rand_ally6", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task04g = [player, getMarkerpos "rand_ally7", "Search location for Connors", "Search this location for signs of Michael Connors.", "Search location for Connors", task04] call myCreateTask2; task05 = [player, getMarkerpos "tuvanaka_afb", "Capture Tuvanaka AB", "Capture and hold the Tuvanaka air base. Holding this location will allow me to bring in equipment and mercenaries and make reinforcing the opposition more logistically complicated. I should not attack this facility head on, it is highly likely that the entirety of the QDA forces on this island are stationed here. I should have a full understanding of what I am up against before blindly assaulting a heavily gaurded air base.", "Capture Tuvanaka AB",taskEnd] call myCreateTask2; task06 = [player, getMarkerpos "Tuvanaka", "Capture the harbor city Tuvanaka", "Capture and hold the harbor city of Tuvanaka. This harbor is the second pier location in which supplies may be shipped to the island by sea. By holding this region, I may launch small boats, assault craft, landing vessels, and ferry troops and vehicles to other harbor locations that I own. By removing this city from the hands of the QDA, I can prevent my enemy from ferrying over heavy armor. The size and scope of the military presence located in Tuvanaka is unknown. It is likely to be gaurded by a security detail originating from Tuvanaka AB. Should the city fall into my hands, I can expect enemy forces to make an attempt to take it back.", "Capture the harbor city Tuvanaka",taskEnd] call myCreateTask2; task07 = [player, getMarkerpos "tuv_hosp", "Reconnoitre the Tuvanaka hospital.", "The Tuvanaka hospital is likely to be a great location to requisition medical supplies and expertise should I be unable to outsource. According to my intel, this private general hospital has working generators, an ER, clean water, and sanitation. Perhaps not the most advanced hospital in the world, they should be able to pry a bullet or two from your rear end in a pinch.", "Reconnoitre the Tuvanaka hospital.",taskEnd] call myCreateTask2; }; //A trigger in mission editor activates startingIslandTasks
  8. I scripted a bunch of child tasks to go inside of a parent task. In this case, I have 7 locations that a unit may randomly spawn in and if the player finds him, the parent succeeds. If the location is empty when the player arrives, the child cancels out so the task WP isn't there. I would just love it if the left over child tasks complete with the parent when I find the unit. And yes, I succeed the parent and the parent task is crossed out, but the children are wide open and ready to go still. Are there any particulars about parent and child tasks that I may not be in the BIS wiki? If you see this Image, my tasks are listing as children.
  9. That's why I always use unique variables or I select units or vehicles through logic.
  10. stuguy

    How to create a custom squad?

    edit: I haven't been giving you solid programs. So I checked all of my work and made you a script that does work, assuming the BIS randomizer doesn't give the unit an armor that isn't large enough for the loadout, in that case, make the randomizer false. _reconGroups = []; _reconGroups resize 4; _reconGroups = _reconGroups apply {[grpNull]}; fn_myMarker = { _marker = []; _num = floor random 9; hint str _num; switch (_num) do{ case 1: {_marker = getMarkerPos "p1_1";}; case 2: {_marker = getMarkerPos "p1_2";}; case 3: {_marker = getMarkerPos "p1_3";}; case 4: {_marker = getMarkerPos "p1_4";}; case 5: {_marker = getMarkerPos "p1_5";}; case 6: {_marker = getMarkerPos "p1_6";}; case 7: {_marker = getMarkerPos "p1_7";}; case 8: {_marker = getMarkerPos "p1_8";}; case 9: {_marker = getMarkerPos "p1_9";}; }; _marker; }; { _x = createGroup east; _marker = call fn_myMarker; _unit1 = _x createUnit [ "O_T_Recon_M_F", _marker, [], 0, "NONE" ]; [_unit1] joinSilent _x; _unit1 setVariable ["BIS_enableRandomization", true]; _unit1 setRank "SERGEANT"; comment "Exported from Arsenal by stuguy"; comment "Remove existing items"; removeAllWeapons _unit1; removeAllItems _unit1; removeAllAssignedItems _unit1; removeUniform _unit1; removeVest _unit1; removeBackpack _unit1; removeHeadgear _unit1; removeGoggles _unit1; comment "Add containers"; _unit1 forceAddUniform "U_O_CombatUniform_ocamo"; _unit1 addItemToUniform "FirstAidKit"; for "_i" from 1 to 2 do {_unit1 addItemToUniform "30Rnd_65x39_caseless_green";}; _unit1 addVest "V_TacVest_khk"; _unit1 addItemToVest "30Rnd_65x39_caseless_green"; for "_i" from 1 to 2 do {_unit1 addItemToVest "30Rnd_65x39_caseless_green_mag_Tracer";}; for "_i" from 1 to 2 do {_unit1 addItemToVest "16Rnd_9x21_Mag";}; for "_i" from 1 to 2 do {_unit1 addItemToVest "HandGrenade";}; for "_i" from 1 to 2 do {_unit1 addItemToVest "O_IR_Grenade";}; _unit1 addItemToVest "SmokeShell"; _unit1 addItemToVest "SmokeShellRed"; _unit1 addItemToVest "SmokeShellOrange"; _unit1 addItemToVest "SmokeShellYellow"; for "_i" from 1 to 2 do {_unit1 addItemToVest "Chemlight_red";}; _unit1 addHeadgear "H_HelmetLeaderO_ocamo"; comment "Add weapons"; _unit1 addWeapon "arifle_Katiba_F"; _unit1 addPrimaryWeaponItem "acc_pointer_IR"; _unit1 addPrimaryWeaponItem "optic_Arco_blk_F"; _unit1 addWeapon "hgun_Rook40_F"; _unit1 addWeapon "Binocular"; comment "Add items"; _unit1 linkItem "ItemMap"; _unit1 linkItem "ItemCompass"; _unit1 linkItem "ItemWatch"; _unit1 linkItem "ItemRadio"; _unit1 linkItem "ItemGPS"; _unit1 linkItem "NVGoggles_OPFOR"; _unit2 = _x createUnit [ "O_T_Recon_M_F", _marker, [], 0, "NONE" ]; [_unit2] joinSilent _x; _unit2 setVariable ["BIS_enableRandomization", true]; _unit2 setRank "CORPORAL"; removeAllWeapons _unit2; removeAllItems _unit2; removeAllAssignedItems _unit2; removeUniform _unit2; removeVest _unit2; removeBackpack _unit2; removeHeadgear _unit2; removeGoggles _unit2; _unit2 forceAddUniform "U_O_CombatUniform_ocamo"; _unit2 addItemToUniform "FirstAidKit"; for "_i" from 1 to 2 do {_unit2 addItemToUniform "30Rnd_65x39_caseless_green";}; _unit2 addVest "V_HarnessO_brn"; for "_i" from 1 to 3 do {_unit2 addItemToVest "30Rnd_65x39_caseless_green";}; for "_i" from 1 to 2 do {_unit2 addItemToVest "16Rnd_9x21_Mag";}; for "_i" from 1 to 2 do {_unit2 addItemToVest "HandGrenade";}; _unit2 addItemToVest "SmokeShell"; _unit2 addItemToVest "SmokeShellRed"; _unit2 addItemToVest "SmokeShellOrange"; _unit2 addItemToVest "SmokeShellYellow"; for "_i" from 1 to 2 do {_unit2 addItemToVest "Chemlight_red";}; _unit2 addBackpack "B_FieldPack_cbr_Repair"; for "_i" from 1 to 2 do {_unit2 addItemToBackpack "ToolKit";}; _unit2 addHeadgear "H_HelmetO_ocamo"; _unit2 addWeapon "arifle_Katiba_C_F"; _unit2 addPrimaryWeaponItem "acc_pointer_IR"; _unit2 addPrimaryWeaponItem "optic_ACO_grn"; _unit2 addWeapon "hgun_Rook40_F"; _unit2 linkItem "ItemMap"; _unit2 linkItem "ItemCompass"; _unit2 linkItem "ItemWatch"; _unit2 linkItem "ItemRadio"; _unit2 linkItem "NVGoggles_OPFOR"; _unit3 = _x createUnit [ "O_T_Recon_M_F", _marker, [], 0, "NONE" ]; [_unit3] joinSilent _x; _unit3 setVariable ["BIS_enableRandomization", true]; _unit3 setRank "PRIVATE"; removeAllWeapons _unit3; removeAllItems _unit3; removeAllAssignedItems _unit3; removeUniform _unit3; removeVest _unit3; removeBackpack _unit3; removeHeadgear _unit3; removeGoggles _unit3; _unit3 forceAddUniform "U_O_CombatUniform_ocamo"; _unit3 addItemToUniform "FirstAidKit"; _unit3 addItemToUniform "ACE_Clacker"; _unit3 addItemToUniform "ACE_DefusalKit"; _unit3 addItemToUniform "30Rnd_65x39_caseless_green"; for "_i" from 1 to 2 do {_unit3 addItemToUniform "Chemlight_red";}; _unit3 addItemToUniform "HandGrenade"; _unit3 addVest "V_TacVest_khk"; for "_i" from 1 to 4 do {_unit3 addItemToVest "30Rnd_65x39_caseless_green";}; for "_i" from 1 to 2 do {_unit3 addItemToVest "16Rnd_9x21_Mag";}; for "_i" from 1 to 3 do {_unit3 addItemToVest "APERSMine_Range_Mag";}; _unit3 addItemToVest "HandGrenade"; _unit3 addItemToVest "SmokeShell"; _unit3 addItemToVest "SmokeShellRed"; _unit3 addBackpack "B_Carryall_ocamo_Exp"; for "_i" from 1 to 2 do {_unit3 addItemToBackpack "MineDetector";}; for "_i" from 1 to 6 do {_unit3 addItemToBackpack "APERSBoundingMine_Range_Mag";}; for "_i" from 1 to 4 do {_unit3 addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";}; for "_i" from 1 to 3 do {_unit3 addItemToBackpack "SLAMDirectionalMine_Wire_Mag";}; _unit3 addItemToBackpack "DemoCharge_Remote_Mag"; _unit3 addHeadgear "H_HelmetO_ocamo"; _unit3 addWeapon "arifle_Katiba_C_F"; _unit3 addPrimaryWeaponItem "acc_pointer_IR"; _unit3 addPrimaryWeaponItem "optic_ACO_grn"; _unit3 addWeapon "hgun_Rook40_F"; _unit3 linkItem "ItemMap"; _unit3 linkItem "ItemCompass"; _unit3 linkItem "ItemWatch"; _unit3 linkItem "ItemRadio"; _unit3 linkItem "NVGoggles_OPFOR"; _unit4 = _x createUnit [ "O_T_Recon_M_F", _marker, [], 0, "NONE" ]; [_unit4] joinSilent _x; _unit4 setVariable ["BIS_enableRandomization", true]; _unit4 setRank "PRIVATE"; removeAllWeapons _unit4; removeAllItems _unit4; removeAllAssignedItems _unit4; removeUniform _unit4; removeVest _unit4; removeBackpack _unit4; removeHeadgear _unit4; removeGoggles _unit4; _unit4 forceAddUniform "U_O_CombatUniform_ocamo"; _unit4 addItemToUniform "FirstAidKit"; for "_i" from 1 to 2 do {_unit4 addItemToUniform "30Rnd_65x39_caseless_green";}; _unit4 addVest "V_TacVest_khk"; for "_i" from 1 to 3 do {_unit4 addItemToVest "30Rnd_65x39_caseless_green";}; for "_i" from 1 to 2 do {_unit4 addItemToVest "16Rnd_9x21_Mag";}; _unit4 addItemToVest "SmokeShell"; _unit4 addItemToVest "SmokeShellRed"; _unit4 addItemToVest "SmokeShellOrange"; _unit4 addItemToVest "SmokeShellYellow"; for "_i" from 1 to 2 do {_unit4 addItemToVest "Chemlight_red";}; _unit4 addBackpack "B_FieldPack_ocamo_Medic"; for "_i" from 1 to 2 do {_unit4 addItemToBackpack "Medikit";}; for "_i" from 1 to 20 do {_unit4 addItemToBackpack "FirstAidKit";}; _unit4 addHeadgear "H_HelmetO_ocamo"; _unit4 addWeapon "arifle_Katiba_F"; _unit4 addPrimaryWeaponItem "acc_pointer_IR"; _unit4 addWeapon "hgun_Rook40_F"; _unit4 linkItem "ItemMap"; _unit4 linkItem "ItemCompass"; _unit4 linkItem "ItemWatch"; _unit4 linkItem "ItemRadio"; _unit4 linkItem "NVGoggles_OPFOR"; [_x,_marker, 100] call BIS_fnc_taskPatrol; //_reconGroups set [_forEachIndex, _grp]; }forEach _reconGroups; This function creates four squads of 4 and randomly places them to waypoints. Below this post is a link for the full mission file to show how this works. It sometimes throws errors because too many man spawn on top of each other at one spot, or the loadouts prevent the unit equipment settings from firing off. This can be fixed by playing with the unit creation settings to spread them out a bit and setting "BIS_enableRandomization", false. This script was just an example on how to quickly make 4 dudes in 4 recon teams and randomize their patrols and spawn locations. Tweak it to fit your needs.
  11. stuguy

    How to create a custom squad?

    fn_setPatrol = { params ["_reconsquad"]; _RandomPatrol = ""; switch (floor random 6) do{ case 1: {_RandomPatrol = [_reconsquad, getMarkerPos "ANOTHERLOC0", 2000] call BIS_fnc_taskPatrol;}; case 2: {_RandomPatrol = [_reconsquad, getMarkerPos "ANOTHERLOC1", 2000] call BIS_fnc_taskPatrol;}; case 3: {_RandomPatrol = [_reconsquad, getMarkerPos "ANOTHERLOC2", 2000] call BIS_fnc_taskPatrol;}; case 4: {_RandomPatrol = [_reconsquad, getMarkerPos "ANOTHERLOC3", 2000] call BIS_fnc_taskPatrol;}; case 5: {_RandomPatrol = [_reconsquad, getMarkerPos "ANOTHERLOC4", 2000] call BIS_fnc_taskPatrol;}; default : {_RandomPatrol = [_reconsquad, getMarkerPos "MAINAOLOC", 2000] call BIS_fnc_taskPatrol;}; }; _RandomPatrol; }; edited to turn into a function that accepts a group.
  12. stuguy

    Custom keys to activate scripts

    yes. Player key binds are not broadcasted to the server. Only resulting actions that are specifically broadcast to the server are not local.
  13. stuguy

    How to create a custom squad?

    This is what I usually did back in the day. In the mission editor, I created a bunch of dot markers and set the transparency to 0%. I then named the marker stuff like, p1_1, and copied it a bunch of times, making p1_2, p1_3, etc. I copied them into waypoint positions that I wanted my patrols to go to. For each new "random" patrol, I would add 1 to the p, IE, p2_1. Eventually, I would have like 11 or 12 possible p#_# routes. Then in my script, I have a switch do statement with random in my condition. I would have random pick a number between 1 and the total number of my patrols. That switch statement would then assign the markers as waypoint positions for my patrol. edit: I also reused a lot of patrol points for other patrols. I made sure vehicle waypoints went into intersections and major road hubs. I would name particularly important waypoints, like intersections in populated areas, uniquely. IE: townName_intersection_1. I also added invisible markers for AI helicopter landing zones and regroup positions. So I would have triggers that would send special forces or counter attacks to certain waypoints if the player was detected in a certain spot, or if certain mission parameters became true. edit2: getMarkerPos: https://community.bistudio.com/wiki/getMarkerPos
×