-
Content Count
377 -
Joined
-
Last visited
-
Medals
Everything posted by thy_
-
remoteexec [SOLVED] Issues on dedicated server: can't find more than 1 player
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Working with multiple players on a dedicated server beautifully, @7erra! ๐ -
remoteexec [SOLVED] Issues on dedicated server: can't find more than 1 player
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
So, I'll test these changes on the dedicated server tonight: * Edited with the last @7erra advice in Feb, 28th: // FROM THIS: systemChat "Checking the ammunition..."; // TO THIS: ["Checking the ammunition..."] remoteExec ["systemChat", _x]; // ------------- // FROM THIS: _x setFuel 1; // TO THIS: [_x, 1] remoteExec ["setFuel", _x]; // ------------- // FROM THIS: _x setVehicleAmmo 1; // TO THIS: [_x, 1] remoteExec ["setVehicleAmmo", _x]; Later I go back with the result. * Edited: worked very well in server hosted and dedicated server ๐ -
checking How to detect if the veh has weaponry positions and needs to rearm? [SOLVED]
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
When the vehicle is around the Rearm Station, the player along with it, and the vehicle has already spent one bullet of its ammunition at least. Here above we're verifying if the vehicle has mags only. I am trying to rearm vehicles with weaponry available, yep, but if the vehicle has weaponry, I would like to rearm as full as possible. Today the rearming of the vehicle with weaponry never ends and just one mag is rearmed, even when we have other 3 mags slots available. This is my current code of that section: // code... // _eachPlayerVeh = _x; // code of if veh is close enough to rearm station, then... if ( (alive _x) AND (speed _x < 2) ) then { _allMags = []; _magsArray = magazinesAllTurrets _x; { _mag = _x select 0; _allMags pushBack _mag; } forEach _magsArray; if (count _allMags > 0) then // missing to identify if ammo was spent... { // code... [_x, 1] remoteExec ["setVehicleAmmo", _x]; // code... systemChat "Rearmed."; // code... } else { // code... systemChat "No rearming required."; }; }; // code...- 11 replies
-
- detecting
- vehicle weapons
- (and 4 more)
-
remoteexec [SOLVED] Issues on dedicated server: can't find more than 1 player
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Now the Github repository is public! EDITED FEB 27th: Oh, now I got it why these icon below. Cool, @7erra. I will study remoteExec today and make my tries. -
checking How to detect if the veh has weaponry positions and needs to rearm? [SOLVED]
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Harzach, I forgot to tag you! hehe ๐ my hero!- 11 replies
-
- detecting
- vehicle weapons
- (and 4 more)
-
checking How to detect if the veh has weaponry positions and needs to rearm? [SOLVED]
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have an issue with when to rearm a vehicle. if ( (configFile >> "CfgMagazines" >> _playerVeh select 0 >> "count") != _x select 1} count (magazinesAmmo _x)) > 0 ) ) then { _playerVeh setVehicleAmmo 1; systemChat "Your vehicle is rearmed!"; }; In the example above, it works fine until the vehicle is completely out of ammo. In this case, the setVehicleAmmo never happens. In the first look, just change that "> 0" to ">= 0" and everything looks fine, but no. If we do that, all vehicles even those ones with no weaponry will print that systemChat. EDIT: And if the vehicle has an external gun like those technical trucks, unfortunately, my code's rearming just ONE magazine in not 3 when that is full of ammo. ๐- 11 replies
-
- detecting
- vehicle weapons
- (and 4 more)
-
params [SOLVED] How to use PARAMS to call the function through the unit INIT?
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Fixed. Yep, I missed that "fn" detail. Now I got why we're reporting different behavior: I'm setting this... [this, 5] spawn THY_fnc_addingHelmet; ... in each AI unit and not the player as you told me. I missed that piece of your instruction. My bad. Everything works fine now. ๐ Solved!- 6 replies
-
- 1
-
-
- functions
- first steps
-
(and 2 more)
Tagged with:
-
params [SOLVED] How to use PARAMS to call the function through the unit INIT?
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
@alpha993 thanks for your detailed answer! In your method, when the mission gets started, all units calling the function receive the helmet instantaneously, even when the player is not close. Also, there is an odd condition that makes the "adding helmet" behaviors weird... sometimes working, sometimes not. So to make two changes: // before _validUnitsArray = _unitsArray select {(headgear _x != "H_HelmetB") AND (_x != _unit)}; // now _validUnitsArray = _unitsArray select { headgear _x != "H_HelmetB" }; and // before { removeHeadgear _x; _x addHeadgear "H_HelmetB" } forEach _validUnitsArray; // now { if ( (player distance _x) <= _radius) then { removeHeadGear _x; _x addHeadGear "H_HelmetB"; }; } forEach _validUnitsArray; So the changes are working fine: myFunctions\fn_addingHelmet.sqf if (!isServer) exitWith {}; // private variables declaration... // params declaration... While {alive _unit} do { _unitsArray = nearestObjects [_unit, ["CAManBase"], _radius]; _validUnitsArray = _unitsArray select { headgear _x != "H_HelmetB" }; { if ( (player distance _x) <= _radius) then { sleep 2; removeHeadGear _x; sleep 0.1; _x addHeadGear "H_HelmetB"; hint "Thanks for the helmet!"; sleep 3; hint ""; }; } forEach _validUnitsArray; sleep 1; }; And just letting you know: in that way, with no "static" path declaration, basically the mission cannot find out the "fn_addingHelmet.sqf". I've tried many times, even following the best practices although it only works as an example I've copied from another example. Take a look: myFunctions\THY_functions.hpp class THY_functions { tag = "THY"; class myFunctions { class addingHelmet { file = "myFunctions\fnc_addingHelmet.sqf"; // with static path it works pretty fine! //preInit = 1; }; }; }; Then I have some questions: 0) Dynamic path in THY_functions.hpp looks much better, so if you have a clue what's going on there... 1) What if is we add a default radius number? Just to create a default value but without losing that flexibility to change the radius directly in unit init... 2) What's CAManBase mean? I did not make deep research on it yet. Is it means unit soldiers as "Man" or, even further, "LandVehicles" when do we use it in isKindOf?- 6 replies
-
- functions
- first steps
-
(and 2 more)
Tagged with:
-
script [Release] CSWR: Automatizing the war
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
POST EDITED: I already fixed it. -
dedicated server What initial "WaitUntil player" is perfect for multiplayer in Dedicated Server?
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Good one! I believe that this is already widespread and there are no questions as to each file's goal. The question - and my fault for not describing it better - is whether some lines of code would be needed to validate the players in the init.sqf itself. Based on what has already been said, so the init.sqf template for multiplayer on a dedicated and hosted server is blank/empty. Thank you all! I will test these amends and later in the week the results will be here. -
dedicated server What initial "WaitUntil player" is perfect for multiplayer in Dedicated Server?
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
You mean, in both init files described by @alpha993? And what about the init.sqf? Should be empty? https://community.bistudio.com/wiki/Initialization_Order -
dedicated server What initial "WaitUntil player" is perfect for multiplayer in Dedicated Server?
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
True ๐ https://community.bistudio.com/wiki/Arma_3:_Headless_Client. (It's been edited there) -
execvm null = [ ] execVM vs execVM vs remoteExec BIS_fnc_execVM
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Harzach and @opusfmspol, morning (here is 10h55), After some tests and thoughts regarding what is needed to be called from execVM and what must be part of CfgFunctions, basically, my conclusion is: about performance saving, CfgFunctions are better (compile once even if I want to check something repeatedly), as well as for main base protection from the point of view my mission has 18 slots and 30 vehicles to "protect" in two main bases in-game. Despite (and I don't know why), when I think CfgFunctions, it looks like I won't use while-looping anymore, or at least not so frequently. Make any sense? Briefly, I am in love with CfgFunctions. Some advice? On other hand, execVM I am using (successfully) to change the time-matches, sometimes in the night, some in the morning, although that script is so simple that I'm running it once at mission start by initServer.sqf > execVM.- 6 replies
-
- init.sqf
- initplayerlocal.sqf
-
(and 1 more)
Tagged with:
-
script [Release] CSWR: Automatizing the war
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Script updated. First message has been updated. Cheers. -
checking How to detect if the veh has weaponry positions and needs to rearm? [SOLVED]
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
EDIT: Works beautifully. Btw, I have found this one right now: https://community.bistudio.com/wiki/BIS_fnc_allTurrets- 11 replies
-
- detecting
- vehicle weapons
- (and 4 more)
-
execvm null = [ ] execVM vs execVM vs remoteExec BIS_fnc_execVM
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's gold right above, man. Let me think and run some tests. Yesterday we were 9 players in our dedicated server and, running the protection mainbase through initPlayerLocal.sqf (using "player" instead "allPlayers") everything ran right, except for one of us that sometimes we got kill him. Super weird but, based on what you said, that makes sense. Let me try some fixes and later I come back here with details and results.- 6 replies
-
- init.sqf
- initplayerlocal.sqf
-
(and 1 more)
Tagged with:
-
execvm null = [ ] execVM vs execVM vs remoteExec BIS_fnc_execVM
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm working in that main bases protection script that you have seen me talking about on another topic. Well, last night I ran a few tests into a dedicated server and when I called the script through initServer.sqf or init.sqf everyone were able to kill and destroy things within mainbases ... the total opposite of my goals hehe. But if I remember well, it works(?) after the caller (execM) is transferred to initPlayerLocal.sqf. In your reading, can you see why? No idea here. initPlayerLocal.sqf // MAINBASES PROTECTION execVM "mainBasesProtection.sqf"; mainBasesProtection.sqf private [/* lots of private variables here */]; //if (!hasInterface) exitWith {}; // if is not a player, get out! 0 = [] spawn { while {true} do { // SOME CODE WHERE I'M CHECKING IF PLAYER IS INTO MAINBASE. IF SO, THEY ARE IMMORTAL AS THE VEHICLES WHEN HERE. // NOTHING MORE ELSE! }; };- 6 replies
-
- init.sqf
- initplayerlocal.sqf
-
(and 1 more)
Tagged with:
-
[Release] GOM - Aircraft Loadout V1.35
thy_ replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi there, hey @Grumpy Old Man, At first, this script is outstanding, thanks! In my solitary tests where I'm hosting the mission and only I'm in the match, everything works fine. On the dedicated server, there are two odd reactions: The menu to open the loadout is cloned by the number of players in the game (image below); Not everyone sees all available aircraft in the left column within the HUD GOM (all aircraft are within the aircraft collection radius / some players can see the full list normally); PS: dedicated server was loaded with CBA+ACE, but the mission has no dependencies. No clue yet if no mods loaded on the server the mission behaviors change... Code piece where I did the translation seen in the image: //PATH: \tanks-and-helicopter-light.altis\vehicleLoadouts\functions\GOM_fnc_aircraftLoadoutInit.sqf // A LOT OF CODE... GOM_fnc_addAircraftLoadoutToObject = { params ["_object"]; _action = ["EN: Edit aircraft loadout<br/>PT: Editar armamento da aeronave",{params ["_caller"];[_caller] spawn GOM_fnc_aircraftLoadout},[],0,true,true,"","_this isEqualTo vehicle _this AND {speed _this < 3} AND {alive _this} AND {alive _target}"]; [_object,_action] remoteExec ["addAction",[0,-2] select isDedicated,true];//compatibility check added, and JIP true }; // A LOT OF CODE... What other modification did I do? // GOM_fnc_aircraftLoadoutInit.sqf _vehicles = (_obj nearEntities ["Air",400]) select {speed _x < 5 AND {alive _x} AND {isTouchingGround _x}}; // Line: 1952 // I've changed from 50 to 400. and nothing more. Mission description.ext //BASIC CONFIGS class Header { gameType = Coop; minPlayers = 2; maxPlayers = 18; }; // About onLoadName = "TANKS & CHOPPERS (LIGHT)"; author = "thy"; overviewPicture = "images\thumb.jpg"; onLoadMission = "Clean the towns with armored and choppers."; // Gameplay joinUnassigned = 0; enableTeamSwitch = false; respawn = 3; respawnOnStart = 1; respawnButton = 1; respawnDelay = 10; respawnTemplates[] = { "MenuPosition", "MenuInventory", "Wave" }; respawnDialog = 0; debriefing = 1; saving = 0; enableDebugConsole = 1; // Performance DisabledAI = 1; corpseManagerMode = 1; corpseLimit = 10; corpseRemovalMinTime = 600; corpseRemovalMaxTime = 600; wreckManagerMode = 1; wreckLimit = 10; wreckRemovalMinTime = 1200; wreckRemovalMaxTime = 1200; // CBA MOD cba_settings_hasSettingsFile = 0; // ROLES #include "roles.hpp" // ROLE LOADOUTS class CfgRespawnInventory { // air team #include "loadouts\rolesLoadoutAirPilot.hpp" #include "loadouts\rolesLoadoutAirPilotDrone.hpp" // ground team #include "loadouts\rolesLoadoutGroundCrew.hpp" #include "loadouts\rolesLoadoutGroundInfantryRM.hpp" #include "loadouts\rolesLoadoutGroundInfantryAR.hpp" #include "loadouts\rolesLoadoutGroundInfantryMD.hpp" }; // T8AI (PART 1/2) #include "T8\CONFIG.hpp" class CfgFunctions { // T8AI (PART 2/2) #include "T8\FUNCTIONS.hpp" // VEHICLES RESPAWN #include "vehiclesRespawn\CfgFunctions.hpp" //GOM AIRCRAFTLOADOUT V1.35 (PART 1/2) #include "vehicleLoadouts\functions\GOM_fnc_functions.hpp" // <------------------------------------------- }; //GOM AIRCRAFTLOADOUT V1.35 (PART 2/2) class CfgCommunicationMenu { #include "vehicleLoadouts\functions\GOM_fnc_aircraftLoadoutMenu.hpp" // <------------------------------------------- }; #include "vehicleLoadouts\dialogs\GOM_dialog_parents.hpp" // <------------------------------------------- #include "vehicleLoadouts\dialogs\GOM_dialog_controls.hpp" // <------------------------------------------- Script files path in mission: \tanks-and-helicopter-light.altis\vehicleLoadouts\functions\ \tanks-and-helicopter-light.altis\vehicleLoadouts\dialogs\ Mission init.sqf if (!isDedicated) then { waitUntil { !isNull player; }; [] call compile preProcessFileLineNumbers "briefing.sqf"; }; if (hasInterface) then { [] spawn { waitUntil { sleep 0.1; !isNull player; }; }; }; Mission initPlayerLocal.sqf // PLAYERS LOADOUTS ["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups; // plus, look the initServer.sqf // VEHICLE ROLE RESTRICTIONS "vehiclesRestriction.sqf" remoteExec ["BIS_fnc_execVM"]; // MAINBASES PROTECTION execVM "mainBasesProtection.sqf"; // VEHICLE OVERHAULING execVM "vehiclesOverhauling.sqf"; Mission initServer.sqf // ENVIRONMENT RANDOMIZER "environmentRandomizer.sqf" remoteExec ["BIS_fnc_execVM"]; // PLAYERS LOADOUTS ["Initialize", [true]] call BIS_fnc_dynamicGroups; // plus, look the initPlayerLocal.sqf // Air [west,"loadoutAirPilot"] call bis_fnc_addRespawnInventory; [west,"loadoutAirPilotDrone"] call bis_fnc_addRespawnInventory; // Ground [west,"loadoutGroundCrew"] call bis_fnc_addRespawnInventory; //[west,"loadoutGroundCrewDrone"] call bis_fnc_addRespawnInventory; [west,"loadoutGroundInfantryAR"] call bis_fnc_addRespawnInventory; [west,"loadoutGroundInfantryMD"] call bis_fnc_addRespawnInventory; [west,"loadoutGroundInfantryRM"] call bis_fnc_addRespawnInventory; // REMOVING SOME UNWANTED ASSETS FROM MAP private _allTerrainObjects = nearestTerrainObjects [ [worldSize / 2, worldSize / 2], ["POWERWIND","TRANSMITTER","POWERSOLAR","POWER LINES","FUELSTATION"], worldSize * sqrt 2 / 2, false ]; { _x hideObjectGlobal true } forEach _allTerrainObjects; // T8 EXECUTION execVM "T8_missionEXEC.sqf"; Some clue about it? What should I provide to make this easier? The mission: https://steamcommunity.com/sharedfiles/filedetails/?id=2424050518 -
sandbox [Release] Suicidal Doctrine Script
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Script updated. First topic message updated. ๐ Changelog v1.3 - Feb, 17th 2022 Calling the script through initPlayerLocal.sqf istead of initServer.sqf (fixing desync nearest targeting in dedicated servers); VBIED with mega explosion (5x bigger than before) even if the VBIED has the same ammo of other suicide methods (a car will be much more loaded of explosives than a vest/best); fixed the "suicidalEnemy" variable description (it the suicidal enemy side and not the suicidal side); added a note in description.ext saying just a piece of that file is needed by script.- 14 replies
-
- 3
-
-
My cute A3 dudes, need some help here. Look this simple example: { if ( (_x distance getMarkerPos markerMainbase) < 100 ) then { hint "To fight, I must leave the mainbase area!"; }; } forEach _playersAlive; Now, how can I code for the same message to NOT be shown for players in gunner positions in UAV's from _arrayMyDrones? I already read this content but all my tries are failing... ๐ https://community.bistudio.com/wiki/UAVControl https://community.bistudio.com/wiki/connectTerminalToUAV https://community.bistudio.com/wiki/isUAVConnected https://community.bistudio.com/wiki/getConnectedUAV
-
uavcontrol [SOLVED] Show this, except for all players in UAV Gunner position (Help!)
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for said that, @Harzach. I've thinking and a smart move to do is remove that that addEventHandler "firedman" to preserve the game performance. And putting that aside, it loses the point of identifying whether or not the UAV gunner is operating a UAV. Soon I will release my mainbase protection here in BIS forum. Anyone, thanks for support ๐ -
uavcontrol [SOLVED] Show this, except for all players in UAV Gunner position (Help!)
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Almost there. Your code works and I must study it a bit longer to understand how to build it below: a mainbase fire protection where you are NOT able to shoot from within, except whether you're a UAV crew who will play the role from the mainbase insides. Piece of code: private ["_arrayMyDrones","_headlessClients","_playersAlive","_playersInUAV","_isUavGunner","_playerFiring","_projectile"]; if (!isServer) exitWith {}; _arrayMyDrones = [uav01, uav02, uav03]; 0 = [] spawn { while {true} do { _headlessClients = entities "HeadlessClient_F"; _playersAlive = (allPlayers - _headlessClients) select {alive _x}; { // _playersInUAV is all _playersAlive connected in a UAV: _playersInUAV = getConnectedUAV _x; // _isUavGunner is the player alive who gets the gunner position in a UAV: _isUavGunner = (UAVControl _playersInUAV#1); // if the player alive is NOT the gunner in a UAV, so... if ( _isUavGunner != "GUNNER" ) then { // You CANNOT firing from the mainbase: _x addEventHandler ["firedman", { _playerFiring = _this select 0; _projectile = _this select 6; if ( _playerFiring distance (getMarkerPos "blu-air-mainbase") < 300 ) then { deleteVehicle _projectile; "STOP!" hintC ["Don't fire from inside the base!"]; }; }]; }; } forEach _playersAlive; sleep 1; }; }; When I run the code below, I try these behaviors from INSIDE the mainbase protection: ...the soldier fires their handgun, the projectile is deleted and shows up a message (CORRECT โ๏ธ); ...the soldier connect the UAV, leave the UAV still on, takes their handgun and fire. The projectile is deleted and shows up a message (CORRECT โ๏ธ); ...the soldier connects the UAV and, as GUNNER, fires. The projectile is deleted and shows up a message (CORRECT โ๏ธ); ...the soldier connects the UAV and, as DRIVER, fires. The projectile hits something (INCORRECT โ, should be deleted as well); When I run the code below, I try these behaviors from OUTSIDE the mainbase protection (but UAV crew keeps inside the mainbase): ...the soldier fires their handgun. The projectile hits something (CORRECT โ๏ธ); ...the soldier connects the UAV and, as GUNNER, fires. The projectile is deleted and shows up a message (INCORRECT โ, should be allowed outside the main) ...the soldier connects the UAV and, as DRIVER, fires. The projectile hits something (CORRECT โ๏ธ); Some ideas to fix those bad behaviors? -
uavcontrol [SOLVED] Show this, except for all players in UAV Gunner position (Help!)
thy_ replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Let me try, @Harzach! ๐ -
allmissionobjects How to identify land-vehicles when they approach a classname object?
thy_ replied to thy_'s topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
I got it with https://community.bistudio.com/wiki/allMissionObjects So... _arrayStationClasses = ["Land_RepairDepot_01_civ_F","Land_RepairDepot_01_green_F","Land_RepairDepot_01_tan_F"]; //classes array _arrayStations = []; // lets populate it! { // lets find out only the objects of classnames listed in _arrayStationClasses throught the allMissionsObjects array. _arrayStations = _arrayStations + allMissionObjects _x; } forEach _arrayStationClasses; //repeat the search for each classename into the _arrayStationClasses. While {true} do { { if ((player distance _x) < 10) then // if the player get close to any repair station with its classname listed above, so... { hint "Yeah, I'm in a station!" }; } forEach _arrayStations; sleep 2; }; -
allmissionobjects How to identify land-vehicles when they approach a classname object?
thy_ replied to thy_'s topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Yeah, I keep reading and trying to turn my programming limitations hehe.. so the question is How can I populate my _arrayStations with only those objects in _arrayStationClasses dropped in Eden Editor? _arrayStationClasses = ["Land_RepairDepot_01_civ_F","Land_RepairDepot_01_green_F","Land_RepairDepot_01_tan_F"]; //classes array _arrayStations = []; { _arrayStations = _arrayStations + //HOW CAN I POPULATE MY _arrayStations WITH ONLY THOSE OBJECTS IN _arrayStationClasses DROPPED IN EDEN EDITOR? } forEach _arrayStationClasses;