Jump to content
Sign in to follow this  
jakerod

Preload a scene

Recommended Posts

I am having trouble getting my scenes to preload. Whenever the camera switches over to the next section all the LODs and textures are all screwy and they take a few seconds too load all the way. Needless to say that looks like total crap.

I was under the impression that the campreload command or preloadcamera command would take care of this but I can't get any of them to work. I was wondering if anyone could help me out with this. None of the searches I did were of any use. Which is the right command? Do they even work the way they are supposed to? What does the 'time' field do?

Example of my scripting code.

NOTE: I cut out a few parts of it so that it wouldn't take up 2000 lines. But the way I have the sections set up are the same as they way the other sections are set up.

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

ShowCinemaborder true

_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

titlecut ["","BLACK FADED",0]

titlecut ["","BLACK IN",10]

;=== Sun

_camera camPrepareTarget [11320.44,18469.41,895.16]

_camera camPreparePos [8040.16,17150.86,26.99]

_camera camPrepareFOV 0.700

_camera camPreload 1

_camera camCommitPrepared 0

@camCommitted _camera

~1

;=== Base

_camera camPrepareTarget [61229.83,-52360.82,-48209.86]

_camera camPreparePos [8040.16,17150.86,26.99]

_camera camPrepareFOV 0.700

_camera camPreload 1

_camera camCommitPrepared 10

@camCommitted _camera

titlecut ["","BLACK OUT",5]

~2

;=== Sun overbase

titlecut ["","BLACK In",5]

_camera camPrepareTarget [103779.46,49311.91,19926.63]

_camera camPreparePos [11821.05,15353.98,12.28]

_camera camPrepareFOV 0.282

_camera camPreload 1

_camera camCommitPrepared 0

@camCommitted _camera

~2

;=== Base2

_camera camPrepareTarget [99672.69,62598.67,-6910.51]

_camera camPreparePos [11821.21,15354.04,12.28]

_camera camPrepareFOV 0.622

_camera camPreload 1

_camera camCommitPrepared 10

@camCommitted _camera

titlecut ["","BLACK OUT",5]

~2

titlecut ["","BLACK OUT",3]

~5

_camera cameraeffect ["terminate", "back"]

camdestroy _camera

5 fademusic 0

; Exit this script

exit

Share this post


Link to post
Share on other sites

Can you increase the waiting time before the intro starts?

Share this post


Link to post
Share on other sites
Can you increase the waiting time before the intro starts?

I could but would that actually do anything? It switches from a camp to a base that is about 1.5 - 2km away and is blocked by a mountain. It doesn't seem to start to load it until the scene switches over to it. I could try that though.

EDIT: Didn't work. All that happened was I looked at a soldiers back for the first 10 seconds (which is what I expected) and then it did the same thing again. Although it only did the weird LOD thing the first time. The next couple times it was fine. I am trying to post an image of what happened but my photobucket account is being screwy.

Share this post


Link to post
Share on other sites

As Sgt.Ace said, look here.

It should be used with the "waituntil" (sqf) command or with an "@" (sqs) to give it time to preload. I don't think it works on its own.

I notice mission makers often don't bother preloading and it makes cutscenes that could have been good look like total crap crazy_o.gif

Edit: It might be a good idea to look at the Devils Cross mission. The intro seemed to preload scenes properly. It's the Atari US exclusive mission, but it's easy to find if you don't have it (hint: official missions forum section).

Share this post


Link to post
Share on other sites

take a look into the original ArmA campaign or the ArmA start Menu sequence ...

Share this post


Link to post
Share on other sites

If it doesn't work right no matter what ArmA scripting commands you try, maybe you could try an old OFP trick.

Keep the screen black and let a camera rotate around the scene and after that is done, start showing the cutscene. This is a good way in OFP to reduce stuttering in cutscenes.

You could try to do this trick right in the start of the mission for both/all cutscene locations, before any cutscenes have played. If that doesn't work out well then try doing it in the order of the cutscenes (do it when you switch cutscene locations).

Share this post


Link to post
Share on other sites

After looking at the Blood Sweat and Tears intro:

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

_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

titlecut ["","BLACK FADED",0]

titlecut ["","BLACK IN",10]

@preloadCamera [58212.89,105577.34,38.73]

;=== Sun

_camera camPrepareTarget [109466.34,49175.24,22730.76]

_camera camPreparePos [18762.59,13693.38,14.88]

_camera camPrepareFOV 0.462

_camera camCommitPrepared 0

@camCommitted _camera

~5

;=== mi17

_camera camPrepareTarget [58212.89,105577.34,38.73]

_camera camPreparePos [18807.26,13668.72,2.58]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 10

@camCommitted _camera

~1

@preloadCamera [-59313.96,71573.26,-22835.18]

@preloadCamera [-61234.77,-44986.86,21490.88]

titlecut ["","BLACK OUT",3]

titlecut ["","BLACK IN",3]

;=== Moon

_camera camPrepareTarget [-61234.77,-44986.86,21490.88]

_camera camPreparePos [17890.34,12300.13,33.07]

_camera camPrepareFOV 0.391

_camera camCommitPrepared 0

@camCommitted _camera

~2

;=== Prison

_camera camPrepareTarget [-59313.96,71573.26,-22835.18]

_camera camPreparePos [17890.34,12300.13,33.07]

_camera camPrepareFOV 0.391

_camera camCommitPrepared 10

@camCommitted _camera

~5

titlecut ["","BLACK OUT",3]

~5

_camera cameraeffect ["terminate", "back"]

camdestroy _camera

5 fademusic 0

; Exit this script

exit

That is my new code.

I changed the location so thats why the numbers are different. It doesn't seem to do that much though. The textures of the mountains in the moon section still don't load correctly and the Helipad in the mi17 scene doesn't load correctly. For the most part everything else is fine though. Is that the best I am going to get it or do you guys know of anything else?

Also thanks for helping me out guys it has gotten better.

EDIT: Is there anyway to do this without throwing off the timing of the entire intro. Sometimes it will sit at one scene for 15 seconds other times it will sit there for 5 seconds which throws off the timing of the cameras for everything else.

Share this post


Link to post
Share on other sites

I haven't tested this, so shoot me if I'm wrong smile_o.gif

Looking at your original code. I thought it might be better if you called the preload command after you commited the camera changes rather than before.

Have you tried?

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

@camCommitted _camera

_camera camPreload 1

@camPreloaded _camera

Worth a try I suppose.

Share this post


Link to post
Share on other sites

What unn said is basically what I was going to say there, except that I also stress the importance of preloading the next scene *while* doing the current scene. I still intend to run some tests on this so I can know for sure what I'm talking about, instead of just stating my experiences with it.

Share this post


Link to post
Share on other sites
Quote[/b] ]I still intend to run some tests on this so I can know for sure what I'm talking about, instead of just stating my experiences with it.

If either of you can confirm it, one way or another. Then please let us know.

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  

×