Results 1 to 8 of 8

  Click here to go to the first Developer post in this thread.  

Thread: Script command that may crash a Dedi server

  1. #1
    Staff Sergeant
    Join Date
    Jan 25 2002
    Location
    Manchester, GB
    Posts
    348
    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 = &#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;cam2&#34;}};
    _preload1 =&#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;uaz1&#34;}};
    _preload2 =&#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;cam6&#34;}};
    @scriptDone _preload
    @scriptDone _preload1
    @scriptDone _preload2
    [/QUOTE]

    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




  2. #2
    That code makes no sense to me...

    [Edit] nevermind.. thought command was local var

    Why wouldn&#39;t you just:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    @&#40;preloadCamera markerPos &#34;Cam2&#34;&#41;
    [/QUOTE]??




  3. #3
    Staff Sergeant
    Join Date
    Jan 25 2002
    Location
    Manchester, GB
    Posts
    348
    Author of the Thread
    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

  4. #4
    There is no need to pre-load the camera on the dedicated server, so if it&#39;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 &#40;IsNull Player&#41; Then {goto &#34;SkipPreload&#34;}
    _preload = &#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;cam2&#34;}}
    _preload1 =&#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;uaz1&#34;}}
    _preload2 =&#91;&#93; spawn {waitUntil{preloadCamera markerPos &#34;cam6&#34;}}
    @scriptDone _preload
    @scriptDone _preload1
    @scriptDone _preload2
    #SkipPreload
    [/QUOTE]

    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 Originally Posted by [b
    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}[/QUOTE]

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

  5. #5
    I don&#39;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 &#40;IsNull Player&#41; Then {goto &#34;SkipPreload&#34;}
    @&#40;preloadCamera markerPos &#34;cam2&#34;&#41;
    @&#40;preloadCamera markerPos &#34;uaz1&#34;&#41;
    @&#40;preloadCamera markerPos &#34;cam6&#34;&#41;

    #SkipPreload
    ...
    ...
    [/QUOTE]

    I usually promote SQF, but this is one of those "it really doesn&#39;t help" cases.

  6. #6
    Quote Originally Posted by [b
    Quote[/b] ]WaitUntil is sqf only
    Yeah, I guess init.sqs doesn&#39;t support the new syntax.

  7.   This is the last Developer post in this thread.   #7
    BI Developer Suma's Avatar
    Join Date
    Jun 27 2001
    Location
    Czech Republic
    Posts
    3,708
    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.
    Ondrej Spanel, BIS Lead Programmer

  8. #8
    Staff Sergeant
    Join Date
    Jan 25 2002
    Location
    Manchester, GB
    Posts
    348
    Author of the Thread
    I used UNN&#39;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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •