Jump to content

Robustcolor

Member
  • Content Count

    363
  • Joined

  • Last visited

  • Medals

Everything posted by Robustcolor

  1. Robustcolor

    publicVariable question

    Thanks @pierremgi. Question, if i use same variable _veh for creating vehicle + adding _veh "RWPoint",true. will it Delete the "RWPoint" when deleting the vehicle with deleteVehicle _veh; _veh = "B_MRAP_01_F" createVehicle getMarkerPos "Car"; _veh setVariable ["RWPoint", true, TRUE]; deleteVehicle _veh;
  2. Robustcolor

    publicVariable question

    I see, thanks for pointing it out. With true,TRUE it should be able to check if RWPoint is true or false locally or server side right? Also, why does the RSP = False; PublicVariable "RSP"; set inside initServer.sqf not matter in my if (!RSP) then {}; check that is executed locally. It keeps executing the code inside the check even if RSP is set true with an publicVariable later on inside the check.
  3. Hi, when using a Headless Client is it only limited to handle ai and it's calculations? My HC is handling the mission/spawn ai and delete/clean up but not the server stuff like changing weather, time acc etc, i guess that's correct? When using commands like enableDynamicSimulationSystem true; from initServer.sqf does that apply for the AI spawned from the HC or does it need to be set within the HC script? I've read that the server difficulty for the Ai is using the HC profile and not the regular server profile, maybe it's the same for some of the server commands affecting ai's and vehicle?
  4. Robustcolor

    HC and Dedicated question.

    I see. Is it a bad idea to let the Headless client manage anything else beside Ai? Like clean up scripts, move markers on map, different loop checks etc. Also, when using a Headless client to manage the spawning of ai's, the Zeus will loose control of the ai's. Is it possible to regain control/visibilty of the ai's in the Zeus panel without changing ownership to the regular server from HC? In a non-HC mission i use Zeus addCuratorEditableObjects [[_unit], false]; but that won't work in this case.
  5. Hi, i've setup a headless client for my server, it can connect to the server but it stays in the lobby just idling. I can't figure out how to make the headless client choose it own HC slot under Virtual or what could be causing it not to move. I did try to move it manually but it did not work. Tips?
  6. Robustcolor

    Headless client question

    My HC now connects and does what it's supposed to do but if the server crash or restart the HC reconnects and goes into the HC slot but it don't stop showing the loading symbol and therefore does nothing. Everything works if i restart the HC manually when that happens. Why is that? Can't the HC handle a server restart or crash? Does it need to reboot each time aswell? the logfile shows nothing.
  7. Robustcolor

    Headless client question

    Thanks @[BL] Hannibal
  8. Robustcolor

    How can I simplify this script?

    Will this work on a dedicated server executed from initServer.sqf? Also sync with JIP? Why uiSleep? while {true} do { private _valueOvercast = random [0,0.3,1]; (900 * timeMultiplier) setOvercast _valueOvercast; if (_valueOvercast >= 0.5) then { _valueRain = _valueOvercast; (900 * timeMultiplier) setRain _valueRain; if (_valueRain <=4) then { (900 * timeMultiplier) setFog random [0,0.2,0.5]; }; } else { (900 * timeMultiplier) setRain 0; }; sleep 1800; };
  9. Hi, i'm using this simple reload eventHandler to give a new magazine each time a player reloads. I'm trying to add so it also removes the oldMagazine if the ammo in it is more then 0 because otherwise it fills up the inventory, but can't get it to work. Suggestions? player addEventHandler ["Reloaded", { params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"]; private _ammo = _unit ammo _muzzle; if (_ammo > 0) then { _oldMagazine params ["_oldMagazine"]; _unit removeMagazine _oldMagazine; }; _newMagazine params ["_newMagazine"]; _unit addMagazine _newMagazine; }];
  10. Robustcolor

    Simple reload EH

    ok! My guess was this withouth a check, but it's acting wierd, sometimes it gives new magazine and not deleting the old one. player addEventHandler ["Reloaded", { params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"]; _newMagazine params ["_newMagazine"]; _unit addMagazine _newMagazine; _oldMagazine params ["_oldMagazine"]; _unit removeMagazine _oldMagazine; }];
  11. Robustcolor

    Simple reload EH

    The remove part of the oldMagazine. I can get it to work to delete the oldMagazine when reloading, but the thing is that an empty mag always gets removed without scripting so i would like to make a check instead if there is bullets left in the magazine and then remove it. So it won't stack alot of half full magazines in the inventory.
  12. Question, What is the reason for using continue? while {true} do { { if (_x getVariable ["damage_modifier_EH_applies", false]) then {continue;}; _x addEventHandler ["HandleDamage", _EHCode]; _x setVariable ["damage_modifier_EH_applies", true]; } forEach allUnits; uiSleep 5; }; vs while {true} do { { if (_x getVariable ["damage_modifier_EH_applies", false]) then { _x addEventHandler ["HandleDamage", _EHCode]; _x setVariable ["damage_modifier_EH_applies", true]; }} forEach allUnits; sleep 5; };
  13. Robustcolor

    Help with set/get variable

    When adding true/false after the name "RWPoint", does it affect if it's local or public variable? Or does it need to have setVariable ["RWPoint",true,false] for it to be local? These are the examples from the wiki. Changing the first line to false would make it local? Why the extra [] in the second line? _myTruck setVariable ["myPublicVariable", 123, true]; _myTruck setVariable ["myLocalVariable", ["321", _var], false];
  14. Robustcolor

    Help with set/get variable

    Thanks, something like this should probarly work then. Question, does the setVariable command remove/delete itself when the attached object is destroyed or deleted? initServer.sqf respawnPositionAdded = false; Createvehicle.sqf for "_i" from 1 to 5 do { _veh = "Jeep" createVehicle [0,0,0]; if (!respawnPositionAdded) then { [west, _veh] call BIS_fnc_addRespawnPosition; _veh setVariable ["RWPoint", true]; respawnPositionAdded = true; }; }; Deletevehicles.sqf params ["_veh"]; if (_veh getVariable ["RWPoint", true]) then { [_veh] call BIS_fnc_removeRespawnPosition; respawnPositionAdded = false; }; deleteVehicle _veh;
  15. How do i disable the enter key, which switches the player view. I tried this from initPlayerLocal.sqf ctrlEnable [156, false]; and this (findDisplay 46) displayAddEventHandler ["KeyDown", { params ["_control", "_button"]; if (_button == 156) then { (_d displayCtrl _button) ctrlEnable false; }; }]; Not working.
  16. Robustcolor

    Disable a keyboard button

    Thanks @pierremgi
  17. Robustcolor

    Delayed Trigger Response

    If i place a trigger that activates when anyPlayer joins the game, is it enough to do this? Activation - anyPlayer Activation type - Present On activation - trg setTriggerInterval 5; trg1 setTriggerInterval 5; Not repeatable Or do i need to have the trigger to be Not repeatable but activate on each player with condition this && player in thisList for it to make triggers be the same for each client?
  18. Robustcolor

    Delayed Trigger Response

    If the default trigger interval is by default 0.5 seconds, why is it it necessary to have a if then check !=5? Is it not enough with only this in the condition? thisTrigger setTriggerInterval 5; this
  19. Hi, i'm trying to restrict a specific weapon to an active amount of 1, since i'm using an Arsenal my guess was doing this from initPlayerLocal.sqf. [missionNamespace, "arsenalClosed", { if (allPlayers findif {primaryWeapon _x isKindOf "BAF_L85A2_RIS_SUSAT"} !=-1) then { player removeWeapon "BAF_L85A2_RIS_SUSAT"; }; }] call BIS_fnc_addScriptedEventHandler; Is there a simplier way of checking if only the weapon exist, even if its dropped on the ground or in someones primary slot?
  20. If i would put the forbidden weapons in an array like below, hasWeapon command won't work. _weapons = ["BAF_L85A2_RIS_SUSAT","launch_NLAW_F"];
  21. Robustcolor

    NearestTerrainObjects

    How can I do a random selection within a select [] command, the regular select [0,15]; does not random pick locations.
  22. I've been messing around abit with all these codes trying to figure out a better way to random select how many buildings that should append buildingpositions to the array since i know how many positions i need. This is how it looks like now and it gives me 0.746ms. when testing the speed of it. _allBuildings = player nearObjects ["building", 250]; _allBuildingPos = []; _allBuildings apply {_allBuildingPos append (_x buildingPos -1)}; If i would try to select [0,15] of the positions and append the buildingPos it would give 0.193ms, but the problem is that those 0 - 15 is not randomized. Any clue how to solve it? _allBuildings = player nearObjects ["building", 250]; _allBuildingPos = []; _allBuildings select [0,15] apply {_allBuildingPos append (_x buildingPos -1)};
  23. Robustcolor

    NearestTerrainObjects

    Thanks @pierremgi _nearestObjects = ((nearestObjects [_pos, [], 15, true]) select {getModelInfo _x #0 == "t_inocarpus_f.p3d"}); if (_nearestObjects isEqualTo []) then {
  24. Robustcolor

    NearestTerrainObjects

    @pierremgi That worked pretty good, had to remove the parentheses. _nearObjects = nearestObjects [_pos, [], 15, true] select {getModelinfo _x #0 == "t_inocarpus_f.p3d"}; Since i'm using the code from above, i want the loop to skip create an unit if that particular object is near the position, is this a good way to do it? I'm using a isNil check to stop the loop and continue with next loop. _allBushes = nearestTerrainObjects [player, [Bush], 250, false]; for "_i" from 1 to 5 do { if(count _allBushes == 0) exitWith {}; _index = floor random (count _allBushes); _pos = getpos (_allBushes # _index); _allBushes deleteAt _index; _nearObjects = nearestObjects [_pos, [], 15, true] select {getModelinfo _x #0 == "t_inocarpus_f.p3d"}; if (!isNil "_nearObjects") then { _grp = createGroup east; _unit = _grp createUnit ["C_man_p_beggar_F", [0,0,0], [], 0, "FORM"]; _unit setPos _pos; };};
×