Search the Community
Showing results for tags 'remoteExec'.
Found 30 results
-
Hello, i have a problem in inserting my progress bar in my code made for capturing a zone. The problem is that only players inside the list of the trigger need to see the progress bar and for that i used the remoteExec command. But when testing on server the code crash. But it works fine in the editor. I have put some //// where commands from the progress bar are. The variable barLayer = [1,2,3,4]; I have this : private ["_sideunits", "_sidegroup", "_trgCapture", "_trgBlock", "_sideBlock"]; _done = false; _resMarker = _this select 4; _posMarker = getPos (_this select 5); _tower = _this select 5; _resGroup = _this select 6; _attackMarker = _this select 7; _towerStatus = _tower getVariable "side"; //////////////////////////////// _layer = barLayer select 0; barLayer = barLayer - [_layer]; /////////////////////////////// if (_this select 0 == east) then { _sideunits = side_east; _sidegroup = east; _sideBlock = independent; _trgBlock = _this select 1; _trgCapture = _this select 2; }; if (_this select 0 == independent) then { _sideunits = side_independent; _sidegroup = independent; _sideBlock = east; _trgBlock = _this select 2; _trgCapture = _this select 1; }; if (_tower getVariable "side" == _sidegroup) exitWith {}; disableSerialization; //// _timer = [_trgCapture, _trgBlock, _layer] spawn { private "_txt"; _trg = _this select 0; _trgB = _this select 1; _layer = _this select 2; //// _cp = time_capture; /////////////////////////////////////////////////////////////////// [_layer,["myProgressBar","PLAIN"]] remoteExec ["cutRsc", list _trg]; waitUntil {!isNull (uiNameSPace getVariable "myProgressBar")}; _display = uiNameSpace getVariable "myProgressBar"; _bar = _display displayCtrl 2; _cpBar = 0; _barTime = 1/time_capture; /////////////////////////////////////////////////////////////////// while {_cp > 1} do { if (!triggerActivated _trgB) then { _txt = format ["Captured in %1 sec", _cp]; _cp = _cp - 1; //// _cpBar = _cpBar + _barTime; _bar progressSetPosition _cpBar; //// } else { _txt = format ["Captured in %1 sec\n\nBLOCKED !", _cp]; [["ATTACKED !", "PLAIN DOWN"]] remoteExec ["cutText", list _trgB]; }; [[_txt, "PLAIN DOWN"]] remoteExec ["cutText", list _trg]; sleep 1; }; [_layer,["default","PLAIN"]] remoteExec ["cutRsc", list _trg]; //// barLayer pushBack _layer; }; if (_tower getVariable "side" == _sideBlock) then { deleteMarker _resMarker; _attackMarker setMarkerAlpha 1; [_sideblock, _tower] call msg_attack; }; while {triggerActivated _trgCapture and !_done} do { if (scriptDone _timer and !triggerActivated _trgBlock) then { _tower setvariable ["side", _sidegroup]; [] spawn fn_spawnMission; [_sidegroup, _towerStatus] call countCapture; [_sideunits, _sidegroup] execVM (_this select 3); [_sidegroup, _tower, _sideunits] execVM "ai\ai_upgrade.sqf"; _done = true; }; }; if (!triggerActivated _trgCapture) then { ///////////////////////////////// _layer cutRsc ["default","PLAIN"]; barLayer pushBack _layer; //////////////////////////////// */ terminate _timer; if (_tower getVariable "side" == _sideBlock) then { createMarker [_resMarker, _posMarker]; _resMarker setMarkerShape "ICON"; _resMarker setMarkerType "hd_dot"; _resMarker setMarkerAlpha 0; _attackMarker setMarkerAlpha 0; }; };
- 9 replies
-
- remoteexec
- progress
-
(and 1 more)
Tagged with:
-
Arma 3 scripting tutorials from gokitty1199/IM SORRY BUFFALO(both me)
gokitty1199 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist- 23 replies
-
- 19
-
I'm having a couple of snipers (same group) reach their spot and then keep watch over a static position (in the image below represented by the lighthouse). What we noticed is that the more distant the lighthouse, the more untidy the "distracted" snipers' direction in relation to the position (lighthouse) they were supposed to be watching. I've given many go to align the group leader's position but the image was my best. Here are some commands that I've already tried: setDir, getDir, setFormDir. But doWatch and lookAt work better and, of course, because of the purpose, I chose to use doWatch. initServer.sqf (just for testing): waitUntil { !isNull grp1 }; private _sniperPos = [3801.55,4266.83,0]; private _wp = grp1 addWaypoint [_sniperPos, 0]; waitUntil {sleep 0.2; ((leader grp1) distance _sniperPos) < 8 }; grp1 setBehaviourStrong "AWARE"; grp1 setSpeedMode "LIMITED"; { _x setUnitPos "DOWN" } forEach (units grp1); systemChat format ["Before formationDirection '%1'", formationDirection (leader grp1)]; waitUntil {sleep 3; ((leader grp1) distance _sniperPos) < 1 }; { sleep 2; //[_x, (_x getDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getDir LIGHTHOUSE); //[_x, (_x getRelDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getRelDir LIGHTHOUSE); _x doWatch LIGHTHOUSE; } forEach (units grp1); grp1 setFormation "DIAMOND"; // better than LINE 'cause the spotter doesn't get in the sniper's way most of the time. grp1 setFormDir (getDir (leader grp1)); while { true } do { ["behaviour '%1' / formationDirection '%2' / eyeDirection '%3' / ", behaviour (leader grp1), formationDirection (leader grp1), eyeDirection (leader grp1)] call BIS_fnc_error; sleep 2; }; Demo: https://drive.google.com/file/d/18QGkzuj53y4LwcPvxpYBASMhiQROB76a/view?usp=sharing If you got some more to share, please, keep going!
-
remoteExect not working with commandChat
vladsz posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I'm trying to print something in the command chat (I'm quite new to Arma 3 scripting). This works 100% for the player character, but not so much for the playable characters. I have a squad of 4: one player and three remaining playables. 1. In Eden -> Attributes -> General -> Init: [] spawn UTIL_fnc_handleMissionStart; 2. I've setup a function library in Description.ext: // some CfgSounds // ... // Function library class CfgFunctions { class UTIL { class Print { file = "fnc"; class issueRadioCommand {}; class handleMissionStart {}; }; }; }; 3. fnc/fn_handleMissionStart.sqf: private _taskAssignmentDelay = 3; private _radioCommand = missionNamespace getVariable "missionStartRadioCommand"; private _groupName = groupId group player; private _message = _radioCommand select 0; private _duration = _radioCommand select 1; private _radioCommandDelay = 0; private _displayIntroText = { private _introTextDelay = 3; sleep _introTextDelay; [ ["Somewhere on Altis", 1, 1], [format ["Year %1", date select 0], 1, 1], [format ["Grid %1", mapGridPosition player], 1, 5, 3] ] spawn BIS_fnc_EXP_camp_SITREP; }; // --------------------------------------------------------------------------------- THESE 2 WORK FINE: // [west, "HQ"] commandChat "hello world!"; // [[west, "PAPA_BEAR"], "Hello world!"] remoteExec ["commandChat"]; _message = format [_message, _groupName]; [] spawn _displayIntroText; sleep _radioCommandDelay; [_message, _duration] call UTIL_fnc_issueRadioCommand; sleep _taskAssignmentDelay; ["retrieveIntelTask", "ASSIGNED"] call BIS_fnc_taskSetState; 4. fnc/fn_issueRadioCommand.sqf: params ["_message", ["_duration", 0]]; private _radioBeepDelay = missionNamespace getVariable ["radioBeepDelay", 0.5]; ["radio_beep"] remoteExec ["playSound"]; sleep _radioBeepDelay; [[west, "PAPA_BEAR"], _message] remoteExec ["commandChat"]; if (_duration > 0) then { sleep _duration; }; I haven't included the snippet for the missionNamespace variables, they are set in the init.sqf file. When I play as the player, everything works as expected: at some point I get a message in the command chat ([[west, "PAPA_BEAR"], _message] remoteExec ["commandChat"];). When I select a playable however, this doesn't work anymore. I do hear the ["radio_beep"] remoteExec ["playSound"]; but the command message never shows up. If I place the remoteExec directly into the fn_handleMissionStart.sqf file, it works for playables too, I can see the message. I didn't really understand how this remote execution works. Could someone please help me understand why is this working like this?- 1 reply
-
- scripting
- remoteexec
-
(and 3 more)
Tagged with:
-
remoteexec remoteExec "deleteVehicle"
rkemsley posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have some boxes (Weapon's Cache) scattered across my map. They can be "retrieved" by any BLUFOR player (BLUFOR player has to use the hold action), which removes the box, adds CuratorPoints to all BLUFOR Curators and removes the question mark from the map (where the box is located). They can also be "destroyed" by any Independent unit (Independent player and AI has to use the hold action), which removes the box and removes the question mark from the map (stopping the BLUFOR Curators from gaining CuratorPoints). I currently have this in the init of all the boxes scattered across the map. When used by any player, the trigger just removes the question mark from the map and nothing else. I think I need to use remoteExec for the deleteVehicle part and the addCuratorPoints, but I do not know how to use that function. Please help!- 17 replies
-
- arma 3
- addcuratorpoints
- (and 5 more)
-
Hey guys, I am trying myself on a remoteExec. The idea is, that on the execution of the remoteExec (which can only be triggered by the Game Master) every player gets teleported to their starting position by evaluating in which truck they are sitting. I was hoping that I could get the player object in the remoteExec but nothing happens. Is there a way to get the Player in a remoteExec that i completely missed? Thanks for your help. _vehicle = (vehicle player); switch (_vehicle) do { case "truck_alpha": { player setPos (getMarkerPos "mrk_start_alpha"); }; case "truck_bravo": { player setPos (getMarkerPos "mrk_start_bravo"); }; case "truck_charlie": { player setPos (getMarkerPos "mrk_start_charlie"); }; case "truck_delta": { player setPos (getMarkerPos "mrk_start_delta"); }; case "truck_echo": { player setPos (getMarkerPos "mrk_start_echo"); }; case "truck_sierra": { player setPos (getMarkerPos "mrk_start_sierra"); }; };
- 6 replies
-
- remoteexec
- player
-
(and 1 more)
Tagged with:
-
Hi everyone, I need little help with spawning defender/garrison/static units into my mission. My question is if this is the right way to do this? What I do is open new mission on the same map as my main mission, carefully and precisely place all defender units (units that will stay on one position) save and export to SQF. I paste the code in "someTown.sqf" and then use this to spawn it in the main mission: ["someTown.sqf", "BIS_fnc_execVM", false, false] call BIS_fnc_MP; Probably there is more up to date and efficient way to do this via remoteExec but I cannot understand how to do it ... please help. Coding every static gun or defender position and heading is much slower and consumes much more time ...
-
Context: on Dedicated Server / not tested in hosted server Hello again, This is my first script with function structure and I'm facing a hard time learning the syntaxes and the logic needed to make this work properly when with more than one player in-game. My mistakes are potentially in fn_VO_globalFunctions.sqf file and how I am calling that in fn_VO_coreGround.sqf file. Btw, this mission is not using any init file. Bad behaviors: Only repairing is working for everyone. Refueling and rearming are not working at all. Nobody can't see the systemChat feedback messages. description.ext class cfgFunctions { // VEHICLE OVERHAULING: REPAIR, REARM, REFUEL #include "vehiclesOverhauling\THY_functions.hpp" }; THY_functions.hpp class THY_functions { tag = "THY"; class vehiclesOverhauling { file = "vehiclesOverhauling"; class VO_parameters { preInit = 1 }; class VO_globalFunctions { preInit = 1 }; class VO_coreGround { preInit = 1 }; //class VO_coreAir { preInit = 1 }; //class VO_coreNautic { preInit = 1 }; }; }; fn_VO_parameters.sqf // EDITOR'S OPTIONS: VO_debugMonitor = false; // true = turn on the editor hints / false = turn it off. VO_feedbackMsgs = true; // true = the station shows service messages in-game for the player (highly recommended) / false = turn it off. // GROUND SERVICES groundVehiclesOverhauling = true; // true = the station accepts ground vehicles / false = doesn't accept. VO_groundServRepair = true; // true = repairing for ground veh is available / false = not available / highly recommended turn it on if you want also to refueling. VO_groundServRefuel = true; // true = refueling for ground veh is available / false = not available. VO_groundServRearm = true; // true = rearming for ground veh is available / false = not available. VO_grdActRange = 10; // in meters, the area around the station that identifies the ground vehicle to be serviced. Default 10. VO_grdCooldown = 10; // in seconds, time among each available ground services. Default 10. VO_grdStationAssets = // which assets (classnames) will be automatically ground stations on mission. [ "Land_RepairDepot_01_green_F", "Land_RepairDepot_01_tan_F" ]; // AIR SERVICES airVehiclesOverhauling = true; // true = the station accepts air vehicles / false = doesn't accept. VO_airServRepair = true; // true = repairing for air veh is available / false = not available / highly recommended turn it on if you want also to refueling. VO_airServRefuel = true; // true = refueling for air veh is available / false = not available. VO_airServRearm = true; // true = rearming for air veh is available / false = not available. VO_airActRange = 20; // in meters, the area around the station that identifies the air vehicle to be serviced. Default 10. VO_airCooldown = 10; // in seconds, time among each available air services. Default 10. VO_airStationAssets = // which assets (classnames) will be automatically air stations on mission. [ "Land_HelipadRescue_F", "Land_HelipadSquare_F", "Land_HelipadCircle_F", "Land_HelipadCivil_F" ]; // NAUTIC SERVICES nauticVehiclesOverhauling = true; // true = the station accepts nautic vehicles / false = doesn't accept. VO_nauticServRepair = true; // true = repairing for nautic veh is available / false = not available / highly recommended turn it on if you want also to refueling. VO_nauticServRefuel = true; // true = refueling for nautic veh is available / false = not available. VO_nauticServRearm = true; // true = rearming for nautic veh is available / false = not available. VO_nauActRange = 25; // in meters, the area around the station that identifies the nautic vehicle to be serviced. Default 10. VO_nauCooldown = 10; // in seconds, time among each available nautic services. Default 10. VO_nauStationAssets = // which assets (classnames) will be automatically nautic stations on mission. [ "Land_TBox_F" ]; true fn_VO_globalFunctions.sqf THY_fnc_VO_humanPlayersAlive = { private ["_headlessClients"]; _headlessClients = entities "HeadlessClient_F"; VO_humanPlayersAlive = (allPlayers - _headlessClients) select {alive _x}; true }; THY_fnc_VO_debugMonitor = { //WIP true }; fn_VO_coreGround.sqf //if (!isServer) exitWith {}; private ["_arrayGroundStations","_groundVehicles","_serviceInProgress","_eachGroundStation",/*"_grdRepairNeeded","_grdRefuelNeeded","_grdRearmNeeded",*/"_eachHumamPlayer"]; [] spawn { // arrays that will be populated only with the objects classnames listed by VO_grdStationAssets. _arrayGroundStations = []; // initial services condition _serviceInProgress = false; // if ground services is allowed... finding out only the objects of classnames listed in VO_grdStationAssets through the allMissionsObjects. if ( groundVehiclesOverhauling == true ) then { { _arrayGroundStations = _arrayGroundStations + allMissionObjects _x } forEach VO_grdStationAssets }; // check whether or not run this while-looping / if some or all services are on, bota pra foder... while { groundVehiclesOverhauling == true } do { // check who's human here: call THY_fnc_VO_humanPlayersAlive; { // VO_humanPlayersAlive forEach starts... _eachHumamPlayer = _x; if ( VO_debugMonitor == true ) then { call THY_fnc_VO_debugMonitor }; // defining the ground veh of _eachHumamPlayer (_x) into XXm radius: _groundVehicles = _x nearEntities [["Car", "Motorcycle", "Tank", "WheeledAPC", "TrackedAPC"], 10]; { // forEach of _arrayGroundStations starts... _eachGroundStation = _x; { // forEach of _groundVehicles starts... if ( (_x distance _eachGroundStation) < VO_grdActRange ) then { sleep 3; // a breath before the any ground service. // GROUND REPAIR if (VO_groundServRepair == true) then { if ( (alive _x) AND (damage _x > 0.1) AND (isEngineOn _x == false) AND (speed _x < 2) AND (_serviceInProgress == false) ) then { _serviceInProgress = true; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Checking the damages..."; }; playSound3D ["a3\sounds_f\characters\cutscenes\dirt_acts_carfixingwheel.wss", _eachGroundStation]; sleep 3; playSound3D ["a3\sounds_f\sfx\ui\vehicles\vehicle_repair.wss", _x]; // if player inside the vehicle: if (!isNull objectParent _eachHumamPlayer) then { addCamShake [1, 5, 5]; // [power, duration, frequency]. }; _x setDammage 0; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Ground vehicle has been repaired!"; sleep 2; if ( ( (VO_groundServRefuel == true) OR (VO_groundServRearm == true) ) AND ( (fuel _x < 0.8) OR ( ({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") != _x select 1} count (magazinesAmmo _x)) > 0 ) ) ) then { systemChat "Preparing to the next service..."; }; }; sleep VO_grdCooldown; _serviceInProgress = false; // station is free for the next service! }; }; // GROUND REFUEL if (VO_groundServRefuel == true) then { if ( (alive _x) AND (fuel _x < 0.8) AND (isEngineOn _x == false) AND (speed _x < 2) AND (_serviceInProgress == false) ) then { _serviceInProgress = true; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Checking the fuel..."; }; playSound3D ["a3\sounds_f\characters\cutscenes\concrete_acts_walkingchecking.wss", _eachGroundStation]; sleep 3; playSound3D ["a3\sounds_f\sfx\ui\vehicles\vehicle_refuel.wss", _x]; if (!isNull objectParent _eachHumamPlayer) then { addCamShake [0.3, 5, 2]; }; _x setFuel 1; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Ground vehicle has been refueled!"; sleep 2; if ( ( (VO_groundServRepair == true) OR (VO_groundServRearm == true) ) AND ( (damage _x > 0.1) OR ( ({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") != _x select 1} count (magazinesAmmo _x)) > 0 ) ) ) then { systemChat "Preparing to the next service..."; }; }; sleep VO_grdCooldown; _serviceInProgress = false; }; }; // GROUND REARM if (VO_groundServRearm == true) then { if ( (alive _x) AND ( ({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") != _x select 1} count (magazinesAmmo _x)) > 0 ) AND (speed _x < 2) AND (_serviceInProgress == false) ) then { _serviceInProgress = true; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Checking the ammunition..."; }; playSound3D ["a3\sounds_f\characters\cutscenes\concrete_acts_walkingchecking.wss", _eachGroundStation]; sleep 3; playSound3D ["a3\sounds_f\sfx\ui\vehicles\vehicle_rearm.wss", _x]; if (!isNull objectParent _eachHumamPlayer) then { addCamShake [1, 5, 3]; }; _x setVehicleAmmo 1; sleep 3; if (VO_feedbackMsgs == true) then { systemChat "Ground vehicle has been rearmed!"; sleep 2; if ( ( (VO_groundServRepair == true) OR (VO_groundServRefuel == true) ) AND ( (damage _x > 0.1) OR (fuel _x < 0.8) ) ) then { if (isEngineOn _x == false) then { systemChat "Preparing to the next service..."; } else { systemChat "For the next service, turn off the engine!"; }; }; }; sleep VO_grdCooldown; _serviceInProgress = false; }; }; }; } forEach _groundVehicles; } forEach _arrayGroundStations; } forEach VO_humanPlayersAlive; sleep 5; }; }; // spawn ends. Editable mission download: https://github.com/aldolammel/arma-3-vehicles-overhauling
-
[How To] Functional HEMTT Mover and SAM Trailers
Twiznak posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone! I read a post by another user and felt the need to finally give back to the community. I give to you functional HEMTT Movers and SAM trailers. these 3 addActions allow players to tow and un-tow SAM trailers. Works on dedicated servers too! Semper Prorsum! Steam Workshop Demo Mission initPlayerLocal.sqf Thank you Larrow, pierremgi, and Davidoss . For me to be able to read someone's request for help and know what needs to be done before I even open notePad. Is all thanks to your tutelage. Both directly and indirectly through your extensive posts helping others. I am in your debt, thank you. -
global [Sovled]Global addEventHandler "CuratorObjectPlaced"
rkemsley posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
How would I turn this short script global. Basically, I need these mines, when placed by any Curator on the map, to lose the ability to be edited by the Curator who placed it. Currently, I have this short piece of code located in my "initPlayerLocal.sqf", however, when I test my multiplayer map using the "arma3server_x64.exe", it doesn't remove the ability for me to edit the mines after they are placed. Please help!- 11 replies
-
- arma 3
- addeventhandler
- (and 5 more)
-
remoteExec problms (cant sand right message)
wh1ten3ss posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
so, the main problem contains in this code : TABLET_FNC_GETPLAYERSARRAY = { { if (isPlayer _x && alive _x) then { _index = lbAdd [14881, name _x]; _data = lbSetData [14881, _index, name _x]; //_index = lbAdd [14881, name _x]; //_data = lbSetData [14881, _index, name _x]; lbSetTooltip [14881, _index, name _x]; }; }forEach allUnits; while (true) do { _index = lbCurSel 14881; _target1 = lbdata [14881, _index]; sleep 0.1; }; }; MAIL_FNC_SENDLOCAL = { _message = ctrlText 14883; _text_admin_Err = format ["<t color='#F68617' >Ошибка блять сука не видит чела ебанного</t><br />"]; if (_target1 == "") exitWith {hint parseText (_text_admin_Err);}; //_target1 = missionNamespace getVariable ( _target1 ); _sender = player; _messagedisplay = parsetext format ["<t size='2' align ='center' color='#ffcc00'>Новое сообщение</t><br></br><br></br> <t size='1' align ='left' color='#00cc00'>Кому:</t><t align ='left'> Вам</t><br></br> <t size='1' align ='left' color='#00cc00'>От:</t> <t align ='left'> %1</t><br></br><br></br> <t size='1' align ='left' color='#00cc00'>Сообщение:</t><br></br> <t size='1' align ='left'>%2</t>", name player, _message]; lbAdd [14882, _message] call BIS_fnc_MP; ctrlSetText [14883, "Отправлено!"]; [_messagedisplay] remoteExec ["hint", _target1]; }; when I try to send msg to other players it's randomly sends to a random guy from GETPLAYERSARRAY_FUNC (or don't send it at all, idk why :< ) I want to make this code doing right - to send right message to the person, that I really select. -
Im creating a multiplayer mission where i want that only the pilot of a chopper can use a certain BIS_fnc_holdActionAdd. Several things are confusing me. First i have a container with following code in the init line: I actually expected that the pilot would now see the enty several times, one entry for each player. But to my happy suprise the pilot can only see the entry once. So this is the first thing i can't understand. But it keeps getting more confusing. Once the pilot completes the hold action, a script gets started (rearm.sqf). In this script a new hold action gets created in exactly the same way as the first one: this time suddenly the action gets added once for every player. Why does it behave different this time? I then decided to change my script. I try to get the id of the player who is controlling the pilot: pilotID = 0; pilotID = owner heli1D; I made two tests. The first time the host was playing heli1D. in that case pilotID was 2. Why was the pilotID 2? The host wasn't able to see the holdAction (he should have been). Second test the clients controlls heli1D. pilotID is 2 again. the client can see the hold action and it also got added only once. Again i don't understand whats going on. Im totally confused now. Help would be highly appreaciated.
- 2 replies
-
- locality
- holdaction
-
(and 1 more)
Tagged with:
-
Hi all, I'd like to better understand the JIP parameter used in remoteExec command. I read tons of pages (most of them are rather questions than answers) and of course several times the BIKI pages about remoteExec and JIP things. If I clearly understand, the JIP is set to FALSE by default. That means the code will not fire for a JIP as there is no "message" in queue. I guess the message is a kind of string code but there is no example or plain explanation about that. Anyway, here is my 2 cent question: I'm testing a mod on a server dedicated + client on the same PC. A script allows me modifying the loadout on pylons of a jet. This script is located on server where the aircraft is spawned. So, as setPylonLoadout is effect local , (really strange for a recent command!), I have to remoteExec this command everywhere. I forget the JIP thing, just remoteExecuting the command. OK. All is fine so far. Now, testing the mission, as client of my own dedicated server, I can see the new pylons and they are operational. BUT: If I disconnect and reconnect (the server is set to let the mission run when no player), I'm joining the ongoing mission and , by some way I can't understand, I can see the new pylons on the aircraft. On my mind, if no JIP parameter on remoteExec, the client has no info on what was remoteExecuted, so should see the standard loadout of the spawned aircraft. So, JIP or not, in what cases? Is there some exception on vehicles/objects? Isn't it a waste of net resource to JIP for nuts some parameters? but which ones? Thanks for reading.
- 5 replies
-
- 1
-
- remoteexec
- local
-
(and 1 more)
Tagged with:
-
Hi, How can i use 'removeAllWeapons player' in remoteexec? or 'deletevehicle vehicle player' with remoteexec? i know the basics about remoteexec and can create some hints,playsound,... with it but i dont know how to do it with those 2? thx for your help!
- 4 replies
-
- remoteexec
- remoteexecall
-
(and 4 more)
Tagged with:
-
While I am no beginner at programming in general, I am relatively new to SQF scripting for Arma 3. After 1000 hours I decided to finally toy around with the scripting side of things and I've already completely broken my first script. I apologize for any mistakes I may have made in advance, I am really new to this and I need some help solving this problem. At the moment the script is executing, however, it is not displaying the kills in the chat as it should be. I am realizing more and more that the YouTube video I learned this from is very inaccurate and riddled with errors. ----------initClient.sqf---------- // Executes all client scripts remotely and globally (with restrictions to client only if set in the script itself). [] remoteExec ["killFeedClient", 0]; ----------initServer.sqf---------- // Executes all client scripts remotely and server-sided. [] remoteExec ["killFeedServer", 2]; ----------killFeedClient.sqf---------- // Creates "killFeedClient" function to be executed in "initClient.sqf." killFeedClient = { { // Adding an event handler for the "Killed" action to every unit. _x addEventHandler ["Killed", { // Initializes all of the variables used in the formatting of the kill-feed statement. _unit = (_this select 0); _killedBy = (_this select 1); // Organizing and grouping all of the variables into a single array. deathInfo = [_unitName, _killedBy]; // Creating the "killFeedUpdate" public variable event handler. publicVariableServer "killFeedUpdate"; }]; } forEach allUnits; }; ----------killFeedServer.sqf---------- // Creates "killFeedServer" function to be executed in "initServer.sqf." killFeedServer = { // Only runs this script if the machine executing it is the server. if (isServer) then { // Listens for updates from the "killFeedUpdate" public variable event handler. "killFeedUpdate" addPublicVariableEventHandler { // Initalizes "_deathInfo" private array and sets it's value from the previously mentioned event handler. private "_deathInfo"; _deathInfo = (_this select 1); // If you are confused by why we used 1 and not 0 refer to "addPublicVariableEventHandler" documentation on the wiki. // Extracts each variable from the "_deathInfo" private array. _unit = (_deathInfo select 0); _killedBy = (_deathInfo select 1); // Grabs some more data by passing the previously mentioned variables through a variety of functions. _unitName = name _unit; _killedByName = name _killedBy; _distance = _unit distance _killedBy; // Formats the kill-feed statement to be displayed in the game chat. _killFeedStatement = format ["%1 was killed by %2. (%3m)", _unitName, _killedByName, _distance]; // Displays the kill-feed statement in the game chat as if it were being called in by the killer. _killedBy globalChat _killFeedStatement; }; }; };
-
A better explanation of BIS_fnc_MP and remoteExec, please?
Lucky44 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a decent understanding of locality. And I've read the Biki pages on BIS_fnc_MP and remoteExec. I understand that remoteExec is the newer, preferred approach, but that the other still works too. But I have not been able to wrap my head around the syntax/usage of either of these. So I'm asking for someone who really does understand them to expand on what the Biki has and explain the usage -not just syntax, but how to use it in different situations. A variety of examples (and why it's done the way it's done in each example, and the effects of the variations) would be awesome. Anyone able to do this? It'd be a real benefit to all of us who make multiplayer missions!- 9 replies
-
- remoteExec
- BIS_fnc_MP
-
(and 3 more)
Tagged with:
-
I have searched both google and the forums for this and see a couple answers to this question that do not make sense to me. I have a couple different firing ranges for my unit that are run via script. They work correctly in both hosted and on the dedi with one small exception. The rangemaster - which is a recording of one of our members played in the script - only executes on the player that activated the firing range, even though the range itself is working for every player on the server. I am 100% sure that it is a locality issue, as the addAction that calls the sqf is located in the init.sqf of the mission. I keep finding answers that have things like this: [Computadora1, ['Disparar a Barco',{<your code here>}] ] remoteExec ["addAction",0,true]; But I do not understand exactly what it all means as most people just provide a script and not an explanation of why it fixes the issues. My question is: how do I execute the addAction in game via remoteExec so that all players can both see the range and hear the rangemaster? Below is a snippet of my range code that involves the recordings - just to ensure that I haven't made a boneheaded error. init.sqf range4.sqf (partial) Thank you all in advance for the help!
- 19 replies
-
- 1
-
- addaction
- remoteexec
-
(and 2 more)
Tagged with:
-
Cannot get SP/Server script to work the same when called by Clients!
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I really need some help here guys, this script has been keeping me up for the last 6 days and nothing seems to make it work correctly when called by Clients connected the my Hosted Server (No errors thou): The first part when executed on the server (host player) works perfectly, I left it in inside the If (isServer) as a reference to the simplest version that works for the server. Then under the If (!isServer) is the reworked script that I made for the clients. Lots of options that I tried are now with // just as reference to what I tried with no success.-
- multiplayer
- remoteexec
-
(and 2 more)
Tagged with:
-
Client moving a Helipad placed using the Eden Editor (Server) via remoteExec
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello guys. I need your help once again. I have this line of code working perfectly for the Server Host: openMap true; MapClicked = false; onMapSingleClick "HHH setPos [_pos select 0,_pos select 1, 0] ;(group transportHeli) move _pos; MapClicked = true; onMapSingleClick ''; true;"; Where HHH is the name of a Helipad placed on the Eden Editor. That previous line does not work in MP of course since when a client calls the script the helicopter with crew (also placed via Editor) nor the Helipad move to the onMapSingleClick location. I've tried the following remoteExec code: onMapSingleClick "[HHH,[_pos select 0,_pos select 1, 0]] remoteExec ["setPos", HHH]; [(group transportHeli),[_pos]] remoteExec ["move", (group transportHeli)]; MapClicked = true; onMapSingleClick ''; true;"; But I get this error: Error SETPOS: TYPE ANY , EXPECTED OBJECT. If I remove: "[HHH,[_pos select 0,_pos select 1, 0]] remoteExec ["setPos", HHH]; And just leave: [(group transportHeli),[_pos]] remoteExec ["move", (group transportHeli)]; Then the error is: Error MOVE: TYPE ANY , EXPECTED OBJECT. But I double checked and the location of both the SetPos and Move commands on the remoteExec are in the correct location and should be working... BIS BUG? Any ideas on how I can solve this issue and/or any other method to get the client to move the server placed helicopter on command? Thanks in advanced.- 3 replies
-
- setpos
- remoteexec
-
(and 2 more)
Tagged with:
-
Hey, I have a dialog that opens in the target player (You execute the createDialog and the player see it) but i don't know how to use ctrlSetText with that
-
remoteExec from initplayerlocal.sqf
Vandeanson posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Good evening, I have been looking into remoteExec as a mean to create a random loadout generator that would work in MP. This would be the code to execute: The initplayerlocal.sqf file contains this code: From the BI wiki I understood that the target could be an object, so i understand player or player would receive a unit ID and the script would only execute this on the client where initplayerlocal was initialized. I have no means to test this atm (with another client or dedicated server) - could someone advise if i use this correctly? thanks a ton! vd -
Help with remoteExec and class CfgFunctions
cklymowsky posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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? -
Who is the person that got the remoteExec ?
JeyR posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright. Welcome everyone. I have a very interesting problem, and I couldn't find a solution for it. I have been really trying to get past this but I can't solve this riddle. I have this small code snippet inside the initPlayerLocal.sqf: if (didJIP) then { [getPlayerUID player] remoteExecCall ["CHAB_fnc_jipcam",[-2,-(clientOwner)],false]; }; And here is the CHAB_fnc_jipcam: _uid = _this select 0; private "_player"; private "_local"; private "_localID"; { if ((getPlayerUID _x) isEqualTo _uid) then{_player = _x;}; } forEach allPlayers; _local = ???; _localID = ???; As you can see, I clearly have no clue who is the owner of machine ? In my mind's eye remoteExec sends a message to every player that they have to run this script with the given parameters. Here is what I tried so far: Create a global variable (not public) for each player and give it the playerUID -> Result is that inside the jipcam the returned value is "any" on each PC. Create a missionnamespace variable (global but not public) and give it the playerUID -> same results as before I have completely run out of ideas, I tried mostly everything I could think of. Is there anyone who has more tricks up his sleeve?- 24 replies
-
- remoteexec
- global variables
-
(and 4 more)
Tagged with:
-
Passing Script Variable as Argument in remoteExec
barbolani posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi! For building some kind of "dynamic headless client assignator" on which a unit spawning script can me called from any client to the idelest client, I have the issue that commands such as owner or groupOwner are server only. Which means only the server can know in real time which client is running more AIs and select the one with less of them. My workaround is to make some kind of server side scheduler which you remoteExec from any client, the scheduler checks the idlest client and sends the real script and params to the right client. So syntax could be something like: [arrayofParams,scriptVariableName] remoteExec ["scheduler",2] Example: [[targetPosition,numberOfGroups,typeOfAttack],spawningAttackScriptVarName] remoteExec ["scheduler",2] Got the idea? Ok, my doubt is related to the script variable name: what is passed through the network, just the var name or the whole code behind it? Because behind that variable I may have a thousand lines of code.... I ask you because I find very difficult to test this and know what's happening in the engine. Thanks in advance! -
remoteexec addaction conditions
Sanchez Milsim posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, i would like to addaction to object with remoteexec but i dont know how or where to place conditions of distance. I usually use addaction as this: this addAction ["Pick up INTEL","scripts\add_intel.sqf",[],1,false,true,"","_this distance _target < 2"]; And i would like to merge this with remoteexec addaction [this,["Pick up INTEL", {"scripts\add_intel.sqf"}]] remoteExec ["addAction",2]; Thanks for help!!- 3 replies
-
- addaction
- remoteexec
-
(and 2 more)
Tagged with: