Jump to content

mattjb

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About mattjb

  • Rank
    Private First Class

Recent Profile Visitors

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

  1. I think I figured it out (still need to do testing with 2+ people), but the issue was the usage of addActionToObject. Thanks, Dedmen! Your typeOf clue gave me a hint in trying addActionToClass instead, as follows: [[typeOf _unit, 0, ["ACE_MainActions"], _fullHeal],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; Instead of: [[_unit, 0, ["ACE_MainActions"], _fullHeal],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; Doing this, there's no need for the EH as the action appears in both the ACE_MainActions when outside a vehicle, and inside the vehicle via Vehicle -> Passengers -> Unit's Name subaction menu as well. I still need to test with more human players, as I lose remote control when controlling an AI unit entering the same vehicle as myself, but testing from outside -> inside is working. I will update this thread with results from inside -> inside when I get around to it, for anyone else with the same issue that stumbles by this thread.
  2. Just giving a quick update - still haven't figured this out yet, but I did discover a param (enableInside) in createAction that I've been tinkering with as it sounds suspicious -- initial testing still no go, but maybe I'm missing something: [ACE] fnc_createAction.sqf * Arguments: * 0: Action name <STRING> * 1: Name of the action shown in the menu <STRING> * 2: Icon <STRING> * 3: Statement <CODE> * 4: Condition <CODE> * 5: Insert children code <CODE> (Optional) * 6: Action parameters <ANY> (Optional) * 7: Position (Position array, Position code or Selection Name) <ARRAY>, <CODE> or <STRING> (Optional) * 8: Distance <NUMBER> (Optional) * 9: Other parameters [showDisabled,enableInside,canCollapse,runOnHover,doNotCheckLOS] <ARRAY> (Optional) * 10: Modifier function <CODE> (Optional) params [ "_actionName", "_displayName", "_icon", "_statement", "_condition", ["_insertChildren", {}], ["_customParams", []], ["_position", {[0, 0, 0]}], ["_distance", 2], ["_params", [false, false, false, false, false]], ["_modifierFunction", {}] ]; My modified createAction: _fullHeal = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{(('ACE_personalAidKit' in (items _player + assignedItems _player)) or ('ACE_personalAidKit' in (items _target + assignedItems _target))) and ( (!(_target getVariable ['ACE_medical_bodyPartStatus',[0,0,0,0,0,0]] isEqualTo [0,0,0,0,0,0])) or (_target getVariable ['ACE_medical_pain',0] > 0) or (_target getVariable ['ACE_isUnconscious',false] isEqualTo true))},{},[],[0,0,0],3,[false,true,false,false,false]] call ace_interact_menu_fnc_createAction;
  3. I'd like to use a "player is inside vehicle" based condition... But I'm lost on how to attach it to the player and have the action carried between vehicles. The addActionToObject works if I am in a vehicle at mission start. If I get out, and get back in, it still works for that vehicle. However, if I get out and go to another vehicle, the action doesn't appear -- leading me to think that vehicle _unit only registered the vehicle that the player started in, and is not being dynamically reassigned when the player changes vehicles. i.e. [[(vehicle _unit), 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; Would you happen to know how to get it to show up dynamically? I'm already using a hefty condition as can be seen by _fullHeal --- {(('ACE_personalAidKit' in (items _player + assignedItems _player)) or ('ACE_personalAidKit' in (items _target + assignedItems _target))) and ( (!(_target getVariable ['ACE_medical_bodyPartStatus',[0,0,0,0,0,0]] isEqualTo [0,0,0,0,0,0])) or (_target getVariable ['ACE_medical_pain',0] > 0) or (_target getVariable ['ACE_isUnconscious',false] isEqualTo true))} I'm assuming this is where a "player is inside vehicle" condition would go, right? But again, getting the action to even show up in the first place between various vehicles is the main problem.
  4. If there's a means to not have to add/remove it constantly, I'm open to suggestions/alternatives. :) The reason why I resorted to looking into doing it that way is because I wasn't having any luck for the past 3 weeks in figuring out a way to have it carried with the player. My initial instinct was to try something like: [[(vehicle _unit), 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; But when testing this, I observed that when an injured player gets into the vehicle, the passenger action doesn't appear; however, if the player spawns in the vehicle (i.e. mission start), the action appears... I concluded that the addActionToObject was being added to the vehicle, and not the player itself. The action is for passengers in the vehicle, not the vehicle itself. The actions work perfectly in targeting the player when used in the above context and my initial post (with EH), just the problems I'm having with either solution... remoteExec's are in there as it's a purely client-driven script targeting other players. For reference, the entire init sqf code is below (_fullHealVic is just temporary, _fullHeal is the real action -- I got tired of shooting myself with remote controlled units so I went with a {true} condition). This is for a mod I've been developing in my spare time for my group that wanted a simpler solution to utilizing a fully customizable PAK solution in ACE Basic Medical -- without deleting the ace_medical.pbo - as they are too devoted to using Steam Workshop: if (isServer) exitWith {}; [[], { waitUntil { !(isNull player) && {(player == player)} && {!isNil "BIS_fnc_init"} }; _unit = player; if (hasInterface) then { if (isNil {_unit getVariable ["WolfPAKActive", nil]}) then { _unit setVariable ["WolfPAKActive", true]; // WolfPAK v1.5 - initialization code _fullHeal = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{(('ACE_personalAidKit' in (items _player + assignedItems _player)) or ('ACE_personalAidKit' in (items _target + assignedItems _target))) and ( (!(_target getVariable ['ACE_medical_bodyPartStatus',[0,0,0,0,0,0]] isEqualTo [0,0,0,0,0,0])) or (_target getVariable ['ACE_medical_pain',0] > 0) or (_target getVariable ['ACE_isUnconscious',false] isEqualTo true))}] call ace_interact_menu_fnc_createAction; [[_unit, 0, ["ACE_MainActions"], _fullHeal],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [_unit, 1, ["ACE_SelfActions"], _fullHeal] call ace_interact_menu_fnc_addActionToObject; addVicAction = { _unit = _this select 0; _vehicle = _this select 1; _fullHealVic = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_vehicle, 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; }; removeVicAction = { _unit = _this select 0; _vehicle = _this select 1; _fullHealVic = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_vehicle, 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_removeActionFromObject] remoteExec ["call", -2, true]; }; ["vehicle", { params ["_unit", "_vehicle"]; _unit sideChat format ["unit: %1 :: vehicle: %2 :: vehicle _unit: %3",_unit,_vehicle, vehicle _unit]; if (vehicle _unit != _unit) then { [_unit, _vehicle] call addVicAction; } else { [_unit, _vehicle] call removeVicAction; }; }] call CBA_fnc_addPlayerEventHandler; systemChat "Initialized WolfPAK v1.5 (PBO)"; // End of WolfPAK v1.5 - initialization code }; }; }] remoteExec ["spawn", -2, true];
  5. I'd like some suggestions to try here... I've been trying to add an ACE action dynamically to players when they enter/leave vehicles. I discovered why my actions were not visible if I just tried to attach the action to the player and assume that it would carry with whatever vehicle he got into... apparently it isn't the case, and it seems necessary to leverage a vehicle/getinman/getoutman EH. Ideally the CBA_fnc_addPlayerEventHandler would be best here, as it triggers on Zeus actions and other scenarios; however, I cannot discern between an "enter" and "leave" condition... The code segment I have for this: _unit = player; addVicAction = { _unit = _this select 0; _vehicle = _this select 1; _fullHealVic = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_vehicle, 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; }; removeVicAction = { _unit = _this select 0; _vehicle = _this select 1; _fullHealVic = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_vehicle, 0, ["ACE_MainActions", "ACE_Passengers", str _unit], _fullHealVic],ace_interact_menu_fnc_removeActionFromObject] remoteExec ["call", -2, true]; }; ["vehicle", { params ["_unit", "_vehicle"]; _unit sideChat format ["unit: %1 :: vehicle: %2 :: vehicle _unit: %3", _unit, _vehicle, vehicle _unit]; if (vehicle _unit != _unit) then { [_unit, _vehicle] call addVicAction; } else { [_unit, _vehicle] call removeVicAction; }; }] call CBA_fnc_addPlayerEventHandler; The else statement's 'removeVicAction' is never getting called to remove the action, resulting in +1 or +2 (enter or enter/leave) actions added. Looking at the vars from the sideChat statement reveals that the vehicle var is being assigned after getting in, and before getting out... See screenshot below for the sideChat messages after getting in and getting out -- all vars are identical:
  6. Did this question ever get answered? I'm looking to do the same thing, but am having some difficulty with the syntax to the point where it seems to keep breaking the script I'm calling it from.
  7. Just found fnc_addPassengerActions.sqf and fnc_addPassengersActions.sqf inside ace_interaction.pbo - going to see if I can leverage those functions...
  8. Finally got around to doing some thorough testing of this. The ACE_SelfAction progressBar is working fine, but I'm now having difficulty getting the action to show up for other players in a vehicle. It is very similar to what the OP in this thread was trying to achieve: I've tried so many combinations now, and derived at the conclusion that str _unit isn't creating the action under a "vehicularized" playername's action menu, but creating actions that target the vehicle directly seem to be working, i.e. ["ACE_MainActions"] or ["ACE_MainActions","ACE_Passengers"] - for instance the "Check Fuel" example provided by the examples page: https://ace3mod.com/wiki/framework/interactionMenu-framework.html#25-examples Just an FYI, I have the {true} condition for _fullHealVehicle just to make testing easier and quicker -- for now I'm just trying get the action appearing and targeting the unit correctly... if (isServer) exitWith {}; [[], { waitUntil { !(isNull player) && {(player == player)} && {!isNil "BIS_fnc_init"} }; _unit = player; if (hasInterface) then { if (isNil {_unit getVariable ["WolfPAKActive", nil]}) then { _unit setVariable ["WolfPAKActive", true]; // WolfPAK v1.5 - initialization code _fullHeal = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{(('ACE_personalAidKit' in (items _player + assignedItems _player)) or ('ACE_personalAidKit' in (items _target + assignedItems _target))) and ( (!(_target getVariable ['ACE_medical_bodyPartStatus',[0,0,0,0,0,0]] isEqualTo [0,0,0,0,0,0])) or (_target getVariable ['ACE_medical_pain',0] > 0) or (_target getVariable ['ACE_isUnconscious',false] isEqualTo true))}] call ace_interact_menu_fnc_createAction; _fullHealVehicle = ["full_heal_vic", "<t color='#00ff00'>WolfPAK (Full Heal) Vic</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_unit, 0, ["ACE_MainActions"], _fullHeal],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_MainActions"], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_MainActions","ACE_Passengers"], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_MainActions","ACE_Passengers",(str _unit)], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_MainActions","ACE_Passengers",_unit], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; [[vehicle _unit, 0, ["ACE_MainActions","ACE_Passengers"], _fullHealVehicle],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [[vehicle _unit, 0, ["ACE_Passengers"], _fullHealVehicle],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [[vehicle _unit, 0, ["ACE_MainActions", str _unit], _fullHealVehicle],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [[vehicle _unit, 0, [str _unit], _fullHealVehicle],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_MainActions", "ACE_Passengers", name _unit], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_Passengers", str _unit], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; //[["LandVehicle", 0, ["ACE_Passengers", name _unit], _fullHealVehicle, true],ace_interact_menu_fnc_addActionToClass] remoteExec ["call", -2, true]; // Adds action to check fuel levels for all land vehicles _action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; ["LandVehicle", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; [_unit, 1, ["ACE_SelfActions"], _fullHeal] call ace_interact_menu_fnc_addActionToObject; systemChat "Initialized WolfPAK v1.5 (PBO)"; // End of WolfPAK v1.5 - initialization code }; }; }] remoteExec ["spawn", -2, true];
  9. I think ["isNotInside"] may very well be the key to the solution! Did some initial testing this morning (the best I can do through a VNC connection from work here), and at least self-interact seems to be working inside the driver seat of a vehicle. I was looking through the ace common & medical functions last night and saw that "isNotInside" being passed from I think the treatment function (as well as "isNotSwimming") but I couldn't find exactly what those keywords were doing. Will do some more testing with that, as well as seeing if I should tag on "isNotSwimming" too, for the situations when trying to use a progressBar function while in the water. I will report back with my findings. :) Thanks for the suggestion, Mr H.! Also to you, HazJ, for your suggestions!
  10. Still the same behavior Using: [[(vehicle _unit), 0, ["ACE_MainActions"], _progressbartest],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [[(vehicle _unit), 1, ["ACE_SelfActions"], _progressbartest],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true];
  11. Progress bar works outside of vehicles, but not when inside. I've made a quick video showing the behavior, with the github example:
  12. _unit = player; Sorry if that seemed confusing, I'll provide the whole WolfPAKinit.sqf here. The _progressbartest handle just calls a test script that I've temporarily embedded into the mod. It is stripped down to just the essentials of calling an ACE progressBar at its most primitive functionality (returning true). _fullheal is the handle for the main script which is exhibiting the same progressBar behavior. WolfPAKinit.sqf [[], { if (isServer) exitWith {}; waitUntil { !(isNull player) && {(player == player)} && {!isNil "BIS_fnc_init"} }; _unit = player; if (hasInterface) then { if (isNil {_unit getVariable ["WolfPAKActive", nil]}) then { _unit setVariable ["WolfPAKActive", true]; // WolfPAK v1.5 - initialization code _fullHeal = ["full_heal", "<t color='#00ff00'>WolfPAK (Full Heal)</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_aceaction.sqf"},{(('ACE_personalAidKit' in (items _player + assignedItems _player)) or ('ACE_personalAidKit' in (items _target + assignedItems _target))) and ( (!(_target getVariable ['ACE_medical_bodyPartStatus',[0,0,0,0,0,0]] isEqualTo [0,0,0,0,0,0])) or (_target getVariable ['ACE_medical_pain',0] > 0) or (_target getVariable ['ACE_isUnconscious',false] isEqualTo true))}] call ace_interact_menu_fnc_createAction; _progressbartest = ["progress_bar_test", "<t color='#00ff00'>ProgressBar Test</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_progresbartest.sqf"},{true}] call ace_interact_menu_fnc_createAction; [[_unit, 0, ["ACE_MainActions"], _fullHeal],ace_interact_menu_fnc_addActionToObject] remoteExec ["call", -2, true]; [_unit, 1, ["ACE_SelfActions"], _fullHeal] call ace_interact_menu_fnc_addActionToObject; [_unit, 1, ["ACE_SelfActions"], _progressbartest] call ace_interact_menu_fnc_addActionToObject; systemChat "Initialized WolfPAK v1.5 (PBO)"; // End of WolfPAK v1.5 - initialization code }; }; }] remoteExec ["spawn", -2, true]; wolfpak_progressbartest.sqf _target = _this select 0; _player = _this select 1; [ 3, [], {true}, {true}, "ProgressBar...", {true} ] call ace_common_fnc_progressBar;
  13. Additionally, the success code segment is never being hit here.
  14. Thanks, diwako, your earlier suggestions of specifying defaults for getVariable seemed to have fixed the race condition. Currently working on making the rest of the mod compliant with regarding to removal of hpp files. I've posted another follow-up issue that is related to the same mod, but a different issue -- if you have any insight on that as well...
  15. I can't seem to wrap my head around why ace_common_fnc_progressBar starts and immediately quits (within a frame) when inside a vehicle, but works fine when outside a vehicle. Could anyone shed some light on this? I've simplified the non-working code down to being this as simple as this: _target = _this select 0; _player = _this select 1; [ 3, [], {true}, {true}, "ProgressBar...", {true} ] call ace_common_fnc_progressBar; Calling the script containing the above with: _progressbartest = ["progress_bar_test", "<t color='#00ff00'>ProgressBar Test</t>","", {[_target,_player] execVM "wolfpak\scripts\wolfpak_progresbartest.sqf"},{true}] call ace_interact_menu_fnc_createAction; [_unit, 1, ["ACE_SelfActions"], _progressbartest] call ace_interact_menu_fnc_addActionToObject;
×