Page 1 of 1

Random Loadscreens Error

Posted: Thu Mar 04, 2010 5:47 am
by lucasfart
Ok, i can't, after a lot of trying, get them to show up.
Here's what i did.
1)Created my Loadscreens in .tga format without rle compression.
2)Copied them to my Load folder in data_ABC
3)Created a req which loaded the texture using:
"texture"
"loadscreen"(1-6 of the name of my tga)
4)Munged the load folder and copied to my maps addon folders _LVL_PC folder
5)Added script to my lua:
In ScriptPostLoad

Code: Select all

LoadScreen = math.random(1,6)
loadscreen()
In a new function

Code: Select all

function loadscreen()
if LoadScreen == 1 then
ReadDataFile("dc:Load\\Load1\\common.lvl")
elseif......
etc all the way to 6, with to "end"s at the end
In my load folder, they are in their own seperate load folder ending in the numbers 1-6.
There are no relevant errors in my log...

Re: Random Loadscreens Error

Posted: Thu Mar 04, 2010 8:38 am
by Teancum
So what happens -- no loadscreens at all, or only the first one?

Re: Random Loadscreens Error

Posted: Thu Mar 04, 2010 3:44 pm
by [RDH]Zerted
Did you test each common.lvl by itself to make sure each one works?
Are you sure math.random() works the way you want it to (I'm not going to look it up while on dial-up...)?
In each common.lvl, the loadscreen texture is called loadscreen in its req right? I'm not sure if that's what you're saying in #3.
Assuming the above are fine, move your LoadScreen = math.random(1,6) line into your loadscreen() function.

Re: Random Loadscreens Error

Posted: Fri Mar 05, 2010 7:46 am
by lucasfart
Teancum wrote:So what happens -- no loadscreens at all, or only the first one?
None of them work at all.
[RDH]Zerted wrote:Did you test each common.lvl by itself to make sure each one works?
Are you sure math.random() works the way you want it to (I'm not going to look it up while on dial-up...)?
In each common.lvl, the loadscreen texture is called loadscreen in its req right? I'm not sure if that's what you're saying in #3.
Assuming the above are fine, move your LoadScreen = math.random(1,6) line into your loadscreen() function.
I tried setting them all to load loadscreen 6, and that didn't work. the default mustafar loadscreen showed up, with no error in the log. I haven't tried any of the earlier one's but i'm assuming it won't make any difference. I've also tried a manual clean and munge, which had absolutely no effect.
And yes, they load the right texture, i even checked in the hex editor......
In #3 there are six loadscreen .tga's i made, named "loadscreen", "loadscreen2", "loadscreen3", "loadscreen4", "loadscreen5", "loadscreen6". i made one req (common.req), which loaded the first texture. munged it. copied to addon\\ABC\\_LVL_PC\\Load\\Load1 folder. Repeated loading different textures through to texture number 6.

I don't think the math.random will affect it. Skyhammers random skies worked fine using the exact same method......i'll give it a go but i don't really think it will fix it...

Re: Random Loadscreens Error

Posted: Sat Mar 06, 2010 9:22 am
by [RDH]Zerted
lucasfart wrote:...In #3 there are six loadscreen .tga's i made, named "loadscreen", "loadscreen2", "loadscreen3", "loadscreen4", "loadscreen5", "loadscreen6". i made one req (common.req), which loaded the first texture. munged it. copied to addon\\ABC\\_LVL_PC\\Load\\Load1 folder. Repeated loading different textures through to texture number 6...
Ugh, were you renaming the textures to loadscreen or editing the req for each new common.lvl?. The loadscreen texture must be named loadscreen in each common.lvl. If it is named something else it won't work.

Comment out all your switching code and get it working with one custom load screen first.

Re: Random Loadscreens Error

Posted: Sun Mar 07, 2010 6:55 am
by lucasfart
[RDH]Zerted wrote:Ugh, were you renaming the textures to loadscreen or editing the req for each new common.lvl?. The loadscreen texture must be named loadscreen in each common.lvl. If it is named something else it won't work.

Comment out all your switching code and get it working with one custom load screen first.
Ahh! didn't realise it had to be called loadscreen. i was loading it in the req as
"texture"
"loadscreen2"

etc.

I'll give it a go with your way, hopefully it will work. i've never had issues with single loadscreens before so i'm guessing this will fix it.