Jump to content


  • Content count

  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About cklymowsky

  • Rank
    Lance Corporal
  1. Thanks Larrow, I actually had to increase initPlayerLocal.sqf up to waitUntil { time > 2 }; before I stopped getting undefined variable errors, and BIS_fnc_moduleSector_sectors would give the sectors. I assume my script setUpSector requires this much time. My thought was that by running setUpSector that calls createSector embedded within it, with preInit in the description.ext, all the sectors would be created and initialized before initPlayerLocal?
  2. HI All, I'm having problems with my script obtaining BIS_fnc_moduleSector_sectors and I think it is related to a timing issue? In my description.ext below, setUpSector creates sectors on the map. I added preInit thinking this would be done early on (as per https://community.bistudio.com/wiki/Initialization_Order) when loading the MP game, but do not notice much difference between postInit and preInit. description.ext class CfgFunctions { class BEAKS { class SetUp { file = "functions\SetUp"; class setUpSector {postInit = 1}; //{postInit = 1}; {preInit = 1}; not sure which to use class sectorDistances {}; } } }; fn_sectorDistances.sqf, waitUntil {!isNull player}; fn_Draw3Dsectors = { { //...script to display distance of sectors } forEach BIS_fnc_moduleSector_sectors; }; private ["_addNew"]; _addNew = ["BIS_id", "onEachFrame", "fn_Draw3Dsectors"] call BIS_fnc_addStackedEventHandler TRUE The BIS_fnc_moduleSector_sectors works when BEAKS_fnc_sectorDistances is called below for some reason? initPlayerLocal.sqf waituntil {!isnil "bis_fnc_init"}; waitUntil {!isNull player}; [] call BEAKS_fnc_sectorDistances; hint format ["BIS_fnc_moduleSector_sectors: \n %1", BIS_fnc_moduleSector_sectors]; HOWEVER, I get an "Error Undefined variable in expression: bis_fnc_modulesector_sectors" with the hint statement? How to I get BIS_fnc_moduleSector_sectors recognized?
  3. Sector Module Scripting

    Thanks Larrow, this works. So the waitUntil { time > 0 }; is what it controlling the timing. But timing of what exactly? Correct, player position is just for testing.
  4. Sector Module Scripting

    Thanks Larrow, I'm back working on my MP game using your updated version, and integrating into my own script. I am trying to generate sectors before the game starts, and I don't want to call spawnSector from initPlayerLocal or initServer. So I am calling setUpSector with {postInit = 1} from the description.ext. The sector module "ModuleSector_F" will not spawn, yet all the params are shown in the hint message, and I am not getting any error messages...any ideas what's going wrong? I stripped everything out from your example mission, to try and figure it out, and only have the following: in the mission folder: description.ext, mission.sqm in folder functions>>SetUp>> createSectorExecution.hpp, fn_createSector.sqf, fn_setUpSector.sqf description.ext createSectorExecution.hpp class BEAKS_fnc_createSector { jip = 0; allowedTargets = 2;}; //No JIP, Can only be remoteExecuted to the Server fn_setUpSector.sqf //waitUntil { time > 0 }; //Exit if we are not the server if (!isServer) exitWith {}; //Create a plain old default sector ["myLoadingScreen", "this text does not display for some reason..."] call BIS_fnc_startLoadingScreen; //Usage basic _baseName = [position player,"Sector 1","S",nil,nil,EAST] call BEAKS_fnc_createSector; "myLoadingScreen" call BIS_fnc_endLoadingScreen; fn_createSector.sqf
  5. HELP with nested "for" "do" loop

    OK thanks Larrow, Yours is 0.0179ms and my for do loop is 0.0.0274ms. Thanks again!
  6. HELP with nested "for" "do" loop

    Thanks both to Grump and Harzach, appreciate the ongoing support and patience. Your feedback did help! Now finally got it working with: allSectorsArray = [0,1,2,3,4,]; for "_i" from 0 to (count allSectorsArray - 1) do { _firstSector = allSectorsArray select _i; __I = _i+1; for "_j" from __I to (count allSectorsArray - 1) do { _otherSector = allSectorsArray select _j; _sectorPairArray pushBack [_firstSector, _otherSector]; }; }; //_sectorPairArray returns [[0,1],[0,2],[0,3],[0,4],[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] Not sure it there was better way to do this?
  7. HELP with nested "for" "do" loop

    Thanks Harzach, Not sure if I was using params correctly, I though you could use it similar to private, but in this case I wasn't calling in a variable. I set otherSector = objNull; to define it, thinking this was the problem. Instead I found the issue and it does what I want it to do with the following:
  8. HELP with nested "for" "do" loop

    Not sure what is wrong with "_i" in for "_i" from __I to (count allSectorsArray - 1) do { as it is used as the VARNAME in the example of Control Structures: https://community.bistudio.com/wiki/Control_Structures#for-from-to-Loop I am setting _i equal to __I (another variable) that gets it value every time it goes through the outer loop and using it as the STARTVALUE in the inner loop. I fixed the +1 to + 1.
  9. Thanks, but how do I find these? Currently I use "ground" in my script for blacklist areas: _randomPosAroundPlayerinWater = [[[_pos, 250]],["ground"]] call BIS_fnc_randomPos;
  10. HI All, I can't figure out how to solve this nested for do loop to get it to work. I'm getting the following error despite defining my variable at the start. Excerpt from rpt file with error message: 17:01:59 File functions\SetUp\fn_createMarkers.sqf [BEAKS_fnc_createMarkers], line 18 17:01:59 Error in expression <sectorPairArray pushBack [_firstSector, |#|_otherSector]; }; _i = _i +1; }; para> 17:01:59 Error position: <_otherSector]; }; _i = _i +1; }; para> 17:01:59 Error Undefined variable in expression: _othersector My script with the nested "for" "do" loop contains the following: params ["_firstSector","_otherSector","_sectorPairArray"]; // get unique pairs of sectors _firstSector = objNull; _otherSector = objNull; _sectorPairArray = []; __I = 0; hint format ["allSectorsArray: \n %1", allSectorsArray]; for "_i" from 0 to (count allSectorsArray - 1) do { _firstSector = allSectorsArray select _i; _i = __I; for "_i" from __I to (count allSectorsArray - 1) do { _i = _i +1; _otherSector = allSectorsArray select _i; _sectorPairArray pushBack [_firstSector, _otherSector]; }; _i = _i +1; }; allSectorsArray is a global variable array of sectors.
  11. Thanks, I went with the following, it can create 12 boats spread apart along the shore line, most of the time. Sometimes it spawns them under water of on shore land despite being scripted not to. I may have to create a loop that check the status of each boat, and respawn it if it is on land or underwater.
  12. HI All, I've tried writing a script to spawn boats spread out along a shoreline (reliably in the water), but takes quite a while to spawn them reliably (up to a minute or more). Has anyone got a better script, better idea on how to do this or can suggest improvements to my script below?
  13. Hi All, Does anyone know how to fix the following message "Config: someinputafter EndOfFile." that always pops-up at the start on my MP missions on the Create Game Screen? Thanks
  14. Sector Module Scripting

    HI All, I set the following, so that all the sectors would be displayed on screen in a MP game by initializing with: _logic remoteExecCall ["BIS_fnc_moduleSector", 0, FALSE]; createSector.sqf //Exit if we are not the server if !( isServer ) exitWith {}; params ["_pos",["_baseName","",[""]],["_side","",[EAST,""]]]; _pos = [_this,0,[],[[],objNull,""],3] call BIS_fnc_param; _pos = _pos call BIS_fnc_position; //Create the sector logic _logic = (createGroup sideLogic) createUnit ["ModuleSector_F",_pos,[],0,"NONE"]; //ModuleSectorDummy_F ModuleSector_F _logic remoteExecCall ["BIS_fnc_moduleSector", 0, FALSE]; //Default setting, which are optional //_designation = ""; //if ((_baseName find "CONTROL POINT") >= 0) then {_designation = _baseName select [14,1]}; //_logic setVariable ["Designation",_designation, TRUE]; // ADD Sector Numbers only works when remoteExecCall on initializing, TESTING _logic setVariable ["Designation","", TRUE]; _logic setVariable ["Name",_baseName, TRUE]; And noticed that the "Designation" variable now works! How ever I get the following error, yet it still works, how can I clear this error? waituntil {|#|!isnil {_logic getvariable "finalized"}}> Error position: <!isnil {_logic getvariable "finalized"}}> Error Generic error in expression File A3\modules_f\Multiplayer\functions\fn_moduleSector.sqf [BIS_fnc_moduleSector], line 70
  15. Thanks Larrow, Switching from playerSide to player, resolves the duplication of sector names in the RESPAWN MENU, with on slight, very minor issue, the RESPAWN MENU for a player already dead, will not be updated with the sector "Name" of a newly captured sector, until they die and the list of sector "Name" are updated. Still works even though an area with a same sector is available to respawn in. during this time.