Jump to content
Sign in to follow this  
Cloughy

Script command that may crash a Dedi server

Recommended Posts

The following command crashed my dedi server when i tried to run my map on it. I had the following script in my init.sqs.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_preload = [] spawn {waitUntil{preloadCamera markerPos "cam2"}};

_preload1 =[] spawn {waitUntil{preloadCamera markerPos "uaz1"}};

_preload2 =[] spawn {waitUntil{preloadCamera markerPos "cam6"}};

@scriptDone _preload

@scriptDone _preload1

@scriptDone _preload2

Anyone else had this prob.

It crashed with the dedi run from Arma.exe, and the dedi exe. both of them 1.02.

But the map worked when i hosted it from ingame.

Cheers

GC

Share this post


Link to post
Share on other sites

That code makes no sense to me...

[Edit] nevermind.. thought command was local var

Why wouldn't you just:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

@(preloadCamera markerPos "Cam2")

??

Share this post


Link to post
Share on other sites

not very good at scripting, it just the way i picked up the code from an example. Think it is used this way in intro to the game, ie the cutscenes it plays behind the menu.

Think the @ScriptDone makes it wait. But may be wrong.

Cheers

GC

Share this post


Link to post
Share on other sites

There is no need to pre-load the camera on the dedicated server, so if it's not a client you can just avoid calling it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (IsNull Player) Then {goto "SkipPreload"}

_preload = [] spawn {waitUntil{preloadCamera markerPos "cam2"}}

_preload1 =[] spawn {waitUntil{preloadCamera markerPos "uaz1"}}

_preload2 =[] spawn {waitUntil{preloadCamera markerPos "cam6"}}

@scriptDone _preload

@scriptDone _preload1

@scriptDone _preload2

#SkipPreload

Your mixing the old and new syntax in your original code. Not sure off hand which one init.sqs supports (may support both), so I stuck with the old syntax.

Quote[/b] ]Think the @ScriptDone makes it wait. But may be wrong.

Yeah, the @ is the old version of waitUntil. So you could have also written it like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil {scriptDone _preload}

WaitUntil {scriptDone _preload1}

WaitUntil {scriptDone _preload2}

BTW Is it worth trying to pre-load three different cameras at the same time? Isn't there a chance that each sucessive preload, will overwrite the last one?

Share this post


Link to post
Share on other sites

I don't think he could have written it that way.

WaitUntil is sqf only. The only reason it works (I think) in his original request is becaue he is spawning SQF code.

I still think that he should replace his entire original code with this (includes your change also):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

If (IsNull Player) Then {goto "SkipPreload"}

@(preloadCamera markerPos "cam2")

@(preloadCamera markerPos "uaz1")

@(preloadCamera markerPos "cam6")

#SkipPreload

...

...

I usually promote SQF, but this is one of those "it really doesn't help" cases.

Share this post


Link to post
Share on other sites
Quote[/b] ]WaitUntil is sqf only

Yeah, I guess init.sqs doesn't support the new syntax.

Share this post


Link to post
Share on other sites

Preloading can really crash dedicated server. This was the cause of our CTI map crashing, it is already fixed for the demo server and it will be fixed in the next patch for the retail version as well.

As a workaround, you may want to avoid preloading on the server - there is no reason to do it anyway, as server is not displaying any graphics anyway.

Share this post


Link to post
Share on other sites

I used UNN's script. It seems to work. I put the code in the init.sqs. It is needed for my cutscene in my coop mission, dont like it drawing the Uaz and stuff in my cut.

Cheers

GC

P.S.

thanks again UNN & all that helped.

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  

×