Jump to content
Sign in to follow this  
Kolmain

Can't Get Arty to Fire on Dedicated Server

Recommended Posts

Hi all,

I have a support script that is called via BI's communication menu (client side only) available here:

https://github.com/Kolmain/Evolution-A3/blob/dev/EVO/fn_support_mortar.sqf

The code executes flawlessly in SP/hosted MP, but on a dedicated environment the gun never fires. I thought seeking out the local client via BIS_fnc_MP would do the trick, but to no avail. Any ideas?

Code in question, everything is defined:

[color="#FF8040"][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_mortar[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]_pos[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
	[color="#1874CD"]_gun[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#000000"]_pos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]local[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]gunner[/b][/color] [color="#1874CD"]_gun[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
		[color="#1874CD"]_gun[/color] [color="#191970"][b]setVehicleAmmoDef[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color]
		[color="#1874CD"]_gun[/color] [color="#191970"][b]doArtilleryFire[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]currentMagazine[/b][/color] [color="#1874CD"]_gun[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"BIS_fnc_spawn"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Share this post


Link to post
Share on other sites
Hi all,

I have a support script that is called via BI's communication menu (client side only) available here:

https://github.com/Kolmain/Evolution-A3/blob/dev/EVO/fn_support_mortar.sqf

The code executes flawlessly in SP/hosted MP, but on a dedicated environment the gun never fires. I thought seeking out the local client via BIS_fnc_MP would do the trick, but to no avail. Any ideas?

Code in question, everything is defined:

[color="#FF8040"][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_mortar[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]_pos[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
	[color="#1874CD"]_gun[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#000000"]_pos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]local[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]gunner[/b][/color] [color="#1874CD"]_gun[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
		[color="#1874CD"]_gun[/color] [color="#191970"][b]setVehicleAmmoDef[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color]
		[color="#1874CD"]_gun[/color] [color="#191970"][b]doArtilleryFire[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]currentMagazine[/b][/color] [color="#1874CD"]_gun[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color] [color="#7A7A7A"]"BIS_fnc_spawn"[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

put this somewhere in the servers init:

KOL_fnc_doArtyFire = {
_gun = _this select 0;
_pos = _this select 1;
_gun setVehicleAmmoDef 1;
_gun doArtilleryFire [_pos,(currentMagazine _gun),5];
true;
}; publicVariable 'KOL_fnc_doArtyFire';

call in your mortar script:


//assuming _mortar and _pos are defined somewhere before this

[[_mortar,_pos],"KOL_fnc_doArtyFire",(owner _mortar),FALSE,FALSE] spawn BIS_fnc_MP;

If still not working, I'd start troubleshooting with the doArtilleryFire array, specifically ensure that (currentMagazine _gun) is actually valid. If still not functioning, then I have no idea :)

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites
put this somewhere in the servers init:

KOL_fnc_doArtyFire = {
   _gun = _this select 0;
   _pos = _this select 1;
   _gun setVehicleAmmoDef 1;
   _gun doArtilleryFire [_pos,(currentMagazine _gun),5];
   true;
}; publicVariable 'KOL_fnc_doArtyFire';

call in your mortar script:


//assuming _mortar and _pos are defined somewhere before this

[[_mortar,_pos],"KOL_fnc_doArtyFire",(owner _mortar),FALSE,FALSE] spawn BIS_fnc_MP;

If still not working, I'd start troubleshooting with the doArtilleryFire array, specifically ensure that (currentMagazine _gun) is actually valid. If still not functioning, then I have no idea :)

Well I know it works because it works locally, but maybe its possible that currentMagazine isn't returning? Alright, instead of publicVar'ing it, I'll just declare it with the rest of my functions.

Share this post


Link to post
Share on other sites
Well I know it works because it works locally, but maybe its possible that currentMagazine isn't returning? Alright, instead of publicVar'ing it, I'll just declare it with the rest of my functions.

yep thats probably the cleanest method ...

Does it work though? No point baking it in if it doesn't work! :)

What does currentMagazine return for it?

//copyToClipboard str (currentMagazine cursorTarget);

edit, nevermind you are saying the shooting bit works, sorry its late and im tired :)

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites
yep thats probably the cleanest method ...

Does it work though? No point baking it in if it doesn't work! :)

I'm in the office and can't test it :(

Share this post


Link to post
Share on other sites

Once you get around to it, I suspect there is even cleaner more direct method, just using the command instead of a scripted function.

[[_mortar,[_pos,(currentMagazine _mortar),5]],"doArtilleryFire",(owner _mortar),FALSE,FALSE] spawn BIS_fnc_MP;

Not sure if that works but something along those lines. Would have to allow doArtilleryFire in CfgRemoteExecCommands {} description.ext (1.46) though.

Share this post


Link to post
Share on other sites
Once you get around to it, I suspect there is even cleaner more direct method, just using the command instead of a scripted function.

[[_mortar,[_pos,(currentMagazine _mortar),5]],"doArtilleryFire",(owner _mortar),FALSE,FALSE] spawn BIS_fnc_MP;

Not sure if that works but something along those lines. Would have to allow doArtilleryFire in CfgRemoteExecCommands {} description.ext (1.46) though.

Its not listed as supported?

https://community.bistudio.com/wiki/CfgRemoteExecCommands

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
Sign in to follow this  

×