Jump to content
CapBlackShot

Is it possible to preload textures?

Recommended Posts

Hello,

As we know, .jpg textures are often smaller than .paa or .png textures, and sometimes it's really important to the owner's mission. The problem on using .jpg textures is that they are only loaded when you are very close from the object.

Is it possible to preload those textures on the initialization? I saw that we probably could use 'preloadObject', am I right? If not, is there any other workarounds?

Thanks!

Share this post


Link to post
Share on other sites

I maybe see why mission size is an issue, but only in the big streamlined missions (i.e. Domination), but if your just working a smaller mission, there is no need the save away a few kilobytes, all that said, the .paa format (as you might know) is BIS's own file format, and I believe is the only way to get around the "loading" texture issue.

Share this post


Link to post
Share on other sites

So i found a workaround (Not ideal, but it works):

Private _OrgText = (GetObjectTextures Player select 0);
        
        {Player SetObjectTexture [0, _x]; Sleep 0.05} ForEach _CustomTextures;
        
        Player SetObjectTexture [0, _OrgText];

_CustomTextures refers to an array that contains all the custom Textures in the mission. I use this fnc at InitPlayerLocal.sqf And it works like a charm!

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, _Tally said:

So i found a workaround (Not ideal, but it works):

Private _OrgText = (GetObjectTextures Player select 0);
        
        {Player SetObjectTexture [0, _x]; Sleep 0.05} ForEach _CustomTextures;
        
        Player SetObjectTexture [0, _OrgText];

_CustomTextures refers to an array that contains all the custom Textures in the mission. I use this fnc at InitPlayerLocal.sqf And it works like a charm!

Love it, brilliant idea.  I assume screen is still dark so player can't see all the textures flash on the unit while textures being loaded.

  • Like 1

Share this post


Link to post
Share on other sites

What I do not understand in this topic: why not just using paa files? Are they so much bigger?

  • Like 1

Share this post


Link to post
Share on other sites
On 8/3/2021 at 3:15 PM, sarogahtyp said:

What I do not understand in this topic: why not just using paa files? Are they so much bigger?

Don't know if they are bigger, the reason why I dont use .paa is because I have a bunch of jpg textures that have an aspect ratio that does not allow for conversion to .paa. And I am too lazy to re-design everything

  • Like 1

Share this post


Link to post
Share on other sites
On 8/3/2021 at 2:54 PM, johnnyboy said:

Love it, brilliant idea.  I assume screen is still dark so player can't see all the textures flash on the unit while textures being loaded.

From my experience its an advantage if the screen has loaded already, its just a couple of seconds anyway..

  • Like 1

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

×