OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Surdus Priest on 11 Sep 2007, 01:13:12

Title: Preload
Post by: Surdus Priest on 11 Sep 2007, 01:13:12
I need some help with preloading cameras, i have set the positions, but im wondering whether or not the camera is actually looking at anything, or just in a position, this is my preload.sqs

Code: [Select]
preloadcamera [11779.62,5312.31,19.14]
preloadcamera [12194.23,6594.36,0.89]
preloadcamera [12953.00,7542.07,0.82]
preloadcamera [12215.34,7136.90,25.66]
preloadcamera [11931.85,7345.45,0.38]
preloadcamera [11883.92,7394.38,1.21]
preloadcamera [12051.93,7420.33,2.00]

exit

these are the preload positions when a new area is being looked at. you can see the flaws in textures.  Theres nine main areas the camera looks to and pretty much none of them are good enough... see for yourself with the link at the arma general discussion: http://www.ofpec.com/forum/index.php?topic=30238.0 (http://www.ofpec.com/forum/index.php?topic=30238.0)

please help me fix this, thank you

surdus
Title: Re: Preload
Post by: Mandoble on 11 Sep 2007, 01:35:40
preloadcamera precatches an area around the indicated position for immediate usage by real active camera. The preloading might take more or less time and more or less memory depending on detail level, vcard ram, etc. So, just after executing that command the area is not preloaded, you still need to wait a bit.

for SQS
@!preloadCamera _pos

for SQF
waitUntil preloadCamera _pos

If you execute several preload operation one after another, more than probably you will run out of cache memory quite fast, so after your last preload command, more than probably the cache of first preload has been already lost.

If you have a cutscene, preload first the area of that cutscene, and while the cutscene is running, preload the area of the next one and so on.
Title: Re: Preload
Post by: Surdus Priest on 11 Sep 2007, 03:19:55
i had a feeling that was the problem, to many preloaded at once...

so if i give a ~15 or so between each major preload it will preload it as it goes along?

i'll have to give this a try
Title: Re: Preload
Post by: myke13021 on 11 Sep 2007, 17:30:50
afaik preloadCamera will return when its done, there's a command to check which can be used as "wait" condition.

Look here (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#camPreloaded)


Myke out