Jump to content
Focisz

Changing Side of Mk21 Centurion on dedicated

Recommended Posts

Hello

I have a problem with changing side of Mk21 Centurion. I want it to be indepentent and I`ve managed to put together script posted below.

Everything works fine for local host, however for dedicated server (where the mission is going to be played) Mk21 Centurion is empty with na empty AI placed right next to it. This problem kind of makes or breaks the mission.

 

if (!isServer) exitWith {};
texture = ((getObjectTextures this) select 0);
SAM = [getposATL this, 0, "B_SAM_System_02_F", independent] call bis_fnc_spawnvehicle;
deleteVehicle this; 
(SAM select 0) setObjectTextureGlobal [0,tekstura];
(SAM select 0) setVehicleRadar 1;
(SAM select 0) setVehicleReportRemoteTargets true;
(SAM select 0) setDir 286;

 

Share this post


Link to post
Share on other sites

Perhaps because all this stuff is a little bit slow.

If you are using getPosATL this, I guess you write that in the init field of some object...

Why don't you place your SAM where you want, give it an AI indep unit as leader with a probability of presence set to false, and then, just apply the texture on it?

Share this post


Link to post
Share on other sites

@pierremgi

Yep, code is placed in the init of SAM.

Sadly your solution doesn`t work either.

 

Share this post


Link to post
Share on other sites

??? Not sure to understand what you're doing. Are you creating a SAM from a... SAM?

Share this post


Link to post
Share on other sites

Why can't you place an empty one in the editor, go into "vehicle appearance" and change textures, then place a unit of the faction you want and drag them into the SAM they same way you would with a vehicle?

 

That's how I set up my SAM sites.

  • Like 1

Share this post


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

??? Not sure to understand what you're doing. Are you creating a SAM from a... SAM?

Yep, I know this is weird. This mission was made on Jets DLC launch and I`m trying to revive it.

 

2 hours ago, JD Wang said:

Why can't you place an empty one in the editor, go into "vehicle appearance" and change textures, then place a unit of the faction you want and drag them into the SAM they same way you would with a vehicle?

 

That's how I set up my SAM sites.

But do they share a data link with other units of that faction?

Share this post


Link to post
Share on other sites

Yes, no problem. If you worry you can just add:

if (isServer) then {this setVehicleRadar 1};

in the init field of the radar. This way, the radar is on,  even for non combat phase. I think automatic is default setting.

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

×