Jump to content

Recommended Posts

What I want is players to have access to an addAction (provided they have activated the trigger).
However right now if someone crashes and returns the addAction is longer there for them (even if they activated the trigger that spawns it)
In the On Activation trigger field I have this:

ptboat addAction ["Equip SCUBA Gear", "scubagear.sqf", nil, 7, false, true, "", "_this in (crew _target) && !scubaEquipped"]; //Shows up if you are in the boat and have your regular loadout

ptboat addAction ["Equip Loadout Gear", "loadoutgear.sqf", nil, 7, false, true, "", "_this in (crew _target) && scubaEquipped"]; //Shows up if you are in the boat and have your SCUBA

These lets the player easily swap between their loadout and SCUBA and it all works great minus the JIP issue.

Share this post


Link to post
Share on other sites

Hi, I could imagine that you need to set the trigger to repeatable (a checkbox in the trigger).

 

Alternatively, I would suggest moving the addAction to the script "initPlayerLocal.sqf" and adding the activation of the trigger as a condition for showing the action.

 

initPlayerLocal.sqf: Executed locally when a player joins the mission (includes both mission start and JIP).

 

The trigger activation can be added as a condition for the display as follows:

ptboat addAction ["Equip SCUBA Gear", "scubagear.sqf", nil, 7, false, true, "", "_this in (crew _target) && !scubaEquipped && triggerActivated myTrigger"];

 

If the players spawn in the trigger and you only use it for adding the addAction, you can also leave out the condition “triggerActivated myTrigger”.

  • Like 1

Share this post


Link to post
Share on other sites
On 6/25/2024 at 2:51 AM, Joshua9797 said:

Hi, I could imagine that you need to set the trigger to repeatable (a checkbox in the trigger).

 

Alternatively, I would suggest moving the addAction to the script "initPlayerLocal.sqf" and adding the activation of the trigger as a condition for showing the action.

 

initPlayerLocal.sqf: Executed locally when a player joins the mission (includes both mission start and JIP).

 

The trigger activation can be added as a condition for the display as follows:


ptboat addAction ["Equip SCUBA Gear", "scubagear.sqf", nil, 7, false, true, "", "_this in (crew _target) && !scubaEquipped && triggerActivated myTrigger"];

 

If the players spawn in the trigger and you only use it for adding the addAction, you can also leave out the condition “triggerActivated myTrigger”.


So I moved the addAction to initPlayerLocal.sqf but it still wont let JIP players access the addAction.

Share this post


Link to post
Share on other sites

What condition for your trigger activation?

Share this post


Link to post
Share on other sites
17 hours ago, pierremgi said:

What condition for your trigger activation?

 

The condition for "triggerActivated myTrigger" is BLUFOR present. By the way the trigger is non-repeatable and NOT Server Only.

Share this post


Link to post
Share on other sites

Okay, I've done a bunch of testing on this and I've narrowed the problem down. Quick summary:

 

1. Any client that was connected when the trigger was activated has access to the addAction. No problem there.

2. However, the only way a JIP player can have access to the addAction is if they or any other client goes into the trigger area again. (By the way the trigger is non-repeatable and NOT Server Only.)

 

So my solution would be to find a way for the the JIP client to know that this trigger was activated already. Perhaps there is a way to globally broadcast if a trigger was activated already?

Share this post


Link to post
Share on other sites

Not normal with an edited trigger!

Delete and rework your trigger in editor.

 

If no success, add a little timeout for the trigger

 

if no success, add a variable and publicVariable it:

in on act. field of the trigger: thisTrigIsActivated = TRUE; publicVariable "thisTrigIsActivated";
check for  !isNil "thisTrigIsActivated"  in addAction

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, pierremgi said:

Not normal with an edited trigger!

Delete and rework your trigger in editor.

 

If no success, add a little timeout for the trigger

 

if no success, add a variable and publicVariable it:

in on act. field of the trigger: thisTrigIsActivated = TRUE; publicVariable "thisTrigIsActivated";
check for  !isNil "thisTrigIsActivated"  in addAction


I tried to publicVariable it and couldn't get it working. Perhaps I wrote it wrong which is probably the case since I don't understand it. But I did find a solution to this late last night!

I ended up putting the addAction withing a sqf and using a Server Only trigger I remoteExec'd a ExecVM with the true for JIP. I tested it a bunch and no issues anymore!
 

["scripts\scubanow.sqf"] remoteExec ["execVM", 0, true];

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×