Jump to content

Recommended Posts

Hello,

I'm trying to get holdActionAdd to work in MP, which works perfectly in singleplayer and for the host of a local session.

But, when another client tries to activate the HoldAction, it does progress to the very end but nothing happens.

Not even the first say3D "push" sound appear when starting the action.

 

Note that I've set the HoldAction to remoteExec as the wiki states it should work.

Am, I missing something here?

[
	boat,																// Object the action is attached to
	"Move the boat",													// Title of the action
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",		// Idle icon shown on screen
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",		// Progress icon shown on screen
	"_this distance _target < 3",										// Condition for the action to be shown
	"_caller distance _target < 3",										// Condition for the action to progress
	{boatstuck say3D "push";},											// Code executed when action starts
	{},																	// Code executed on every progress tick
	{boat hideobjectglobal true; boatplace say3D "splash";},			// Code executed on completion
	{},																	// Code executed on interrupted
	[],																	// Arguments passed to the scripts as _this select 3
	5,																	// Action duration [s]
	0,																	// Priority
	true,																// Remove on completion
	false																// Show in unconscious state 
] remoteExec ["BIS_fnc_holdActionAdd", 0, boat];						// MP compatible implementation

 

Thanks in advance! 🙂

Share this post


Link to post
Share on other sites

Are you sure that boat and boatstuck are valid objects at the machine the code is being executed? Maybe if you could provide some more information it could be helpful to us.

 

Additionally, I have to assume that the sound "push" is defined in the CfgSounds part of your description.ext.

Share this post


Link to post
Share on other sites
Just now, ZaellixA said:

Are you sure that boat and boatstuck are valid objects at the machine the code is being executed? Maybe if you could provide some more information it could be helpful to us.

  

Additionally, I have to assume that the sound "push" is defined in the CfgSounds part of your description.ext.

 

Yes, it's a invisible helipad I use for sound FX sometimes, the thing is that all players do hear the sound, only if the host activates the HoldAction.

This goes along with all the other effects in the HoldAction, everyone can hear and see if the host activates it. But if any other client tries to activate it, it progresses but no effects happen.

 

I wonder if I should remoteExec the effects like say3D and hideobjectglobal, although that should already be a global effect..

  • Like 1

Share this post


Link to post
Share on other sites

Yeah, hideObjectGlobal should have a global effect. BUT, according to the docs, it should be executed on the server only. So, maybe you should call something like

[boat, true] remoteExec["hideObjectGlobal", 2, true]; boatplace say3D "splash";

at the code to be executed on completion.

 

Regarding "missing" sounds... I am not sure how to tackle that because I haven't used the command before. Maybe you could try to remoteExec it too since it seems to be working properly when executed on the host. You could try something like

[boat, true] remoteExec["hideObjectGlobal", 2, true]; [boatplace, "splash"] remoteExec["say3D", 2, false];

Unfortunately, I am not sure about any of those two 😞  and I am just speculating here. I believe it's not too much of a burden to try them so it may be worth it. Wish you luck with it and hopefully, someone more knowledgeable than me will be able to provide a solution based on solid foundations instead of mere speculations.

 

Please spend some time to provide a solution if you find it to help people in the future.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@fin_soldier: the syntax is messed up in your last line :

 

<params> remoteExec ["fnc_someScriptedFunction", targets, JIP];

 

So instead of

remoteExec ["BIS_fnc_holdActionAdd", 0, boat]

You should have the following :

remoteExec ["BIS_fnc_holdActionAdd", 0, true]

 

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, ZaellixA said:

Yeah, hideObjectGlobal should have a global effect. BUT, according to the docs, it should be executed on the server only. So, maybe you should call something like


[boat, true] remoteExec["hideObjectGlobal", 2, true]; boatplace say3D "splash";

at the code to be executed on completion.

 

Regarding "missing" sounds... I am not sure how to tackle that because I haven't used the command before. Maybe you could try to remoteExec it too since it seems to be working properly when executed on the host. You could try something like


[boat, true] remoteExec["hideObjectGlobal", 2, true]; [boatplace, "splash"] remoteExec["say3D", 2, false];

Unfortunately, I am not sure about any of those two 😞  and I am just speculating here. I believe it's not too much of a burden to try them so it may be worth it. Wish you luck with it and hopefully, someone more knowledgeable than me will be able to provide a solution based on solid foundations instead of mere speculations.

 

