PiG13BR 1 Posted June 11 Hello. It's been like years that I use this forum for searching arma stuff but never posted anything. First of all I wanna say thank you to each member of this forum that helped me a lot, indirectly. Now the problem: I'm trying to make AAS type of game using sectors (Project Reality style), by changing its markers, triggers, etc. I took some ideas from topics on this forum. The sectors are already spawned in editor and each of them has a variable name (sectorA, sectorB, sectorC, sectorD). Well, I already know how to get those variables from the sectors and modify them, and these commands are stored in functions. The problem is that when running on dedi, some commands inside the function seems not be working when I try to remoteExec targeting side (east or west), but when I target "0" or "2" works (me as a player can see the change). First I thought those commands needed to be executed by the server, but I found that that targeting using clientOwner (on debug) also works. Why isn't remoteExec working using side as target? InitServer.sqf: currentWestSectors = [ sectorA ]; // SectorA: sector (module) variable name westAttackSector = currentWestSectors select 0; // First sector west side [ westAttackSector ] remoteExec [ "PIG_fnc_updateAttackMarker", west, "JIPwest"]; fn_updateAttackMarker.sqf: params ["_sector"]; // get a reference to the trigger of this area private _trig = _sector getVariable "areas" select 0; // get the marker for this trigger private _trigMarkers = _trig getVariable "markers"; private _markerIcon = _trigMarkers select 1; // select 0 - markerArea (grid), select 1 - markerIcon (middle icon), select 2 - iconText (sector's name) // change type and color of the icon marker _markerIcon setMarkerType "o_unknown"; _markerIcon setMarkerText "Attack"; _markerIcon setMarkerColor "colorOrange"; // Make marker area visible private _trigMarkerArea = (_trig getVariable "markers") select 0; _trigMarkerArea setMarkerAlpha 1; // Change the brush _trigMarkerArea setMarkerBrush "Border"; _trigMarkerArea setMarkerColor "colorBlack"; Share this post Link to post Share on other sites
Joshua9797 38 Posted June 12 Only thing i can imagine is that these strange invalid characters have somehow made their way into the code. You can get rid of them by removing the red dots when you paste the code here in the forum and then copying the cleaned code again. Share this post Link to post Share on other sites
PiG13BR 1 Posted June 12 5 hours ago, Joshua9797 said: Only thing i can imagine is that these strange invalid characters have somehow made their way into the code. You can get rid of them by removing the red dots when you paste the code here in the forum and then copying the cleaned code again. Thanks for the reply. What kind of code did you use to show this red dot? I copied my own and didn't see that. Anyway, here is the new one: I removed some spaces. [westAttackSector] remoteExec ["PIG_fnc_updateAttackMarker", west, "JIPwest"]; Share this post Link to post Share on other sites
Joshua9797 38 Posted June 12 I just copied the code from above. But I guess that's not the problem then. Unfortunately, I have never executed my own function with remoteExec, but only an entire sqf file. The documentation says: "while any function or command can be used here, only those allowed by CfgRemoteExec will actually be executed" Maybe that is the problem? if this helps, a call to the file should look like this: ["fn_updateAttackMarker.sqf", [westAttackSector]] remoteExec ["execVM",west,"JIPwest"]; But you already said that it works with a 0 instead of “west”… Very strange. Share this post Link to post Share on other sites
PiG13BR 1 Posted June 12 4 minutes ago, Joshua9797 said: The documentation says: "while any function or command can be used here, only those allowed by CfgRemoteExec will actually be executed" Maybe that is the problem? Well I thought that aswell, but at CfgRemoteExec documentation says: "The default CfgRemoteExec in the game's main config uses an outdated format and is left for backward compatibility only (it was used directly by BIS_fnc_MP). The Client and Server classes are obsolete now. The new Remote Execution Framework ignores it (by default, all functions and commands are allowed)." I'm sure that's something about those sectors. I've already tried to execute the commands debugging it with local exec, and sometimes works, and sometimes only works on global and also only on server (very strange behaviour). I'm trying to focusing on other function (it's more important to make this AAS works) that's doing the same thing: some commands works, and some commands don't (or the client can't see the change). Seems like the there is a problem with setTriggerActivation related to these sectors. initServer.sqf currentWestSectors = [sectorA]; // Seems like the remoteExec works normally. I've already test it using normal commands like "hint". [currentWestSectors] remoteExec ["PIG_fnc_updateSectors", west, true]; fn_updateSectors.sqf params[ "_sectors" ]; { _trigger = _x getVariable "areas" select 0; // Code Below: The client can see the change (the client detects when entering a sector, it shows on the hud) _trigger setTriggerArea [10, 10, 0, false]; // Code Below: The client can't see the change (the trigger doesn't activate, the sector can't be captured). // Works on debug with server exec. _trigger setTriggerActivation ["ANY", "PRESENT", false]; _trigger settriggerstatements ["true","",""]; } forEach _sectors; I'm still thinking part of those commands has to be executed on the server to work. But I don't want that because every client would see it (because apparently sectors already do this job sending info to every player and JIP). One more info. I got it working using init.sqf, not ideal for my scenario and I'm not gonna be using this. But calling the function there works. Here's my init.sqf from this: waitUntil { time > 1 }; [sectorB] call PIG_fnc_saveDefaultMarker; if (isServer) then { sectors = [sectorA, sectorB, sectorC, sectorD]; currentEastSectors = [ sectorD ]; publicVariable "currentEastSectors"; currentWestSectors = [ sectorA ]; publicVariable "currentWestSectors"; [ sectors ] remoteExec [ "PIG_fnc_initialSetup", 0, true]; // This works fine. It hide markers and the triggers. westAttackSector = currentWestSectors select 0; // First sector west side publicVariable "westAttackSector"; eastAttackSector = currentEastSectors select 0; // First sector east side publicVariable "eastAttackSector"; sleep 0.1; }; switch (playerSide) do { case west : { // Only works if I put this function first and some sleep after it. [ westAttackSector ] call PIG_fnc_updateAttackMarker; sleep 0.1; [ currentWestSectors ] call PIG_fnc_updateSectors; }; case east : { [ eastAttackSector ] call PIG_fnc_updateAttackMarker; sleep 0.1; [ currentEastSectors ] call PIG_fnc_updateSectors; } }; Share this post Link to post Share on other sites
PiG13BR 1 Posted June 12 Doing some tests using debug directly in some of the triggers. Here is how I set up my sectors.https://imgur.com/a/WPny73N I know, I can use the sectors itself to make areas without using the logic "area". But in dedi the area from the sectors keeps out of position/out of sync (maybe it's broken idk), but sync sector > area > trigger works. About the code, setTriggerArea works in local exec, but the setTriggerActivation only works if server exec/global exec triggerA setTriggerArea [10, 10, 0, false]; // Local exec works triggerA setTriggerActivation ["west", "present", false ]; Share this post Link to post Share on other sites
PiG13BR 1 Posted June 13 Hello. Solving my own problem. I found another way.https://github.com/PiG13BR/Arma-3/tree/main/AAS_PIG 1 Share this post Link to post Share on other sites