lua loadscreen def

lua loadscreen def

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

lua loadscreen def

Post by FLOZi »

Currently loadscreens are hardcoded to be loaded from bitmaps/loadpictures. Filenames can be prefixed with a sidename to control which pictures will be shown for a given side. Beyond that, there's no control.

I'd like to see a lua def in gamedata which gave us better control, something like this:

Code: Select all

local loadscreens = {
  {
    filename = 'loadpictures/GBR/gbrinfantrypic.jpg',
    maintainRatio = true,
    scaleUp = false,
    side = {'GBR'},
  },
  {
    filename = 'loadpictures/Allies/genericalliespic.jpg',
    maintainRatio = false,
    scaleUp = true,
    side = {'GBR', 'USA', 'RUS'},
  }
}
I guess the attributes there are self explanatory, but just to be perfectly clear:
  • filename - path to the image file from bitmaps/
  • maintainRatio - if image is rescaled, maintain the ratio? (currently hardcoded to true)
  • scaleUp - if the image is smaller than the viewport, scale it up? (currently hardcoded to true)
  • side - table of sides which this loadscreen can be selected for, empty table can be loaded for any side
As a minor aside; it'd be nice for consistency's sake if all Devil image format types were supported instead of just BMP and JPG.

edit: Obviously it'd be set up so that the default base file in springcontent.sdz replicated the current behaviour.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: lua loadscreen def

Post by hoijui »

i though the idea was to move to fully Lua scrip-table load-screens. of course, someone needs to code support for that too, but it would be much nicer, and i think IF anyone is going to change load-screens stuff, it is going to be that.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: lua loadscreen def

Post by zwzsg »

Yes, I want load screen animated with ingame scenes. Of course that mean we will need to have loaded most of the engine before being able to play the load screen animation. So it would be preferable to include a pre-loadscreen, to display while the actual load screen is loading. But then we should not repeat the same mistake of making that preloadscreen passive, so the preloadscreen should be fully moddable as well. Which might require loading certain components, which might take some time to load. So we need a pre-pre-loadscreen ....
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: lua loadscreen def

Post by trepan »

zwzsg makes with the fun.
zwzsg doesn't know how easy it actually is to setup the script.
from ignorance comes the hahas.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: lua loadscreen def

Post by FLOZi »

hoijui wrote:i though the idea was to move to fully Lua scrip-table load-screens. of course, someone needs to code support for that too, but it would be much nicer, and i think IF anyone is going to change load-screens stuff, it is going to be that.
Yeah, but noones really put forward any ideas how that would actually work. My request is a simple and sufficient improvement on the current system.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: lua loadscreen def

Post by zwzsg »

Yeah, now that even modinfo is a Lua file, I infer the Lua machine is already started before the loadscreen appears. But that's no reason to spoil this Hahas opportunity!
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: lua loadscreen def

Post by hoijui »

i would say it needs basic lua engine running, plus access to the mod archive. of course, not all lua functions that spring offers can be used (getEnemyUnits() ), but it should usually be obvious which ones can and which ones can not be used, and best would be to stick to a minimum anyway, which would be archive access, some drawing functionality, and the info from the start script.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: lua loadscreen def

Post by CarRepairer »

zwzsg wrote:Yes, I want load screen animated with ingame scenes. Of course that mean we will need to have loaded most of the engine before being able to play the load screen animation. So it would be preferable to include a pre-loadscreen, to display while the actual load screen is loading. But then we should not repeat the same mistake of making that preloadscreen passive, so the preloadscreen should be fully moddable as well. Which might require loading certain components, which might take some time to load. So we need a pre-pre-loadscreen ....
Yo dawg!!!!! I heard you like loadscreens, so we load loadscreens before your loadscreens so you can preview your preview while you preview.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: lua loadscreen def

Post by zwzsg »

The thing that is really lacking now is some control over where the text is positionned: You always have those huge white letters in the middle, ruining so many nice loadscreens. Either read text font, color, size, position, alignement from a static TDF-like file, either pass the text string to a call-in function of a mod-side lua script, leaving to it the duty to gl.Text it.

If the second way is chosen, I'd also like to get an indicator of how far in loading we are, from 0 to 1, so we can draw loadbars. Yes, I know, load time estimate are purely indicative, and it's quite impossible to get a smooth loading progression bar, but still, non linear indicator is better than no indicator.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: lua loadscreen def

Post by FLOZi »

Text control could be handled by a gamedata/loadscreen.lua too.
Post Reply

Return to “Feature Requests”