Jump to content

stuguy

Member
  • Content Count

    107
  • Joined

  • Last visited

  • Medals

Community Reputation

15 Good

About stuguy

  • Rank
    Sergeant

core_pfieldgroups_3

  • Interests
    Hockey, Music
  • Occupation
    Network Administrator

Contact Methods

  • Website URL
    https://www.tobupengin.com
  • Skype
    stuguy909
  • Biography
    I am a career system engineer with US military and private sector IT experience. I now manage my own software company in Japan. Collectively, I have been in the IT field for over 19 years. I write in Python, Javascript, C++, Java, C#, and Fortran. I use Linux, and partner with AWS.
  • Linkedin
    stuart-e-anderson

Profile Information

  • Gender
    Male
  • Location
    Japan
  • Interests
    American Football, baseball, computer programming, Geo-politics, history, philosophy, astronomy, chemistry, martial-arts.
  1. Overthrow 1.0.27 won't start on Reforger 0.9.7.61: Scripts/Game/GameMode/OVT_OverthrowGameMode.c(122): Overloading event 'OnPlayerDisconnected' is not allowed
  2. I more or less have a working solution now, but I'm still puzzled as to why: // creating the HC module from scratch _Group = createGroup (sideLogic); _Group_HC_C = _Group createUnit ["HighCommand", [0, 0, 0], [], 0, "NONE"]; _Group_HC_S = _Group createUnit ["HighCommandSubordinate", [0, 0, 0], [], 0, "NONE"]; player synchronizeObjectsAdd [_Group_HC_C]; _Group_HC_C synchronizeObjectsAdd [_Group_HC_S]; _grp = allGroups select {side _x == independent}; // get independent groups _grp = _grp - [group player]; // remove player group _g1 = (_grp select 0); // group 1 active //_g2 = (_grp select 1); // group 2 commented out leader _g1 synchronizeObjectsAdd [_Group_HC_S]; // added group to HC system via leader injection This can be used as a way to create High Command modules and groups for a unit, found similar on the forum. Note that we bind groups to the logic via the leader, similarly to syncing the leader to the module in the editor. BUT: Can't call up the logic from synchronizedObjects and bind new groups using the same setup. // recalling modules _Group_HC_C = synchronizedObjects player select { _x isKindOf "HighCommand" } select 0; _Group_HC_S = synchronizedObjects _Group_HC_C select { _x isKindOf "HighCommandSubordinate" } select 0; // The subordinate is already bound, so we skip that part... Yes? // _Group_HC_C synchronizeObjectsAdd [_Group_HC_S]; // The player is already bound to the HC module, so we skip that too... Yes? // player synchronizeObjectsAdd [_Group_HC_C]; _grp = allGroups select {side _x == independent}; // get independent groups _grp = _grp - [group player]; // remove player group //_g1 = (myside select 0); // group 1 commented out _g2 = (_grp select 1); // group 2 active leader _g1 synchronizeObjectsAdd [_Group_HC_S]; // called back the modules, which I checked are there... but adding groups to HC system via leader injection fails. It's not overly important at this point. I am just curious why I can't jam units back into these logics, or perhaps I am doing it wrong with this method? NOTE: In my specific test cases, I added a selection of one of the resistance groups minus the player. Then later tried to add the other selection. It won't add it. My new work around program works, but I would like to know why I can't work with the logics directly, or how I correctly recall them?
  3. 0 spawn { highCommandFunc = { params ["_unit", "_grpArry"]; not_done = true; while { not_done } do { _unit_hc_count = count (synchronizedObjects _unit select { _x isKindOf "HighCommand" }); switch (_unit_hc_count) do { case 0: { _Group = createGroup (sideLogic); _Group_HC_C = _Group createUnit ["HighCommand", [0, 0, 0], [], 0, "NONE"]; _Group_HC_S = _Group createUnit ["HighCommandSubordinate", [0, 0, 0], [], 0, "NONE"]; _unit synchronizeObjectsAdd [_Group_HC_C]; _Group_HC_C synchronizeObjectsAdd [_Group_HC_S]; _grpArry = _grpArry - [group _unit]; { _unit hcSetGroup [_x]; }forEach _grpArry; not_done = false; }; case 1: { _hc_grps = hcAllGroups _unit; _grpArry = _grpArry - _hc_grps; _grpArry = _grpArry - [group _unit]; if (count (_grpArry) > 0) then { { _unit hcSetGroup [_x]; } forEach _grpArry; }; not_done = false; }; default { _hc_grps = hcAllGroups _unit; _hc_grps = _hc_grps - _grpArry; _grpArry = _grpArry + _hc_grps; hcRemoveAllGroups _unit; sleep 0.25; hc_module = synchronizedObjects player select { _x isKindOf "HighCommand" }; if (count (hc_module) > 1) then { { hc_sub_module = synchronizedObjects _x select { _x isKindOf "HighCommandSubordinate" }; if (count (hc_sub_module) > 0) then { { deleteVehicle _x; } forEach hc_sub_module; }; deleteVehicle _x; } forEach hc_module; }; sleep 0.25; }; }; }; }; _grp = allGroups select { side _x == resistance }; [player, _grp] call highCommandFunc; }; edit: yup, I have to spawn it and add sleep threads. Definitely goes over the the 3 ms per frame scheduler execution limit.
  4. Thanks for the response. I was reading () as syntax for boolean and {} as syntax for an expression. I saw some conditions work with select using () and some expressions work with select using {}. I noticed that the primary synchronizedObjects returned array, hence I was using the forEach and select statements because it was an iterable. hc_module = synchronizedObjects player select {_x isKindOf "highCommand"} select 0; hc_sub_module = synchronizedObjects hc_module select {_x isKindOf "highCommandSubordinate"} select 0; I definitely did this one. If we are going off of my original post, I created a basic high command and subordinate logic and synchronized them. I then attach high command to the player, and iterate through all the groups in a side and make them subordinate. The old code I found was unable to select the old modules stored on the player object and make additions to it. So naturally, I needed to access the synchronized object that I placed on the player, but I am unable to bind new groups to the subordinate module. Working: _Groups_HC = hcAllGroups player; _grp = allGroups select { side _x == resistance }; _grp = _grp - _Groups_HC; _grp = _grp - [group player]; { player hcSetGroup [_x]; } forEach _grp; Not Working: hc_module = synchronizedObjects player select { _x isKindOf "highCommand" } select 0; hc_sub_module = synchronizedObjects hc_module select { _x isKindOf "highCommandSubordinate" } select 0; _Groups_HC = hcAllGroups player; _grp = allGroups select { side _x == resistance }; _grp = _grp - _Groups_HC; _grp = _grp - [group player]; { leader _x synchronizeObjectsAdd [hc_sub_module]; } forEach _grp; I want to use the synchronize objects system for multiplayer, and I need to be able to grab the items on the individual _unit I want to avoid using hcSetGroup, if possible. I want to select a specific object to bind teams to and avoid conflict, more on that later. I will migrate off of player once I have a working setup The end goal is making a simple action menu that allows a player to manage its own teams and avoid conflict with built in HC commands or complexities with the other HC management systems. And for good measure, I also tried your script which was overly complicated: _subLogic = synchronizedObjects (synchronizedObjects player select {_x isKindOf "highCommand"} select 0) - [player] select 0; It's no different from my two step process, but is way more difficult to read. So in a nutshell, I am stumped on accessing the sublogic and using it like I did when I invoked it. I can create and attach, but am unable to recall and modify.... Though I can collect the groups, destroy it and rebuild it, though, not ideal.
  5. Long time no talk. I am currently working with the high command module with some old scripts I dusted off. I was able to get some easy scripts to create the HC and add all the units on a particular side to the player: if (count (allMissionObjects "HighCommand") == 0) then { _Group = createGroup (sideLogic); _Group_HC_C = _Group createUnit ["HighCommand", [0, 0, 0], [], 0, "NONE"]; _Group_HC_S = _Group createUnit ["HighCommandSubordinate", [0, 0, 0], [], 0, "NONE"]; player synchronizeObjectsAdd [_Group_HC_C]; _Group_HC_C synchronizeObjectsAdd [_Group_HC_S]; { if (side _x == resistance) then { leader _x synchronizeObjectsAdd [_Group_HC_S]; }; }forEach allGroups; } else .... The else condition is what I am having problems with: else { _Groups_HC = hcAllGroups player; _Group_HC_C = synchronizedObjects player select (side player == sideLogic); _Group_HC_S = synchronizedObjects _Group_HC_C select 0; // or 1? Neither works { if (side _x == resistance && !(_x in _Groups_HC)) then { leader _x synchronizeObjectsAdd [_Group_HC_S]; }; }forEach allGroups; }; I've tried all sorts of ways of tracking down the objects in the allMissionObjects: _Groups = allMissionObjects "HighCommand"; _Group = allMissionObjects "HighCommand" select (side player == sideLogic); //This looks like a subordinate _Group = synchronizedObjects player select 0; //it's definitely a group in this case //and _Group_HC_C = synchronizedObjects player select 0; //primary group _Group_HC_S = synchronizedObjects _Group_HC_C select 0; //p1 //and _Group_HC_C = synchronizedObjects player select 0; //primary group _Group_HC_S = synchronizedObjects _Group_HC_C select 1; //looks like the sub I'm stumped on how to pull the same data I injected so I can add more groups. The goal is getting a basic example working and sort out a simple admin script to add basic high command group management, nothing more. Anyone have any ideas? edit: wait, I think the else isn't adding leaders. checking... Ok, i updated the else to reflect what I needed it to do, but I am still unable to properly lookup and find the variables I created.
  6. support ticket created: https://feedback.bistudio.com/T123456 just realized it is ticket 123456...
  7. So nobody can explain why children aren't closing out with parents then?
  8. 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.
  9. That's what I gathered so far. Though the documentation says otherwise.
  10. 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?
  11. @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 ==.
  12. //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
  13. 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.
  14. That's why I always use unique variables or I select units or vehicles through logic.
×