Jump to content
sina alex

[FIXED] artillery fire order to ai wont work on MP

Recommended Posts

hello , i have run a test

(about showing a target scene what there an ai must start fire 3 round of mortart to my target via mortar)

on single player and multiplayer on my pc in both of ways it work successfully, camera start moving and show mortar and the ai start fire  fine,

but when i up the mission to server for test the ai wont fire and just camera show he and he still not fire,

i test this codes on server :

_camera = "camera" camcreate position h2; 
_camera cameraeffect ["internal", "back"]; 
_camera camPrepareTarget g2;
_camera camCommitPrepared 5; 
g2 commandArtilleryFire [position han2, "8Rnd_82mm_Mo_shells",3];
_camera camPreparePos position h2_1;
_camera camPrepareFOV 0.700; 
_camera camCommitPrepared 6;
_camera camPrepareFOV 0.700; 
waitUntil {camCommitted _camera};
_camera cameraEffect ["terminate","back"]; 
camDestroy _camera;

for sure i test another command as :

_camera = "camera" camcreate position h1; 
_camera cameraeffect ["internal", "back"]; 
_camera camPrepareTarget g1;
_camera camCommitPrepared 5; 
g1 doArtilleryFire [position han1,"8Rnd_82mm_Mo_shells",3];
_camera camPreparePos position h1_1;
_camera camPrepareFOV 0.700; 
_camera camCommitPrepared 6;
_camera camPrepareFOV 0.700; 
waitUntil {camCommitted _camera};
_camera cameraEffect ["terminate","back"]; 
camDestroy _camera;

both kind of codes work just in single and mp mod in my pc, and not work on server.

any help have my regards.

Share this post


Link to post
Share on other sites

How and where are you executing your code?

 

2 hours ago, sina alex said:

both kind of codes work just in single and mp mod in my pc, and not work on server

 

This tells us that the issue is locality.

Many of the commands you are using are LE, meaning they must be executed on (or broadcast to) any machine where the effects need to be seen. 

 

It seems as though you are executing on server, so you will need to either execute on clients or remoteExec instead.

  • Like 1

Share this post


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

How and where are you executing your code?

 

 

This tells us that the issue is locality.

Many of the commands you are using are LE, meaning they must be executed on (or broadcast to) any machine where the effects need to be seen. 

 

It seems as though you are executing on server, so you will need to either execute on clients or remoteExec instead.

thank for answer,

i use execvm in triger from game and on triger ,address the sqf file code as i send there.

 

execvm "S\1.sqf";

 

as you say the code must run on each client i can use this?

[param] remoteExec ["doArtilleryFire", ([0, -2] select isDedicated), true];

and how i can insert my code on param part ?!

g1 doArtilleryFire [position han1,"8Rnd_82mm_Mo_shells",3];

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

×