Jump to content
Sign in to follow this  
God of Monkeys

My Multiplayer Mission have problem!(Help me)

Recommended Posts

I make traing mission for my squad,and I meet soom problem with this.

The problem is when game start with 5 or fewer persons to start game,and then other people join game later,the mission will fine and play funny~!^^

But when more than 10 people , the mission while lag when game start,and this situation while keep going........

Overall,some people game will crash and the other will keep lagging..........

So I suspect the problem might is init.sqf,because it will load from beginning of mission.

This is my init.sqf

// by Bon_Inf*
#include "config.sqf"

if(isNil "tfor_deathcount") then {tfor_deathcount = 0};
Server setVariable ["tfor_artifunds",tfor_artifunds,false];


if(not isDedicated) then{WaitUntil{not isNull player}};
[tfor_timespeedup] execFSM "fsm\skiptime.fsm";
[] execFSM "fsm\vehicledrivercheck.fsm";

private ["_aci"];
_aci = execVM "pxs_satcom_oa\console_init.sqf";
nillllll=[HA01,"ON"] execVM "pxs_satcom_oa\init_satellite.sqf";
nilllll=[HA02,"ON"] execVM "pxs_satcom_oa\init_satellite.sqf";


execVM "BTK\Cargo Drop\Start.sqf";



[] execVM "initplayer.sqf";
[] execVM "bon_settings\bon_settings_init.sqf";

