HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

set variable = a random #???

07-05-2003, 09:36 PM#1
FF_Behemoth
My goal is to make my custom splash screen appear randomly during start of a game. What I mean by randomly is that during the start of each game it will show "pic1.blp" and other times it will show "pic2.blp" etc..

Uck the way I explained it is terrible (sorry) I hope some1 understands what Im sayin

*EDIT* look down 2post below.. I've attached a pic of trigger of what I want.. nvm.. solved...
07-05-2003, 09:55 PM#2
Shiv
I don't believe you can, but then again, I don't usually deal with splash screens, so don't take my word on it.
07-05-2003, 11:54 PM#3
Guest
If this is something during the game... you could make a string array of the available 'splash screens' and get a random integer between the two bounds
07-06-2003, 12:46 AM#4
Jitb
I could be wrong about this (since I have not used splash screens before) but couldn't you do this?

Event: Map Initiliaztion
Action: Set SplashScreen (Integer Variable) = Random number between 1-4 (or whatever you want).
If SplashScreen = 1 then do show Splash Screen 1
If SplashScreen = 2 then do show Splash Screen 2
etc.
07-06-2003, 12:46 AM#5
Dead-Inside
Set RandomInteger = Random Number between 1 and 2
If RandomInteger = 1 then do Splashscreen 1 else do nothing
If RandomInteger = 2 then do Splashscreen 2 else do nothing


This can be added in to any trigger and it will not show one of two. You can turn it off if you wish as well :P
07-06-2003, 01:38 AM#6
FF_Behemoth
My hero DI.......
*edit* oops Jitd almost didnt see your post..(posted same time, same info as DI did.. ya thats waht I was looking for... strangely enough.. I did look for the "set variable = random #" but I missed it :( i was at the letter R (figure it would be under R) didnt realized its under math - set random # silly me ;(

I was gona post a screenshot of the trigger what I wanted.... I was gona ask where the random # is.. But I've found it.. thx.......

Now I can add many splashsscreen as I want =) heres a preview of one of them... gota ask DraX why the quality isnt as good as the orginal tga

Heres a link to 1 of my splash screens
http://www.wc3campaigns.com/forums/s...threadid=21021
07-06-2003, 02:55 AM#7
piRo-piOn
i hate mass ifs just because i program in real life and it just pisses me off... here is your best bet:

stringArray[0]=path of 1st splash screen
stringArray[1]=path of 2nd...

action fade in to stringArray[random number between 0 and max] over howevermany seconds.

if you can't do that, set it to haze and fog... convert to custom script and change the haze and fog path to the custom script of stringArray[random number between 0 and max]
07-06-2003, 04:44 AM#8
Raptor--
ya, but cause theres no elseifs (aside from jass) (actually, well there is by putting ifs under else, but it just gets ugly), the cleanest approach (if u ask me) is multiple ifs
07-06-2003, 09:24 AM#9
Dead-Inside
I made a (working) unit tint system :P
Also screen-tinting made, both came out good... I made a disco-demo map. When you walk in to "The Disco", you get strooobe liiights! :P
07-06-2003, 09:30 AM#10
piRo-piOn
the most efficient approach is my way... dirtyness has nothing to do with it. 10 if statement are 10 extra sets of conditions to check and a method like that would cause 10x as much lag... if lag isn't a problem in the map then it's fine but when it comes to programming efficiency you chould use my method. not to mention a bunch of high scale nerds with pocket protectors will start throwing cans at you if you use multiple ifs.