Please spend some time to provide a solution if you find it to help people in the future.

 

5 minutes ago, haleks said:

@fin_soldier: the syntax is messed up in your last line :

 


<params> remoteExec ["fnc_someScriptedFunction", targets, JIP];

 

So instead of


remoteExec ["BIS_fnc_holdActionAdd", 0, boat]

You should have the following :


remoteExec ["BIS_fnc_holdActionAdd", 0, true]

  

 

Thanks, I'll try both of these solutions!

Share this post


Link to post
Share on other sites
2 hours ago, ZaellixA said:

hideObjectGlobal should have a global effect. BUT, according to the docs, it should be executed on the server only.

^^ this

 

2 hours ago, ZaellixA said:

[boat, true] remoteExec["hideObjectGlobal", 2, true];

hideObjectGlobal is not remote executable

Say3D is local effect only, but is remote executable.

 

57 minutes ago, haleks said:

the syntax is messed up in your last line :

57 minutes ago, haleks said:

remoteExec ["BIS_fnc_holdActionAdd", 0, boat]

There is nothing wrong with that line. It just means the remoteExec is executed on JIP as long as boat is not null.

Quote

JIP (Optional): [default: false]
 

Object or Group or netId - The persistent execution of the given remoteExec statement will be attached to the given Object or Group,

When Object or Group is deleted and becomes objNull or grpNull, the persistent remoteExec statement is automatically removed from JIP queue.

 

 

Spoiler

//initServer.sqf

TAG_fnc_hideBoat = {
	params[ "_boat" ];
	
	_boat hideObjectGlobal true;
	[ boatPlace, "splash" ] remoteExec[ "say3D", [ 0, -2 ] select isDedicated ];
};


[
	boat,                                                               // Object the action is attached to
	"Move the boat",                                                    // Title of the action
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",     // Idle icon shown on screen
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",     // Progress icon shown on screen
	"_this distance _target < 3",                                       // Condition for the action to be shown
	"_caller distance _target < 3",                                     // Condition for the action to progress
	{ [ boatstuck, "push" ] remoteExec[ "say3D", 0 ]; },                // Code executed when action starts
	{},                                                                 // Code executed on every progress tick
	{ [ boat ] remoteExec[ "TAG_fnc_hideBoat", 2 ]; },                  // Code executed on completion
	{},                                                                 // Code executed on interrupted
	[],                                                                 // Arguments passed to the scripts as _this select 3
	5,                                                                  // Action duration [s]
	0,                                                                  // Priority
	false,                                                              // Remove on completion
	false                                                               // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", [ 0, -2 ] select isDedicated, boat];

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Larrow said:

There is nothing wrong with that line. It just means the remoteExec is executed on JIP as long as boat is not null.

 

 

  Reveal hidden contents


//initServer.sqf

TAG_fnc_hideBoat = {
	params[ "_boat" ];
	
	_boat hideObjectGlobal true;
	[ boatPlace, "splash" ] remoteExec[ "say3D", [ 0, -2 ] select isDedicated ];
};


[
	boat,                                                               // Object the action is attached to
	"Move the boat",                                                    // Title of the action
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",     // Idle icon shown on screen
	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",     // Progress icon shown on screen
	"_this distance _target < 3",                                       // Condition for the action to be shown
	"_caller distance _target < 3",                                     // Condition for the action to progress
	{ [ boatstuck, "push" ] remoteExec[ "say3D", 0 ]; },                // Code executed when action starts
	{},                                                                 // Code executed on every progress tick
	{ [ boat ] remoteExec[ "TAG_fnc_hideBoat", 2 ]; },                  // Code executed on completion
	{},                                                                 // Code executed on interrupted
	[],                                                                 // Arguments passed to the scripts as _this select 3
	5,                                                                  // Action duration [s]
	0,                                                                  // Priority
	false,                                                              // Remove on completion
	false                                                               // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", [ 0, -2 ] select isDedicated, boat];

 

 

 

Learned something here, thanks mate. 😉 

  • Like 1

Share this post


Link to post
Share on other sites

@fin_soldier,

Quote

Yes, it's a invisible helipad I use for sound FX sometimes...

Invisible helipads are scripted objects. Although this is not likely the cause of the problem you may consider using helper objects (located under objects--> signs) in the future.

General rule: don't use invisible helipads unless you want a helicopter to land there.

Have fun!

  • 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

×