[] spawn {
light = "#lightpoint" createVehicle getpos tour01;
light setLightBrightness .4;
light setLightAmbient[1.0, 1.0, 1.0];
light setLightColor[1.0, 1.0, 1.0];
light lightAttachObject [tour01, [0,0,13]];
light2 = "#lightpoint" createVehicle getpos tour02;
light2 setLightBrightness .4;
light2 setLightAmbient[1.0, 1.0, 1.0];
light2 setLightColor[1.0, 1.0, 1.0];
light2 lightAttachObject [tour02, [0,0,13]];
light3 = "#lightpoint" createVehicle getpos tour03;
light3 setLightBrightness .4;
light3 setLightAmbient[1.0, 1.0, 1.0];
light3 setLightColor[1.0, 1.0, 1.0];
light3 lightAttachObject [tour03, [0,0,13]];
light4 = "#lightpoint" createVehicle getpos tour04;
light4 setLightBrightness .4;
light4 setLightAmbient[1.0, 1.0, 1.0];
light4 setLightColor[1.0, 1.0, 1.0];
light4 lightAttachObject [tour04, [0,0,13]];
light5 = "#lightpoint" createVehicle getpos tour05;
light5 setLightBrightness .4;
light5 setLightAmbient[1.0, 1.0, 1.0];
light5 setLightColor[1.0, 1.0, 1.0];
light5 lightAttachObject [tour05, [0,0,13]];
light6 = "#lightpoint" createVehicle getpos tour06;
light6 setLightBrightness .4;
light6 setLightAmbient[1.0, 1.0, 1.0];
light6 setLightColor[1.0, 1.0, 1.0];
light6 lightAttachObject [tour06, [0,0,13]];
light7 = "#lightpoint" createVehicle getpos tour07;
light7 setLightBrightness .4;
light7 setLightAmbient[1.0, 1.0, 1.0];
light7 setLightColor[1.0, 1.0, 1.0];
light7 lightAttachObject [tour07, [0,0,13]];
light8 = "#lightpoint" createVehicle getpos tour08;
light8 setLightBrightness .4;
light8 setLightAmbient[1.0, 1.0, 1.0];
light8 setLightColor[1.0, 1.0, 1.0];
light8 lightAttachObject [tour08, [0,0,13]];
light9 = "#lightpoint" createVehicle getpos tour09;
light9 setLightBrightness .4;
light9 setLightAmbient[1.0, 1.0, 1.0];
light9 setLightColor[1.0, 1.0, 1.0];
light9 lightAttachObject [tour09, [0,0,13]];
light10 = "#lightpoint" createVehicle getpos tour10;
light10 setLightBrightness .4;
light10 setLightAmbient[1.0, 1.0, 1.0];
light10 setLightColor[1.0, 1.0, 1.0];
light10 lightAttachObject [tour10, [0,0,13]];
light11 = "#lightpoint" createVehicle getpos tour11;
light11 setLightBrightness .4;
light11 setLightAmbient[1.0, 1.0, 1.0];
light11 setLightColor[1.0, 1.0, 1.0];
light11 lightAttachObject [tour11, [0,0,13]];
light12 = "#lightpoint" createVehicle getpos tour12;
light12 setLightBrightness .4;
light12 setLightAmbient[1.0, 1.0, 1.0];
light12 setLightColor[1.0, 1.0, 1.0];
light12 lightAttachObject [tour12, [0,0,13]];
light13 = "#lightpoint" createVehicle getpos tour13;
light13 setLightBrightness .4;
light13 setLightAmbient[1.0, 1.0, 1.0];
light13 setLightColor[1.0, 1.0, 1.0];
light13 lightAttachObject [tour13, [0,0,13]];
light14 = "#lightpoint" createVehicle getpos tour14;
light14 setLightBrightness .4;
light14 setLightAmbient[1.0, 1.0, 1.0];
light14 setLightColor[1.0, 1.0, 1.0];
light14 lightAttachObject [tour14, [0,0,13]];
light15 = "#lightpoint" createVehicle getpos tour15;
light15 setLightBrightness .4;
light15 setLightAmbient[1.0, 1.0, 1.0];
light15 setLightColor[1.0, 1.0, 1.0];
light15 lightAttachObject [tour15, [0,0,13]];
light16 = "#lightpoint" createVehicle getpos tour16;
light16 setLightBrightness .4;
light16 setLightAmbient[1.0, 1.0, 1.0];
light16 setLightColor[1.0, 1.0, 1.0];
light16 lightAttachObject [tour16, [0,0,13]];
light17 = "#lightpoint" createVehicle getpos tour17;
light17 setLightBrightness .4;
light17 setLightAmbient[1.0, 1.0, 1.0];
light17 setLightColor[1.0, 1.0, 1.0];
light17 lightAttachObject [tour17, [0,0,13]];
light18 = "#lightpoint" createVehicle getpos tour18;
light18 setLightBrightness .4;
light18 setLightAmbient[1.0, 1.0, 1.0];
light18 setLightColor[1.0, 1.0, 1.0];
light18 lightAttachObject [tour18, [0,0,13]];
light19 = "#lightpoint" createVehicle getpos tour19;
light19 setLightBrightness .4;
light19 setLightAmbient[1.0, 1.0, 1.0];
light19 setLightColor[1.0, 1.0, 1.0];
light19 lightAttachObject [tour19, [0,0,13]];
light20 = "#lightpoint" createVehicle getpos tour20;
light20 setLightBrightness .4;
light20 setLightAmbient[1.0, 1.0, 1.0];
light20 setLightColor[1.0, 1.0, 1.0];
light20 lightAttachObject [tour20, [0,0,13]];
light21 = "#lightpoint" createVehicle getpos tour21;
light21 setLightBrightness .4;
light21 setLightAmbient[1.0, 1.0, 1.0];
light21 setLightColor[1.0, 1.0, 1.0];
light21 lightAttachObject [tour21, [0,0,13]];
light22 = "#lightpoint" createVehicle getpos tour22;
light22 setLightBrightness .4;
light22 setLightAmbient[1.0, 1.0, 1.0];
light22 setLightColor[1.0, 1.0, 1.0];
light22 lightAttachObject [tour22, [0,0,13]];
light23 = "#lightpoint" createVehicle getpos tour23;
light23 setLightBrightness .4;
light23 setLightAmbient[1.0, 1.0, 1.0];
light23 setLightColor[1.0, 1.0, 1.0];
light23 lightAttachObject [tour23, [0,0,13]];
light24 = "#lightpoint" createVehicle getpos tour24;
light24 setLightBrightness .4;
light24 setLightAmbient[1.0, 1.0, 1.0];
light24 setLightColor[1.0, 1.0, 1.0];
light24 lightAttachObject [tour24, [0,0,13]];
light25 = "#lightpoint" createVehicle getpos tour25;
light25 setLightBrightness .4;
light25 setLightAmbient[1.0, 1.0, 1.0];
light25 setLightColor[1.0, 1.0, 1.0];
light25 lightAttachObject [tour25, [0,0,13]];
light26 = "#lightpoint" createVehicle getpos tour26;
light26 setLightBrightness .4;
light26 setLightAmbient[1.0, 1.0, 1.0];
light26 setLightColor[1.0, 1.0, 1.0];
light26 lightAttachObject [tour26, [0,0,13]];
light27 = "#lightpoint" createVehicle getpos tour27;
light27 setLightBrightness .4;
light27 setLightAmbient[1.0, 1.0, 1.0];
light27 setLightColor[1.0, 1.0, 1.0];
light27 lightAttachObject [tour27, [0,0,13]];
};



