Random Loadscreens Error

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Random Loadscreens Error

Post 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...
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Random Loadscreens Error

Post by Teancum »

So what happens -- no loadscreens at all, or only the first one?
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Random Loadscreens Error

Post 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.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Random Loadscreens Error

Post 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...
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Random Loadscreens Error

Post 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.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Random Loadscreens Error

Post 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.
Post Reply