Jump to content
JohnKalo

[Fixed via Trick] AddAction issue

Recommended Posts

And the second issue that came up with the one mission was this:
 

this addaction ["Pickup Key","Scripts\PickupKey.sqf"];

 

the above resulted in 4 actions appearing on the object. 4 were the players 4 were the actions. So if I place the above code in a trigger that is Server Only will the action only appear once while been shown to all players?

Share this post


Link to post
Share on other sites

From the BIKI (https://community.bistudio.com/wiki/Eden_Editor:_Object)

Quote

Init: Expression called upon at start. In multiplayer, it is called on every machine and for each player who joins in the progress. The variable 'this' refers to the affected object.

 

if (isServer) then {[this, ["Pickup Key","Scripts\PickupKey.sqf"]] remoteExec ["addAction", 0, this];

Seems a bit whack but cant think of anything better.

  • Like 1

Share this post


Link to post
Share on other sites
On 1/5/2020 at 9:32 AM, JohnKalo said:

And the second issue that came up with the one mission was this:
 


this addaction ["Pickup Key","Scripts\PickupKey.sqf"];

 

the above resulted in 4 actions appearing on the object. 4 were the players 4 were the actions. So if I place the above code in a trigger that is Server Only will the action only appear once while been shown to all players?

 

Not sure to understand how you can have 4 action menus even with 4 players if you apply the code on one unique object (like a crate).

It's very easy and reproducible to play two players on hosted/client PCs ans see that doesn't happen.

So? For better understanding, what is THIS ? how many time do you copy paste the code, where?

  • Like 1

Share this post


Link to post
Share on other sites

@7erra The trick was to use 4 actions for which you need 4 different variables. Each player had one of those 4 variables. That way all had the action and once the one was activated all were erased!

 

@pierremgi I placed the code in an objects init. The object was a  vanilla table. Actually the action applies to an object on that table but in order to make the action more visible I added it to the table. And yes we are talking about a hosted server. No copy paste here anywhere. 

Share this post


Link to post
Share on other sites

So you don't need to remoteExec the addAction. I can't say for your inner code because I don't know it (them).

 But do not remote execute for nuts.

this addAction ...    works well on object(s). You just have to add a condition (8th param of this command), ... and btw, have a look for a better syntax of it. "quoting an sqf" is totally outdated, especially without any other parameter.

 

You could use a hold action (like collecting evidence) by Bis_fnc_holdActionAdd but that demands some extra reading.

  • Like 1
  • Thanks 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

×