returnRadio = false;
1 setRadioMsg "NULL";

SRtargets = [sR1,SR2,SR3,SR4,SR5,SR6,SR7,SR8,SR9,SR10,SR11,SR12,SR13,SR14,SR15,SR16,SR17,SR18,SR19,SR20,SR21,SR22,SR23];
HSRtargets = [HSR1,HSR2,HSR3,HSR4,HSR5];
CQBtargets = [CQB1,CQB2,CQB3,CQB4,CQB5,CQB6,CQB7,CQB8,CQB9,CQB10,CQB11,CQB12,CQB13,CQB14,CQB15,CQB16,CQB17,CQB18,CQB19,CQB20,CQB21,CQB22,CQB23,CQB24,CQB25,CQB26,CQB27,CQB28,CQB29,CQB30,CQB31,CQB32,CQB33,CQB34,CQB35,CQB36,CQB37,CQB38,CQB39,CQB40,CQB41,CQB42,CQB43,CQB44,CQB45,CQB46];
SUPtargets = [sUP1,SUP2,SUP3,SUP4,SUP5,SUP6,SUP7,SUP8,SUP9,SUP10,SUP11,SUP12,SUP13,SUP14,SUP15,SUP16,SUP17,SUP18,SUP19,SUP20,SUP21,SUP22,SUP23,SUP24,SUP25,SUP26,SUP27,SUP28,SUP29,SUP30];
SNItargets = [sNI1,SNI2,SNI3,SNI4,SNI5,SNI6,SNI7,SNI8,SNI9,SNI10,SNI11,SNI12,SNI13,SNI14,SNI15,SNI16,SNI17,SNI18,SNI19,SNI20,SNI21,SNI22,SNI23,SNI24,SNI25,SNI26,SNI27,SNI28,SNI29,SNI30,SNI31,SNI32,SNI33,SNI34,SNI35,SNI36,SNI37,SNI38,SNI39,SNI40,SNI41,SNI42,SNI43,SNI44];
GRtargets = [GR1_1,GR1_2,GR2_1,GR2_2,GR3_1,GR3_2,GR4_1,GR4_2];
_RangeMarkers = nearestObjects [shootingRangeLocation, ["Sign_Danger"], 350];
{
 _x enableSimulation false;
 _x allowDamage false;
} forEach _RangeMarkers;
ID143679 animate ["DVERE2R",0]; 
ID143679 animate ["DVERE2L",0];
ID143679 animate ["DVERE1R",0]; 
ID143679 animate ["DVERE1L",0];
uoenter = getpos RM nearestObject 143716;
uoenter animate ["DVERE3",0];
nopop = true;
MOUTtargets = nearestObjects [MOUTLocation, ["TargetEpopup"], 60];
MOUT_PT = [pt1,pt2,pt3,pt4,pt5,pt6];
{_x animate ["terc", 0]} forEach MOUTtargets;
{_x animate ["terc", 1]} forEach MOUT_PT;
pt1popped = false;
pt2popped = false;
pt3popped = false;
pt4popped = false;
pt5popped = false;
pt6popped = false;

 //Enable communication menu
 BIS_MENU_GroupCommunication = 
 [
["User menu", false],
["Anim : Dance", [2], "", -5, [["expression", "player playmovenow ""ActsPercMstpSnonWnonDnon_DancingDuoIvan"";"]], "1", "1"],
["Anim : Dance2", [3], "", -5, [["expression", "player playmovenow ""ActsPercMstpSnonWnonDnon_DancingDuoStefan"";"]], "1", "1"],
["Anim : Talk", [4], "", -5, [["expression", "player playmovenow ""AidlPercSnonWnonDnon_talkAS"";"]], "1", "1"],
["Anim : Quick Knee bend", [5], "", -5, [["expression", "player playmovenow ""AmovPercMstpSnonWnonDnon_exerciseKneeBendB"";"]], "1", "1"],
["Anim : Knee bend", [6], "", -5, [["expression", "player playmovenow ""AmovPercMstpSnonWnonDnon_exerciseKneeBendA"";"]], "1", "1"],
["Anim : Kata", [7], "", -5, [["expression", "player playmovenow ""AmovPercMstpSnonWnonDnon_exerciseKata"";"]], "1", "1"],
["Anim : TalkHeated", [8], "", -5, [["expression", "player playmovenow ""AidlPercSlowWrflDnon_talkHeated"";"]], "1", "1"],
["Anim : GoGoGo", [9], "", -5, [["expression", "player playmovenow ""AsigPercMstpSlowWrflDnon_AmovPercMrunSlowWrflDnon_GoGo"";"]], "1", "1"],
["Anim : Push up", [10], "", -5, [["expression", "player playmovenow ""AmovPercMstpSnonWnonDnon_exercisePushup"";"]], "1", "1"],
["Anim : Sit on chair", [11], "", -5, [["expression", "[player] execvm ""functions\sitonchair.sqf"";"]], "1", "1"]
 ];







