Search the Community
Showing results for tags 'local'.
Found 14 results
-
MP Execute script only for players within a certain distance.
Mr H. posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi! So here's my problem: I want a script to execute only for players within hearing distance of a NPC The script will be executed from another script, the latter being launched from an addaction. I want the script to execute only on the machines of players nearby but obviously can't use a trigger area to count them. How should I go about it?- 7 replies
-
- 1
-
-
- multiplayer
- script
-
(and 2 more)
Tagged with:
-
playsound3d playSound3D local parameter not working
Dj Rolnik posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey everyone, I am trying to use the playSound3D function with the "local" parameter that has been introduced in 2.06, but I cannot get it to work. Either I'm not getting it or doing something wrong. Basically, when using the function syntax and putting in all the parameters the sound seems to play just fine, however as soon as I add the last parameter (either set to true or false) the sound does not play at all. What I would love to have is this function BE local, as in, the sound played to be heard only by the player triggering it. Now I know the function itself says its effect is global by default (GE), so it makes me wonder whether the "local" parameter is not working or it is something completely different. Thanks for your help in advance! https://community.bistudio.com/wiki/playSound3D -
EventHandler Increment Internal Variable or Local Variable
Dominicus1165 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is on a multiplayer server. It must work there. I want to breach a door via Slug Ammo. I placed a wooden plank the size of the door in front of it. After two hits the plank gets destroyed and the door opens. I want to use this script multiple times during my mission. Therefore, I don't want n variables counterPlank0 - counterPlankN I want to save the counter locally. Called in init of plank: [this] execVM "scripts\eh_slugBreach.sqf" File: Working with global variable: Not working with setVariable: params ["_object"]; _counterplank = 0; _object setVariable ["counterPlank", _counterPlank]; DIFFERENCE _object addMPEventHandler ["MPHit", { params ["_unit", "_causedBy", "_damage", "_instigator"]; if (currentMagazine _instigator isEqualTo "rhsusf_5Rnd_Slug") then { _unit setVariable ["counterPlank", _counterPlank + 1]; DIFFERENCE }; if (_unit getVariable "counterPlank" > 1) then { DIFFERENCE deleteVehicle _unit; myBuilding animateSource ["Door_1_sound_source", 1]; }; }];- 2 replies
-
- multiplayer
- eventhandler
-
(and 4 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:
-
Is there a way to play multiplayer with no internet?
Eli Little posted a topic in ARMA 3 - QUESTIONS & ANSWERS
Good day all, I have an upcoming deployment and am curious if the people I work with ( we all have the game) are able to host a offline server and play while we are away. thanks in advance. -
params wogz187 learns Function Call Params
wogz187 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm going to learn how to use params in order to make future scripts more effective and you might learn something about params, too (please use the debug console if you want to follow along). A simple example, fnc_learnThis= { params ["_caller","_some","_thing","_luck"]; if (_luck>0) exitWith { systemChat format ["%1", _caller]; systemChat format ["%1 %2", _some, _thing]; }; }; With some luck this call will prompt the functions to run with the parameters set, [player, "is", "cool",1] call fnc_learnThis; The next example shows how to select from an array and sub-array. We can create some helpers and make the orb jump between them. Make three sets so the result isn't binary. Create the array of helpers from named objects like this, Enter the function, and call the function with, [orb, 0] call you_fnc_help; The orb should continue to go around between the three helpers each time you enter the call. To change to the next helper group, [orb, 1] call you_fnc_help; More examples continue throughout the discussion below, Have fun! -
Variable not defined when using local variable
SSgt 'Ice Cold' Sykes posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I'm trying to set up a minefield module via script. I get an error when using local variables while everything works fine with global variables. If anyone could tell why that'd be great. Here's my code : POP_fnc_Minefield = { if ((typename _this != "ARRAY") or (count _this < 3)) exitWith {hint format ["Error : POP_fnc_Minefield argument : %1", _this];}; _MineGroup = createGroup [(_this select 0), true]; _pos = _this select 1; _FieldSize = _this select 2; if (count _this <= 3) then {_NbMines = floor(_FieldSize/2);} else {_NbMines = floor(_FieldSize/2*(_this select 3));}; if (count _this <= 4) then {_MineType = "APERSMine";} else {_MineType = this select 4;}; if (count _this <= 5) then {_FieldCond = TRUE;} else {_FieldCond = _this select 5;}; _Minefield = "Site_Minefield" createUnit [ _pos, _MineGroup, format [ "this setVariable ['minescount', '%1']; this setVariable ['minestype', '%2']; this setVariable ['axisa', '%3']; this setVariable ['axisb', '%3']; this setVariable ['shape', 'Rectangle']; this setVariable ['side', 'Independent']; this setVariable ['marked', 'Friendlies']; this setVariable ['conditionofpresence', '%4'];", _NbMines, _MineType, _FieldSize, _FieldCond ] ]; }; This code throws undefined variable errors but if replace _NbMines, _MineType, _FieldCond with NbMines, MineType, FieldCond then everything seems to work fine.- 3 replies
-
- variable
- not defined
-
(and 2 more)
Tagged with:
-
Hey! I've been trying to make a IED script that uses a triggerman instead of the commonly found pressure plate. So far it's early in "development" but eventually I'm aiming for it to become dynamic and able to spawn random death traps all over the chosen map. The problem I've encountered and need help with is that my local variable doesn't work in a trigger. // Pick a spawnpoint _spawnPoint = selectRandom [ "spawn_garage", "spawn_hotel", "spawn_hotel_2", "spawn_shop", "spawn_office", "spawn_binocular", "spawn_suicide", "spawn_minaret", "spawn_wall" ]; // Spawn IED man _bomberGroup = createGroup [East, True]; _bomber = _bomberGroup createUnit ["LOP_AM_OPF_Infantry_Engineer", getMarkerPos _spawnPoint, [], 0, "CAN_COLLIDE"]; _bomberGroup setBehaviour "careless"; //removeAllWeapons _bomber; _bomber setCaptive true; _bomber disableAI "MOVE"; _bomber setUnitPos "UP"; _bomber_weapon = currentWeapon _bomber; // Custom scripts depending on which spawnpoint is chosen switch (_spawnPoint) do { case "spawn_garage": { hint "GARAGE"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 4.040]; }; case "spawn_hotel": { hint "HOTEL"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 3.798]; }; case "spawn_shop": { hint "SHOP"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 4.292]; }; case "spawn_office": { hint "OFFICE"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 5.787]; }; case "spawn_binocular": { hint "BINOCULAR"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 3.403]; }; case "spawn_suicide": { hint "SUICIDE"; }; case "spawn_minaret": { hint "MINARET"; _bomber setPos [getPos _bomber select 0, getPos _bomber select 1, 19.424]; }; case "spawn_hotel_2": { hint "HOTEL_2"; }; case "spawn_wall": { hint "WALL"; }; default { hint "ERROR! No spawnpoint chosen"; }; }; // Make bomber face IED _dir = _bomber getDir IED_L; _bomber setDir _dir; _bomber setFormDir _dir; // Spawn weapon next to bomber //_wh = "WeaponHolderSimulated" createVehicle position _bomber; //_wh addWeaponCargoGlobal ["rhs_weap_akm",1]; //_wh addMagazineCargoGlobal ["rhs_30Rnd_762x39mm",1]; //_wh setPos (getpos _bomber); _wh = "GroundWeaponHolder_Scripted" createVehicle position _bomber; _wh setPosAtl (getPosATL _bomber); _bomber action ["DropWeapon", _wh, _bomber_weapon]; // Create a trigger on triggermans position to make him combat any player that gets close // ###THIS IS WHERE IT GETS FUCKY### _trgr_bomber_1 = createTrigger ["EmptyDetector", getPos _bomber, true]; _trgr_bomber_1 setTriggerArea [10, 10, 0, false]; _trgr_bomber_1 setTriggerActivation ["ANYPLAYER", "PRESENT", false]; _trgr_bomber_1 setTriggerStatements ["this", "hint 'trigger start'; _bomber selectWeapon '_bomber_weapon'; _bomber enableAI 'MOVE'; _bomber setUnitPos 'AUTO'; _bomberGroup setbehaviour 'COMBAT'; _bomber setCaptive false;", "hint 'trigger end'"]; // Testing to see if set to careless because he kept on throwing grenades // Somehow AI still do that in careless I guess? sleep 5; _b = behaviour _bomber; hint format ["%1", _b]; /* ACE Detonation Needs to be fixed No clue how to use this at all // Connect explosives to bomber [_bomber, IED_L, "Cellphone"] call ace_explosives_fnc_connectExplosive; sleep 30; // Boom? [{ ["_bomber", "3000", "IED_L", "0", "Cellphone"]; true }] call ace_explosives_fnc_addDetonateHandler; */ Basically, if you can understand my mess, I have two issues 1: the "_trgr_bomber_1" doesn't know what "_bomber" is so it can't make him pickup a gun and activate standard AI combat. 2: AI still throw grenades at me like 17th century grenadiers even though they're set to "CARELESS". Any help would be greatly appreciated and I'm pretty sure it's an easy fix for anyone who's actually a coder.
-
Script working on local host but not on server
Kill_Tha_Playah posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello fellow editors, Im working now for hours on a simple script that must activate a trigger. It works fine on my localhost, but not on my server. I can't get it to work. Could you please take a look at it and help me out. There are probatly hunderds of topics about this subject, but I seached for hours and can't figger it out. (Noob :P) ------------------------------------------------------------------------------------------ Talk script: // Quick animation. titleText ["You: You are not allow to stand here, please move back to the barrier","PLAIN DOWN"]; 10; sleep 8; titleText ["Civilian: Alright, ill go.","PLAIN DOWN"]; 10; Civbar1=true; _gen = _this select 0; _caller = _this select 1; _id = _this select 2; _gen playmove "AidlPercSnonWnonDnon_talk1"; ------------------------------------------------------------------------------------------ initServer: // ============= Variables Civbar1 = false publicVariable "Civbar1"; Civbar2 = false publicVariable "Civbar2"; Civbar3 = false publicVariable "Civbar3"; ------------------------------------------------------------------------------------------ Trigger: variable name: Civbar1 Condition: Civbar1 on Act: rocivbar1 enableAI "move"; rocivbar2 enableAI "move"; rocivbar3 enableAI "move"; trigger has a waypoint activation set ------------------------------------------------------------------------------------------ Civilian: variable name: rocivbar1 init: talk1 = this addaction ["Tell civilians to move behind barrier","Scripts\interaction\Civi\CivBar1.sqf"]; -
Hello guys, I have a mission with an integrated construction system. Players can build fortifications, I use createVehicle locally on the client for that. Some of the created objects also have eventHandlers attached to them. I now want to allow saving and later resuming the mission. I got it mostly working, however 2 questions remain: 1. Will objects created using createvehicle on a client be saved and restored? 2. I read somewhere that variables added via setVariable will be saved, what about eventHandlers though? Do I have to redo them after resuming the mission from a savegame? Thanks for all tips and guidance in advance, you guys have been of so much help already! Leander
-
properly end mission on all clients
Schismatrix posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys! I have a mission where players can choose to be blufor, opfor and independent. Each leader of a faction has an endtrigger synced to them that should end the mission when the unit enters it. I have the triggers and debriefing working fine in singleplayer, but in multiplayer I am not able to force the end on the clients even though I use [endMission, "END1" ] call BIS_fnc_MP; in the respective trigger for each side. What am I doing wrong? I found a lot of threads where people say to execute the functions on the clients, but I just can't seem to grasp how to do this. Cheers!- 9 replies
-
- multiplayer
- endmission
-
(and 3 more)
Tagged with:
-
Animations & Lifestate in Multiplayer
lawman_actual posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
As part of a multiplayer mission, there's a downed AAF pilot. The unit is setUnconscious, and had a "revive" option. Here is it's .init: if isServer then {this setUnconscious true;}; this addAction [ "<t color='#B70000'>Revive</t>", { _help = [_this select 0,_this select 1] execVM "law\pilotRevive.sqf"; pilotRevive = true; }, "",0,true,true,"","(side _this == west) && (lifeState _target == 'INCAPACITATED')",3 ]; pilotRevive.sqf the following. params [["_casualty",objNull],["_caller",objNull]]; if ((isNUll _caller) || (isNUll _casualty)) exitWith {}; if (isMultiplayer) then { (_caller) playMove "AinvPknlMstpSnonWnonDnon_medic0"; sleep 5; (_casualty) setUnconscious false; (_casualty) playMove "AinjPpneMstpSnonWnonDnon_rolltofront"; sleep 4; //was 3 (_casualty) playMove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon"; sleep 5.25; //was 1.25 [_casualty,""] remoteExec ["switchMove",0,true]; (_casualty) enableAI "ALL"; (_casualty) setUnitPos "UP"; (_casualty) setHit ["legs", 1]; (_casualty) doMove [6675.358,11257.388,0]; sleep 2; (leader group (_caller)) groupChat "The pilot thanks us."; sleep 3; (leader group (_caller)) groupChat "He says we can go. He will radio for CasEvac."; sleep 1; } else { (_caller) playMove "AinvPknlMstpSnonWnonDnon_medic0"; sleep 5; (_casualty) setUnconscious false; (_casualty) playMove "AinjPpneMstpSnonWnonDnon_rolltofront"; sleep 4; (_casualty) playMove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon"; sleep 5; (_casualty) switchMove ""; (_casualty) enableAI "ALL"; (_casualty) setUnitPos "UP"; (_casualty) setHit ["legs", 1]; (_casualty) doMove [6675.358,11257.388,0]; sleep 2; (leader group (_caller)) groupChat "The pilot thanks us."; sleep 3; (leader group (_caller)) groupChat "He says we can go. He will radio for CasEvac."; sleep 1; }; The events work fine in singleplayer; the unit rolls over, gets up and hobbles to the position with his injured leg. In multiplayer, he currently goes from down to up with no transition, and his lifestate remains unconscious. I think i'm not really understanding what needs to be executed where here. I tried executing the playMove's on each client before but I was getting reports that the unit was getting stuck in a loop of different animations and ultimately ended up still lying face down. But then I saw that playMove has a global effect, so I stopped executing it on all clients. Except now the intermediate actions all seem to be having no effect, and the sleep commands didn't seem to appear. Help would be much appreciated, since I can only test this properly on the community test server which is a pain to keep doing. Thanks, Law- 3 replies
-
- animations
- lifestate
-
(and 4 more)
Tagged with:
-
Welcome, To keep this short : _hit = 0 I want this variable to increase everytime the object _Str been hit. _Str addEventHandler ["HitPart",{_hit = _hit + 1}]; This doesn't work because the EH doesn't know the localvariable. _Str addEventHandler ["HitPart",{hit = hit + 1}]; This does work because it is a globalvariable. But i need it to be a localvariable, because there are 200 objects that are being spawned using the same variable. waitUntil {_Hit > 3}; deletevehicle _Str; I want the obj to delete itself after being hit 3 times. Is there workaround that i can use? Or maby a different way to approach this? Draoth
- 2 replies
-
- difficult
- eventhandler
-
(and 5 more)
Tagged with:
-
How to make actions global for all players
psychorange posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello lads! I'm currently making / modifying a coop mission in ArmA 3, most stuff works so far, managed to find most stuff i needed in the Forums already. Now i have a little problem, it has been explained a few times already, but i just can't seem to understand it somehow :P How can i manage to make stuff sync between all connected users ? e.g. i have some "addaction" stuff used in my mission, but some of these actions are only executed on the local client side, and not globally for all of the players. As far as i know, i will have to somehow send information (for ex. briefcase collected, which would be a addaction) to the server in which i set a server variable (for ex. briefcase_collected) to a specific value, in this case 1 / true. Then the server would share this information with all collected clients, and by changing the value of the variable, the clients would know that this task has been completed, and it would show the next. I just have no idea how i do this in arma, i am trying for quite some hours now but just can seem to get it right. I thank all of those that give me some hints in advance! B) - PsychOrange- 4 replies
-
- Variable
- Multiplayer
- (and 8 more)