Jump to content
Sign in to follow this  
eagledude4

Random image loading screen

Recommended Posts

I couldn't find a topic about a random loading screen, in either arma3 or arma2 boards, so I'd like to ask it here. Is it possible?

_Picture = ["Images\1.jpg", "Images\2.jpg", "Images\3.jpg"] call BIS_fnc_selectRandom;
loadScreen = _Picture;

Returns: "cannot load picture _Picture". does that mean I can't replace a path with a variable?

Share this post


Link to post
Share on other sites

I can remember a thread in the arma 2 boards, only found it because i have some posts in it tho :)

http://forums.bistudio.com/showthread.php?144640-Few-Scripts-with-Problems&p=2276002#post2276002

F2k Sel - post 4

loadScreen = __EVAL(["pics\flags\jsf1.paa", "pics\flags\jsf2.paa", "pics\flags\jsf3.paa", "pics\flags\jsf4.paa"] select floor random 4);
Edited by Lifted86
round to floor

Share this post


Link to post
Share on other sites

you should use "select floor random 4);"

if you round 3.9 to 4 and only have 4 elements in a array you'll get a error.

check notes

Share this post


Link to post
Share on other sites

Is the "__EVAL" necessary? I don't understand its usage.

@marker: How would I use "CfgLoadingScreens" in combination with "loadScreen ="? Would I just include the CfgLoadingScreens and not use "loadScreen = "?

Edited by eagledude4

Share this post


Link to post
Share on other sites
I used

loadScreen = __EVAL(["Images\1.paa", "Images\2.paa", "Images\3.paa"] select floor random 4);

that showed one of the images, but then said picture <null> not found.

is the "__EVAL" necessary?

how would I use "CfgLoadingScreens" in combination with "loadScreen ="? Would I just include the CfgLoadingScreens and not use "loadScreen = "?

you have 3 items but make it generate random out of 4

---------- Post added at 03:30 ---------- Previous post was at 03:28 ----------

you should use "select floor random 4);"

if you round 3.9 to 4 and only have 4 elements in a array you'll get a error.

check notes

Incorrect. This is why you use floor.

Share this post


Link to post
Share on other sites

Sorry, I forgot to change the 4 to a 3. (which shouldn't matter now because I've decided to use the loadingscreen class.

class CfgLoadingScreens
{
//--- Delay between images are swapped
refreshDelay = 5;

//--- Classes with paths to image files
class Screen1	{text="Images\1.paa";};
class Screen2	{text="Images\2.paa";};
class Screen3	{text="Images\3.paa";};
};

doesn't return an error, but the image doesn't show now.

I commented out my old

loadScreen = __EVAL(["Images\1.paa", "Images\2.paa", "Images\3.paa"] select floor random 3); 

line as well.

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  

×