//Task note
player createDiaryRecord ["Diary",["Radio","<br/>Flight vehicle the vehicle driver, and team leader level with the ground<br/>To liaise with AN/PRC-152"]];

player createDiaryRecord ["Diary",["Author","<br/>
This task by the God of Monkeys. Yong Bo production.<br /><br />Enjoy.<br/><br/>Thank you play.
<br/><br/><br/>
Our clan website(https://sites.google.com/site/wardogtcs/)
<br/><br/>"]];


player createDiaryRecord["Diary", ["Mission","In this map to learn all the skills of ArmA2.<br/><br/>Please respect your instructor and thank him for his teaching.<br/><br/>Finally, welcome to join this big family of the WARDOG.<br/><br/>"]];

So I suspect init.sqf is too long,it's right?

Share this post


Link to post
Share on other sites

Your lightpoint creation seems wrong - but not 100% sure.

Right now it creates 27 for each player joining/playing.

At some point it could get too much.

Either add:

if (isServer) then

or change them to createVehicleLocal

If that does not help, disable parts of the code, test.

If not better, disable more parts of the code, test.

Repeat until problematic code is found.

Share this post


Link to post
Share on other sites

So how to wirte script?

I am new at script.

Or write lightpoint directly to the lighthouse init?

---------- Post added at 01:18 PM ---------- Previous post was at 12:44 PM ----------

And I find another amazing problem,that is whather it is the version of the start with 5 people or 10 people,all people will very lag when somebody disconnected with server,and it will keep lagging.......

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  

×