Jump to content

PaxJaromeMalues

Member
  • Content Count

    15
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About PaxJaromeMalues

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Reported https://feedback.bistudio.com/T136751
  2. And I am back with at least SOME good news: 1. Buddy at my community looked at the code and the config viewer and was able to determine that "terc" as animationSource actually doesn't exist anymore. The term for swivel targets is now: popup_Source. 2. Even tho "Terc" is not working anymore the EH which is on the swivel by default (hitPart) actually works for whatever reason when just placed with the object and entirely left alone. This doesn't get us anywhere tho. 3. We are now able to properly animate the swivels with popup_source in combo with BIS_leaningEnabled. BUT 4. The EventHandler hitPart is still not executing at all. last try in local multiplayer did generate this error in RPT: Code currently looks like this: /////////////////////////////////////////////////////////////////////////////////////////// //Script to be called by inits or scripts for operating swivel and popup //targets around a specified object "_centerObj". //params: [ShouldTargetsAutoPop?,WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?] //By Pax /////////////////////////////////////////////////////////////////////////////////////////// params [ ["_execution", "init"], ["_distance", 500], ["_centerObj", initCenter], ["_popEnabled", false] ]; _targets = nearestObjects [position _centerObj, ["TargetBase", "Target_Swivel_01_base_F"], _distance]; switch (toLower _execution) do { case "init": { { //isKindOf Swivel else isKindOf popup if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { _x setVariable ["BIS_leaningEnabled", false, true]; _x setVariable ["BIS_poppingEnabled", false, true]; _x animateSource ["popup_Source", 1]; } else { _x setVariable ["nopop", true, true]; _x animateSource ["terc", 1]; }; }forEach _targets; }; case "setup": { //Make sure _targets are reset before running the setup phase (layerEightProtection) ["reset", _distance, _centerObj] call Fnc_popup; //Inform Instructor who asked for setup that the command was received "Command received - Targets are being setup" remoteExec ["systemChat", remoteExecutedOwner]; { if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { //Is this target told to auto-pop? _x setVariable ["rePop", _popEnabled]; //Raise the target _x animateSource ["popup_Source", 0]; //Making sure leaning is enabled for the animation _x setVariable ["BIS_leaningEnabled", true, true]; //Add Hit EH and store the EH ID on the target _x setVariable [ "HitEH", _x addEventHandler [ "HitPart", { params [ "_target", "", "", "" ]; //If auto-pop was set if (_target getVariable "rePop") then { _target setVariable [ "rePopThread", _target spawn { "AUTOPOP" remoteExec ["systemChat", remoteExecutedOwner]; sleep (1 + random 4); _this animateSource ["popup_Source", 0]; } ]; //No auto-pop set } else { //Bin Hit EH "NOPOP" remoteExec ["systemChat", remoteExecutedOwner]; ((_this select 0) select 0) RemoveEventHandler ["HitPart",0]; //Clean Shit up _target setVariable ["HitEH", nil]; _target setVariable ["rePop", nil]; }; } ] ]; } else { //Is this target told to auto-pop? _x setVariable ["rePop", _popEnabled]; //Raise the target _x animateSource ["terc", 0]; //Add Hit EH and store the EH ID on the target _x setVariable [ "HitEH", _x addEventHandler [ "Hit", { params [ "_target", "", "", "" ]; //If auto-pop was set if (_target getVariable "rePop") then { _target setVariable [ "rePopThread", _target spawn { sleep (1 + random 4); _this animateSource ["terc", 0]; } ]; //No auto-pop set } else { //Bin Hit EH _target removeEventHandler ["Hit", _thisEventHandler]; //Clean Shit up _target setVariable ["HitEH", nil]; _target setVariable ["rePop", nil]; }; } ] ]; }; } forEach _targets; }; case "reset": { //Inform Instructor of action "Command received - Targets are being reset" remoteExec ["systemChat", remoteExecutedOwner]; { //If the target for whatever reason still has an active EH: if !(isNil {_x getVariable "HitEH"}) then { //if auto-pop is set if (_x getVariable "rePop") then { //Is the target currently waiting to rePop? if (!isNil {_x getVariable "rePopThread"} && {!isNull (_x getVariable "rePopThread")}) then { //If it is waiting, terminate the Thread terminate (_x getVariable "rePopThread"); }; _x setVariable ["rePopThread", nil]; }; if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { _x removeEventHandler ["HitPart", _x getVariable "HitEH"]; _x setVariable ["HitEH", nil]; _x setVariable ["rePop", nil]; _x setVariable ["BIS_leaningEnabled", false, true]; _x animateSource ["popup_Source", 1]; } else { _x removeEventHandler ["Hit", _x getVariable "HitEH"]; _x setVariable ["HitEH", nil]; _x setVariable ["rePop", nil]; _x animateSource ["terc", 1]; }; }; //Lower the targets } forEach _targets; }; }; We still hope someone can point us into the right direction as we are somewhat at the end of our capabilities here. KR Pax
  3. Sofar I could make some progress and actually was able to terminate some possibilities for these issues. 1) Popup targets (the normal ones) now behave as expected inculding the repop delay. (Thanks again @Larrow!) 2) I tried to adapt the code from Larrow for the swivel targets based on the unknown authors mentions of "HitPart" for the EH and the weird bracketing of ((_this select 0) select 0) animateSource yadda yadda 3)The code of @pierremgi actually works when put into each swivels init via the editor. On the server the swivels will not go into weird spasms anymore and actually move back and forth as expected. BUT :P 4) Swivels will still not accept the first call of case init (meaning on mission start they just pop up and swivel along probably also ignoring BIS_poppingEnabled false) AND 5) Will not react to any bullet impact at all (which is unusual) AND 6) Will not execute the EventHandler placed on them (tested with Hit and HitPart as EH designator) This is the modified code sofar: /////////////////////////////////////////////////////////////////////////////////////////// //Script to be called by inits or scripts for operating swivel and popup //targets around a specified object "_centerObj". //params: [ShouldTargetsAutoPop?,WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?] //By Pax /////////////////////////////////////////////////////////////////////////////////////////// params [ ["_execution", "init"], ["_distance", 500], ["_centerObj", initCenter], ["_popEnabled", false] ]; _targets = nearestObjects [position _centerObj, ["TargetBase", "Target_Swivel_01_base_F"], _distance]; // Target_Swivel_01_ground_F ??! Target_Swivel_01_base_F switch (toLower _execution) do { case "init": { { //isKindOf Swivel else isKindOf popup if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { _x setVariable ["BIS_poppingEnabled", false, true]; _x animateSource ["terc", 1]; } else { _x setVariable ["nopop", true, true]; _x animateSource ["terc", 1]; }; }forEach _targets; }; case "setup": { //Make sure _targets are reset before running the setup phase (layerEightProtection) ["reset", _distance, _centerObj] call Fnc_popup; //Inform Instructor who asked for setup that the command was received "Command received - Targets are being setup" remoteExec ["systemChat", remoteExecutedOwner]; { if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { //Is this target told to auto-pop? _x setVariable ["rePop", _popEnabled]; //Raise the target _x animateSource ["terc", 0]; //Add Hit EH and store the EH ID on the target _x setVariable [ "HitEH", _x addEventHandler [ "HitPart", { params [ "_target", "", "", "" ]; //If auto-pop was set if (_target getVariable "rePop") then { _target setVariable [ "rePopThread", _target spawn { sleep (1 + random 4); //_this animateSource ["terc", 0]; ((_this select 0) select 0) animate ["Terc",1]; } ]; //No auto-pop set } else { //Bin Hit EH //_target removeEventHandler ["HitPart", _thisEventHandler]; ((_this select 0) select 0) RemoveEventHandler ["HitPart",0]; //Clean Shit up _target setVariable ["HitEH", nil]; _target setVariable ["rePop", nil]; }; } ] ]; } else { //Is this target told to auto-pop? _x setVariable ["rePop", _popEnabled]; //Raise the target _x animateSource ["terc", 0]; //Add Hit EH and store the EH ID on the target _x setVariable [ "HitEH", _x addEventHandler [ "Hit", { params [ "_target", "", "", "" ]; //If auto-pop was set if (_target getVariable "rePop") then { _target setVariable [ "rePopThread", _target spawn { sleep (1 + random 4); _this animateSource ["terc", 0]; } ]; //No auto-pop set } else { //Bin Hit EH _target removeEventHandler ["Hit", _thisEventHandler]; //Clean Shit up _target setVariable ["HitEH", nil]; _target setVariable ["rePop", nil]; }; } ] ]; }; } forEach _targets; }; case "reset": { //Inform Instructor of action "Command received - Targets are being reset" remoteExec ["systemChat", remoteExecutedOwner]; { //If the target for whatever reason still has an active EH: if !(isNil {_x getVariable "HitEH"}) then { //if auto-pop is set if (_x getVariable "rePop") then { //Is the target currently waiting to rePop? if (!isNil {_x getVariable "rePopThread"} && {!isNull (_x getVariable "rePopThread")}) then { //If it is waiting, terminate the Thread terminate (_x getVariable "rePopThread"); }; _x setVariable ["rePopThread", nil]; }; if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { _x removeEventHandler ["HitPart", _x getVariable "HitEH"]; _x setVariable ["HitEH", nil]; _x setVariable ["rePop", nil]; _x animateSource ["terc", 1]; } else { _x removeEventHandler ["Hit", _x getVariable "HitEH"]; _x setVariable ["HitEH", nil]; _x setVariable ["rePop", nil]; _x animateSource ["terc", 1]; }; }; //Lower the targets } forEach _targets; }; }; Kind regards Pax
  4. Update: since Larrows changes the EH now fire for the regular popup targets and the delay is also working, which is wunderful. This is in Editor multiplayer test AND on a dedicated test server of our community across the globe. Awesome! Swivel targets on the other hand are a mystery to me and are probably borked as fuck when it comes to MP compatibility. In local editor test in multiplayer swivel targets via the current script state start in a swining state... left right, but when shot, will absolutely not react. In state case "setup" they will just continue swinging but due to their different way of being in need of called they now also have no Hit EH (afaik the EH needs to be called HitPart with swivel targets). On the dedicated test server swivels start the same as on local but their "swinging" is reduced to a mere spasm, it will continue to spawms on case "setup" as well. Therefore it can be said that the solution provided on steam to do this here: if (!isDedicated) then { { _x setVariable ["BIS_exitScript", false, true]; } forEach entities [ ["Target_Swivel_01_ground_F", "Land_Target_Swivel_01_F"],[] ]; }; Doesn't do shit to fix the BIS swivels MP issues. Current conclusion until opposed: Dop not even touch swivels targets with a 10 feet pole. Borked AF. As per BIS tracker borked since years and no fix sofar. Thanks everyone for your great help! I will stay with normal popuptargets for now until someone can provide a fix by BIS or per code.
  5. EDIT: Issue found, I did fuck up the eventhandlers {} brackets. Hi @Larrow I read your suggestions line by line and adapted most of it into my script for now. I think there might still be adaptions necessary for the eventHandlers based on if the targets are isKindOf (swivelthingy) as EH for these need to be called and removed differently than normal popup targets if I can trust what others had to do in their scripts in the past. My Init.sqf currently looks like this: #define framework #include "core\script_macros.hpp" #include "core\init.sqf" //DO NOT REMOVE #include "customization\settings.sqf" //DO NOT REMOVE #include "core\dia\debug\dia_debug.sqf" //DO NOT REMOVE #include "customization\addAction.sqf" //give instructors control over all popuptargets //Following code is apparently necessary to make swivels somewhat working in multiplayer if (!isDedicated) then { { _x setVariable ["BIS_exitScript", false, true]; } forEach entities [ ["Target_Swivel_01_ground_F", "Land_Target_Swivel_01_F"],[] ]; }; Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf"; if (isServer) then { "hide" execVM "customization\arrows.sqf"; // [false,"init",500,initCenter] remoteExec ["Fnc_popup", 2]; _nul = [] spawn { waitUntil {time > 0}; [] call Fnc_popup; }; "" call FNC_StartingCount; //DO NOT REMOVE [] spawn { //Spawns code running in parallel while {!FW_MissionEnded} do { //Loops while the mission is not ended #include "customization\endConditions.sqf" //DO NOT REMOVE //The time limit in minutes variable called FW_TimeLimit is set in customization/settings.sqf, to disable the time limit set it to 0 if ((time / 60) >= FW_TimeLimit && FW_TimeLimit != 0) exitWith { //It is recommended that you do not remove the time limit end condition FW_TimeLimitMessage call FNC_EndMission; }; }; }; }; #include "modules\modules.sqf" //DO NOT REMOVE #include "core\postChecks.sqf" //DO NOT REMOVE My AddAction looks like this. It threw some errors due to _player and that variable being undefined so I reverted back to 'player' as that worked inbefore the changes. //Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf"; /*if (!isDedicated) then { waitUntil { (player == player) }; if (player getVariable "isInstructor") then { conrepboard addAction ["<t color='#FF2222'>Reveal Arrows",{"reveal" execVM "customization\arrows.sqf";}]; conrepboard addAction ["<t color='#FF2222'>Hide Arrows",{"hide" execVM "customization\arrows.sqf";}]; arBoard addAction ["<t color='#FF2222'>Raise Bunker Targets",{[true,"setup",15,bnkTgts] remoteExec ["Fnc_popup", 2];}]; arBoard addAction ["<t color='#FF2222'>Lower Bunker Targets",{[false,"reset",15,bnkTgts] remoteExec ["Fnc_popup", 2];}]; grnBoard addAction ["<t color='#FF2222'>Raise Trench Targets",{[false,"setup",15,grnTgts] remoteExec ["Fnc_popup", 2];}]; grnBoard addAction ["<t color='#FF2222'>Lower Trench Targets",{[false,"reset",15,grnTgts] remoteExec ["Fnc_popup", 2];}]; bldBoard addAction ["<t color='#FF2222'>Raise House Targets",{[false,"setup",15,hseTgts] remoteExec ["Fnc_popup", 2];}]; bldBoard addAction ["<t color='#FF2222'>Lower House Targets",{[false,"reset",15,hseTgts] remoteExec ["Fnc_popup", 2];}]; grnPraBoard addAction ["<t color='#FF2222'>Raise Practice Targets",{[false,"setup",3,grnPraTgts] remoteExec ["Fnc_popup", 2];}]; grnPraBoard addAction ["<t color='#FF2222'>Lower Practice Targets",{[false,"reset",3,grnPraTgts] remoteExec ["Fnc_popup", 2];}]; }; }; */ if (!isDedicated) then { // params ["_player"]; if (player getVariable ["isInstructor", false]) then { conrepboard addAction ["<t color='#FF2222'>Reveal Arrows",{"reveal" execVM "customization\arrows.sqf";}]; conrepboard addAction ["<t color='#FF2222'>Hide Arrows",{"hide" execVM "customization\arrows.sqf";}]; arBoard addAction ["<t color='#FF2222'>Raise Bunker Targets",{["setup",15,bnkTgts,true] remoteExec ["Fnc_popup", 2];}]; arBoard addAction ["<t color='#FF2222'>Lower Bunker Targets",{["reset",15,bnkTgts,false] remoteExec ["Fnc_popup", 2];}]; grnBoard addAction ["<t color='#FF2222'>Raise Trench Targets",{["setup",15,grnTgts,false] remoteExec ["Fnc_popup", 2];}]; grnBoard addAction ["<t color='#FF2222'>Lower Trench Targets",{["reset",15,grnTgts,false] remoteExec ["Fnc_popup", 2];}]; bldBoard addAction ["<t color='#FF2222'>Raise House Targets",{["setup",15,hseTgts,false] remoteExec ["Fnc_popup", 2];}]; bldBoard addAction ["<t color='#FF2222'>Lower House Targets",{["reset",15,hseTgts,false] remoteExec ["Fnc_popup", 2];}]; grnPraBoard addAction ["<t color='#FF2222'>Raise Practice Targets",{["setup",3,grnPraTgts,false] remoteExec ["Fnc_popup", 2];}]; grnPraBoard addAction ["<t color='#FF2222'>Lower Practice Targets",{["reset",3,grnPraTgts,false] remoteExec ["Fnc_popup", 2];}]; }; }; The popups.sqf was changed to look nearly alike yours. As said I might have to do some more adaption and if's for the swivels, but I already ran into a script error that I can not find as for what I can see there, there is no missing bracket whatsoever: /////////////////////////////////////////////////////////////////////////////////////////// //Script to be called by inits or scripts for operating swivel and popup //targets around a specified object "_centerObj". //params: [ShouldTargetsAutoPop?,WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?] //By Pax /////////////////////////////////////////////////////////////////////////////////////////// params [ ["_execution", "init"], ["_distance", 500], ["_centerObj", initCenter], ["_popEnabled", false] ]; _targets = nearestObjects [position _centerObj, ["TargetBase", "Target_Swivel_01_base_F"], _distance]; switch (toLower _execution) do { case "init": { { //isKindOf Swivel else isKindOf popup if (typeOf _x isKindOf "Target_Swivel_01_base_F") then { _x setVariable ["BIS_poppingEnabled", false, true]; } else { _x setVariable ["nopop", true, true]; }; // Lower all targets defined in array _targets _x animateSource ["terc", 1]; }forEach _targets; }; case "setup": { //Make sure _targets are reset before running the setup phase (layerEightProtection) ["reset", _distance, _centerObj] call Fnc_popup; //Inform Instructor who asked for setup that the command was received "Command received - Targets are being setup" remoteExec ["systemChat", remoteExecutedOwner]; { //Is this target told to auto-pop? _x setVariable ["rePop", _popEnabled]; //Raise the target _x animateSource ["terc", 0]; //Add Hit EH and store the EH ID on the target _x setVariable [ "HitEH", _x addEventHandler [ "Hit", params [ "_target", "", "", "" ]; //If auto-pop was set if (_target getVariable "rePop") then { _target setVariable [ "rePopThread", _target spawn { sleep (1 + random 4); _this animateSource ["terc", 0]; }; ]; //No auto-pop set } else { //Bin Hit EH _target removeEventHandler ["Hit", _thisEventHandler]; //Clean Shit up _target setVariable ["HitEH", nil]; _target setVariable ["rePop", nil]; }; ] ]; } forEach _targets; }; case "reset": { //Inform Instructor of action "Command received - Targets are being reset" remoteExec ["systemChat", remoteExecutedOwner]; { //If the target for whatever reason still has an active EH: if !(isNil {_x getVariable "HitEH"}) then { //if auto-pop is set if (_x getVariable "rePop") then { //Is the target currently waiting to rePop? if (!isNil {_x getVariable "rePopThread"} && {!isNull (_x getVariable "rePopThread")}) then { //If it is waiting, terminate the Thread terminate (_x getVariable "rePopThread"); }; _x setVariable ["rePopThread", nil]; }; _x removeEventHandler ["Hit", _x getVariable "HitEH"]; _x setVariable ["HitEH", nil]; _x setVariable ["rePop", nil]; }; //Lower the targets _x animateSource ["terc", 1]; } forEach _targets; }; }; /* private _targets = nearestObjects [position _centerObj, ["TargetBase"], _distance]; private _SwivelTargets = nearestObjects [position _centerObj, ["Target_Swivel_01_base_F"], _distance]; switch (_execution) do { case "init": { { _x setVariable ["nopop", true]; _x animateSource ["terc",1] } forEach _targets; { _x setVariable ["BIS_poppingEnabled", false]; // _x setVariable ["BIS_leaningEnabled", false]; <-- aparently disables any animation physics, thx BI -.- _x animateSource ["terc",1]; } forEach _SwivelTargets; }; case "setup": { "setup called" remoteExec ["systemChat"]; // Normal Popuptargets if (_popEnabled) then { "popup first condition" remoteExec ["systemChat"]; { _x setVariable ["nopop", false]; _x animateSource ["terc",0]; _x addEventHandler [ "Hit", { "popup first condition EH animate" remoteExec ["systemChat"]; (_this select 0) animateSource ["terc",1]; (_this select 0) setVariable ["popdelay", 1 + (random 5)]; // [{ // (_this select 0) animateSource ["terc",0]; // "popup first condition EH in CBA" remoteExec ["systemChat"]; // }, // [_this], 2 + (random 3)] call CBA_fnc_waitAndExecute; } ] } forEach _targets; } else { "popup second condition" remoteExec ["systemChat"]; { _x animateSource ["terc",0]; _x addEventHandler [ "Hit", { (_this select 0) animateSource ["terc",1]; (_this select 0) removeEventHandler ["Hit",0]; } ] } forEach _targets; }; // Swivel targets if (_popEnabled) then { "swivel first condition" remoteExec ["systemChat"]; { _x setVariable ["BIS_poppingEnabled", true]; _x setVariable ["BIS_leaningEnabled", true]; _x animateSource ["terc",0]; _x addEventHandler [ "HitPart", { ((_this select 0) select 0) animateSource ["terc",1]; ((_this select 0) select 0) setVariable ["popdelay", 1 + (random 5)]; // [{ // ((_this select 0) select 0) animateSource ["terc",0]; // }, // [_this], 2 + (random 3)] call CBA_fnc_waitAndExecute; } ] } forEach _SwivelTargets; } else { "swivel second condition" remoteExec ["systemChat"]; { _x setVariable ["BIS_leaningEnabled", true]; _x animateSource ["terc",0]; _x addEventHandler [ "HitPart", { ((_this select 0) select 0) setVariable ["BIS_leaningEnabled", false]; ((_this select 0) select 0) animateSource ["terc",1]; ((_this select 0) select 0) removeEventHandler ["HitPart",0]; } ] } forEach _SwivelTargets; }; }; case "reset": { "reset called" remoteExec ["systemChat"]; { _x setVariable ["nopop", true]; _x removeEventHandler ["Hit",0]; _x animateSource ["terc",1]; } forEach _targets; { _x setVariable ["BIS_poppingEnabled", false]; _x setVariable ["BIS_poppingEnabled", false]; _x RemoveEventHandler ["HitPart",0]; _x animateSource ["terc",1]; } forEach _SwivelTargets; }; }; */ Greetings Pax
  6. Quick checkin, sofar I still haven't been able to make the eventhandler execute properly with the dedicated server and swivel targets. EH on the normal popup targets seem to work, but the delay code within the EH still isn't executed at all for whatever reason. I only have a few hours over the next days to spare so I might not spend them on the scripts. I will check back in next weekend, with a hopefully working solution or a workaround or a script that only uses popup targets vs with swivels as these start to set my brain on fire.
  7. ... thanks, I guess? Thank you, I did not know this fuction until now, I have to check if it works in unscheduled environment like eh tho, will do that over the next 2 days. Because I am absolutely unknowledgable in sqf (scripting in general) compared to you guys. Oh wow Larrow, I will definitely will incorporate a lot of this in my new try, especially the stuff with reducing the two arrays of taregts into one and then asking for its kind, that is super neat. Thanks alot guys! I'll be back if it works and post the solution or doesn't work and ask for furhter assistance ^^'
  8. I am baffled. I checked everything I know. objects are local to the server, scripts are executed for the server only, I tried to get rid of the cba fnc by using "popdelay" which does not work either. I will continue to shift some stuff around and if that won't work I might just settle for not using swivel targets in that MP mission.
  9. I looked at cba docs and if I understand it right, args need to be in brackets if I get that right so I now have: [_this] instead of _this, do I need to also enclose 2 + (random 3) as (2 + (random 3))? But I absolutely not sure what the locality and variable issues could be that you mentioned. All variables are local to each execution and are not used outside of popup.sqf. It would be much appriciated if you could elaborate on your findings.
  10. thats the opening bracket for CBA_fnc_waitAndExecute
  11. Hello folks, I am currently working on a mission designed for training puposes. The mission is build upon the OlsenFramework, a mission making framework. Links are to either githubs. I am running into the following problem: a) If I test the mission in the Eden Editors host environment and singleplayer, all code executes flawslessly when addEventHandler is used (obviously no MP). b) When tested on a dedicated server, the EventHandlers (addEventHandler and addMPEventhandler) will not fire at all. This was tested via systemChat messages. The code: (All code can be viewed on the github linked, its the latest changes made and the last version tested on the server) A few months back I was given a script by my units training officer to work with popup targets but it was split in a multitude of files and also only worked partially on dedicated, which I did not like so I rewrote it into a single script. The origin of that code is not known to me, so forgive me for the missing credits. In the init.sqf of the mission, I call code which adds a line of code to each targets which apparently is supposed to 'fix' swivel targets not working in multiplayer dedicated environments. This can be found here. As far as I unterstand this is supposed to disable animation control on all clients (including non dedicated servers and HC), but sofar the targets still behave crappy. if (!isDedicated) then { _localTargets = (entities "Target_Swivel_01_ground_F") + (entities "Land_Target_Swivel_01_F"); { _x setVariable ["BIS_exitScript", false]; } forEach _localTargets; }; later I call my script which is mainly in control of the targets: popup.sqf once via the init.sqf to get all targets into a down position at mission start. This works flawless. Fnc_popup is the same as popup.sqf just processed via: Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf"; if (isServer) then { [false,"init",500,initCenter] remoteExec ["Fnc_popup", 2]; }; Players being Instructors are makred via a variable "isInstructor" only players with this restriction will have access to the popup addAction ... actions. Which are placed on landBoards in the mission. en example from the addAction.sqf looks like this: Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf"; if (!isDedicated) then { waitUntil { (player == player) }; if (player getVariable "isInstructor") then { arBoard addAction ["<t color='#FF0000'>Raise Bunker Targets",{[true,"setup",15,bnkTgts] remoteExec ["Fnc_popup", 2];}]; arBoard addAction ["<t color='#FF0000'>Lower Bunker Targets",{[false,"reset",15,bnkTgts] remoteExec ["Fnc_popup", 2];}]; }; }; This calls a precompiled form of popup.sqf and now the problöem occurs that everything in that popup.sqf works, except for the damn eventHandlers place on the trainingTargets. case init and case reset work, and throw no script errors. This is the popup.sqf file content: /////////////////////////////////////////////////////////////////////////////////////////// //Script to be called by inits or scripts for operating swivel and popup //targets around a specified object "_center". //params: [ShouldTargetsAutoPop?,WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?] //By PaxJaromeMalues /////////////////////////////////////////////////////////////////////////////////////////// params [["_popenabled",false],["_execution","init"],["_dist",25],["_center",initCenter]]; _targets = nearestObjects [position _center, ["TargetBase"], _dist]; _SwivelTargets = nearestObjects [position _center, ["Target_Swivel_01_base_F"], _dist]; switch (_execution) do { case "init": { { _x setVariable ["nopop", true]; _x animateSource ["terc",1] } forEach _targets; { _x setVariable ["BIS_poppingEnabled", false]; _x animateSource ["terc",1]; } forEach _SwivelTargets; }; case "setup": { "setup called" remoteExec ["systemChat"]; if (_popenabled) then { "popup first condition" remoteExec ["systemChat"]; { _x animateSource ["terc",0]; _x addMPEventHandler [ "MPHit", { "popup first condition EH before CBA" remoteExec ["systemChat"]; (_this select 0) animateSource ["terc",1]; [{ (_this select 0) animateSource ["terc",0]; "popup first condition EH in CBA" remoteExec ["systemChat"]; }, _this, 2 + (random 3)] call CBA_fnc_waitAndExecute; } ] } forEach _targets; } else { "popup second condition" remoteExec ["systemChat"]; { _x animateSource ["terc",0]; _x addMPEventHandler [ "MPHit", { (_this select 0) animateSource ["terc",1]; (_this select 0) removeEventHandler ["MPHit",0]; } ] } forEach _targets; }; if (_popenabled) then { "swivel first condition" remoteExec ["systemChat"]; { _x animateSource ["terc",0]; _x addMPEventHandler [ "MPHitPart", { ((_this select 0) select 0) animateSource ["terc",1]; [{ ((_this select 0) select 0) animateSource ["terc",0]; }, _this, 2 + (random 3)] call CBA_fnc_waitAndExecute; } ] } forEach _SwivelTargets; } else { "swivel second condition" remoteExec ["systemChat"]; { _x animateSource ["terc",0]; _x addMPEventHandler [ "MPHitPart", { ((_this select 0) select 0) animateSource ["terc",1]; ((_this select 0) select 0) removeEventHandler ["MPHit",0]; } ] } forEach _SwivelTargets; }; }; case "reset": { "reset called" remoteExec ["systemChat"]; { _x removeEventHandler ["MPHit",0]; _x animateSource ["terc",1]; } forEach _targets; { _x animateSource ["terc",1]; _x RemoveEventHandler ["MPHitPart",0]; } forEach _SwivelTargets; }; }; I have been sitting at this problem for over a month now, and have no idea what I am doing wrong here. Pls help.
  12. Hello ACE Team, BI thought this and other stuff would be a good idea (drugs... maybe, I don't know...) Please fix (*remove)[**override][(***exchange by something better)] kind regards, a fan (yes, I can spin fast)
  13. Hello, I am playing ArmA as military simulator since 2011. My ingame hours I did never count but putting them all together: something around 1000 hours would fit I guess considering the fact that I played nearly every day or every second at least 2 hours. In the past years I focused on the following roles: Medic [Likely the role I did spend the most time in back until '11](FT-CLS up to COY-Level Logistics), I started 1 year ago to practice the work of a JTAC (Sadly I never had the chance to take a course on that topic at the community [us time zone] I played at, so I had to learn everything by myself. Worth the trouble. I might gained sum rust as I did not JTAC in the past 2 months), I did in fact lead sometimes from PL position or 2IC and took quiet a lot courses on these topics but I stoped leading as soon as the overall ability to execute simple orders as well as to maintain simple individual infantry combat skills vanished from the playerbase; leading ended up to be frustrating to the core and I knew to spend my time better as to go angry about some idiots and their damn excuses. What do I expect: As I played at multiple multigaming communitys and I had no luck with them I now search for a place with a set and mature playerbase. People should know what they are doing. Greeting some sandbacks with 'sir' whenever they enter a TS-channel or take a piss near the spawning area is a no-go. I am willing to start from 0 if necessarry. Actually I would like to start from 0. The server should not be public; that means: not every troll is able to enter the playerbase to then lower the overall gameplay quality. I had enough of such places. If there is any European time zone place offering such: please pm me. - Seemax
×