Jump to content


  • Content count

  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About cklymowsky

  • Rank
    Private First Class
  1. 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
  2. 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.
  3. HI All, I'm using the following scripts to update the respawn sectors in a MP COOP game. It works, however, every time more than one player dies the RESPAWN MENU generates multiple respawn sectors of the same type, depending on how many players are dead, which looks confusing. How should I modify this so that the RESPAWN MENU only uses the latest sectors from the last player that died? description.ext respawnTemplates[] = {"MenuInventory","MenuPosition"}; onPlayerRespawn.sqf //run on all player clients incl. player host and headless clients if (!isDedicated) then { //Once the player has respawned //Remove all sector respawn positions [ "REM_ALL" ] call TAG_fnc_respawnPositions; }; onPlayerKilled.sqf //When player dies //For every sector { //If the sector is owned by the players side if ( ( _x getVariable "Owner" ) isEqualTo playerSide ) then { //Add a respawn position [ "ADD", _x ] call TAG_fnc_respawnPositions; }; }forEach BIS_fnc_moduleSector_sectors; initPlayerLocal.sqf initServer.sqf
  4. Thanks gokitty1199, You're correct, I had to remove the addMissionEventHandler, then it worked.
  5. HI All, I'm trying to play my start-up music for every client that joins the game, but so far it only plays on the host? initPlayerLocal.sqf _handle1 = addMissionEventHandler ["PlayerConnected",{playMusic "MenuMusic"}]; ... //BI RESPAWN MENU - IDD 58 PLAY MenuMusic if (!isDedicated) then { waitUntil {!(isNull (findDisplay 58))}; if (isNil "BEAK_MUSIC_INIT") then { BEAK_MUSIC_INIT = 1; playMusic "MenuMusic"; _music = addMusicEventHandler ["MusicStop",{playMusic (_this select 0)}]; waitUntil {isNull (findDisplay 58)}; removeMusicEventHandler ["MusicStop",_music]; playMusic ""; }; }; I tried placing it in init.sqf but has same effect...still not sure how to broadcast script to all clients.
  6. allSectorsArray = ...sectors created using BIS_fnc_sectorModule I have tried using publicVariable "allSectorsArray"; which I think is the same as missionNamespace setVariable ["sectorsArray",allSectorsArray, TRUE]; and have also tried defining allSectorsArray = ...sectors created using BIS_fnc_sectorModule inside of init.sqf as per http://killzonekid.com/arma-scripting-tutorials-variables-part-3/ yet they all yield the same results: on host I get: TRUE call bis_fnc_moduleSector: [BIS_fnc_moduleSector_sector2_751, BIS_fnc_moduleSector_sector2_756, ...] on the client: TRUE call bis_fnc_moduleSector: [L Bravo 1-5:1 REMOTE, L Bravo 1-6:1 REMOTE, ...] My question is why aren't any of these methods transferring the global variable allSectorsArray to the clients the same way as it appears on the host? Is this because you cannot transfer sectors as variables because they are not supported by these commands? SOLUTION: I used publicVariable "controlPointsArray"; even if this generates [L Bravo 1-5:1 REMOTE, L Bravo 1-6:1 REMOTE, ...] as sectors and had to change my sectorDistance.sqf from _picture = switch (_x getVariable "Name") do { case "1 CONTROL POINT":{"\A3\ui_f\data\map\markers\military\flag_CA.paa"}; }; to if (_x in controlPointsArray) then {_picture = "\A3\ui_f\data\map\markers\military\flag_CA.paa"}; As it could not get the value from, since the public value in was not set to true.
  7. Thanks gokitty1199, BUT, the problem is TRUE call bis_fnc_moduleSector in the fn_sectorDistances.sqf. When I test with the following: { _bis_fnc_moduleSector = TRUE call bis_fnc_moduleSector; hint format ["TRUE call bis_fnc_moduleSector: \n %1 ", _bis_fnc_moduleSector]; } remoteExec ["bis_fnc_call", 0, true]; On the host I get an array sectors that works with fn_sectorDistances.sqf, but on the client I dont't get the same array, and as a result fn_sectorDistances.sqf doesn't work. on host I get: TRUE call bis_fnc_moduleSector: [BIS_fnc_moduleSector_sector2_751, BIS_fnc_moduleSector_sector2_756, ...] on the client: TRUE call bis_fnc_moduleSector: [L Bravo 1-5:1 REMOTE, L Bravo 1-6:1 REMOTE, ...] I can't even import a global variable allSectorsArray = TRUE call BIS_fnc_moduleSector; through: initServer.sqf [[allSectorsArray],"functions\SetUp\fn_sectorDistances.sqf"] remoteExec ["execVM", 0, true]; It gives the same results as in hint message above. HOW do I broadcast a variable to other clients the same way it would show up on the server and host?
  8. I tried placing it in initServer.sqf thinking it could broadcast to all players initServer.sqf //show distances to all sectors for all players remoteExec ["BEAKS_fnc_sectorDistances", 0]; ...but it only works on the host. How can I get fn_sectorDistances to run on all players. fn_sectorDistances.sqf
  9. HI All, I've read remoteExec and CfgRemoteExec but yet I still cannot get my function, fn_sectorDistances.sqf, to display for the host or all players that join. fn_sectorDistances is supposed to show the distance from the player to the sector... description.ext class CfgRemoteExec { // List of script functions allowed to be sent from client via remoteExec class Functions { file = "functions\SetUp"; class sectorDistances {}; // allowedTargets = 0 can target only clients }; }; and in initPlayerLocal.sqf //show distances to all sectors for all players remoteExec ["fn_sectorDistances", 0, true]; I've stored fn_sectorDistances.sqf in a sub-folder folder in: functions>>SetUp Am I executing it from the right location? Have I set up class CfgRemoteExec correctly?
  10. HI ALl, Not sure what I'm doing wrong here. I want to create a marker via scripting, then tag it in createDiaryRecord, so that in the mission briefing when you select the marker name the map move to the position. So far I only have the tag in present but when you click the underlined text RADIO TOWER 1 in the briefing map nothing happens? fn_diaries.sqf _randomPosMapNoWater = [nil, ["water"]] call BIS_fnc_randomPos; marker = createMarker ["GOHERE", _randomPosMapNoWater]; marker setMarkerShape "RECTANGLE"; marker setMarkerSize [100,100]; player createDiaryRecord ["Diary", ["RADIO TOWER", "Capturing the <marker name = marker>RADIO TOWER 1</marker> allows you to ..."]]; Nevermind, The name in <marker name = marker>RADIO TOWER 1</marker>has to be the sting in createMartker "GOHERE".
  11. Ok Thanks Larrow, this worked... I went with the changes below...I suppose it can only have one function in either pre or post Init. preInit was generating errors as you mentioned perhaps do to something not being initialized, however I only have 2 soldiers saved on the map, but I don't have them included in the script? description. ext fn_startSetUp.sqf
  12. HI All, Still having problems with preInit, and don't understand "Passed arguments are ["preInit"]". In my description.ext startSetup calls sectorConfiguration that calls findSuitableLocation with: "_findSuitableLocation = [_location3D, _minDist, _maxDist, 10, 0, 0.25, 0, [], [[0,0,0],[0,0,0]]] call BIS_fnc_findSafePos;" ...and then calls createSector. But then I'm getting the following error, that is somehow related to preInit: fn_startSetUp.sqf fn_sectorConfiguration.sqf fn_findSuitableLocation.sqf fn_createSector.sqf
  13. Thanks, I'm still working through the error messages, Does this also mean I also have to include the BIS functions that I call in my functions such as BIS_fnc_moduleSector; with {preInit = 1}; in the CfgFuntions?
  14. HI All, I'm running a script in the InitServer.qsf that randomly generates sectors on the map, but this takes a few seconds to position them. During this time the map flashes and the CONTINUE button is enabled, but the sectors haven't finished being placed. HOW do I make the loading screen black and disable the CONTINUE button, until the script is finished? Thanks in advance
  15. Sector Module Scripting

    HI atmo, I tried using the format above and Larrow's script but it does not make a difference. The on-screen designation still shows an "S" when I have designated it as "1" What is strange is that in the EDITOR it works despite the hint message saying it requires a "letter" in the Designation field.