Scripts / Adding Custom Text In Load Screens

Author
Message
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Jun 2020 07:36
I'm looking to add custom (random) text on the loading screen of my game. Unfortunately, I am not sure what loop to add the text command in within loading.lua. That is, if this is even is the correct file to add the command too?

I'd like to add randomized backgrounds, but also randomized text; so that things are always kept a bit unique when loading and the player waits. For instance, the text would be display random tips. I dont want this information embedded in the PNG image itself however.

Is something like this possible? If so, is it actually possible to have the text dyanimcally change while on the load screen as well?
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Jun 2020 09:25
Are you looking fro something like this, but in loadgame area?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Jun 2020 15:00 Edited at: 29th Jun 2020 16:41
change any SetSpritePosition() (for sprites that are blocking your text) to offscreen like SetSpritePosition(#,200,200) and then add PasteSpritePosition() command to main(e) with the old values (i.e. #,0,0)
then put the text in the main(e) using the Text commands
this might work (untested), just make sure any images are valid (i.e. the names match the script)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Jun 2020 19:16 Edited at: 29th Jun 2020 22:01
Getting an image number error. Even when I attempt something like this to bypass it, knowing I have the 1 PNG there (loading.png) in all the resolution folders:

random_image[1] = "loading.png"
random_image[2] = "loading.png"
random_image[3] = "loading.png"


Quote: "change any SetSpritePosition() (for sprites that are blocking your text) to offscreen "


Your a lifesaver. This explains why all my tests with text were not showing up at all. Now I can see my text in front of the backdrops.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Jun 2020 20:58
Quote: "Getting an image number error"

That's because...

Quote: "g_imgBackdrop = LoadImage("titlesbank\\" .. g_strStyleFolder .. "\\" .. g_strBestResolution .. random_image[rimage])"


Should be...

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Jun 2020 22:02 Edited at: 29th Jun 2020 22:03
Thanks 3com!

Another weird thing I discovered here with GG is if you load a map and everything goes fine and all... but then go back to the main menu and go to new game, partway into loading the background image will get cut off below where the text is and you can see a blank map in the background.
Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 29th Jun 2020 22:16


This part of the code is really hard coded, I think loading.lua is not very user friendly.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 30th Jun 2020 15:08
Eh- Hard coded...
Is the pits! Yeah if it weren't for the fact that I'm getting more used to Lua, and
slowly learning how to utilize GG (the basics it has) then otherwise I think I'd
no- brainer go to a mainstream engine.
It would take another 1-2 years to re-learn another language and User Interface.
In the long term it most likely would be worth it though.

There needs to be an option to release all hard-coded features, yet still provide
the pre-set functions for standard GG ((Zombie shooter games)) but for creative,
independent games -- "Release me!" says the alien imprisoned in the gated shut
underground cell in "Independence Day!"
Biased against aliens much? Maybe Godot? Just wish UI was as simple as GG.
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Jul 2020 07:26
Trying to find a way to get the loading screen to stop showing the level map on the lower 50 percent of the screen when loading a map for the 2nd time.

What is happening is the Pasted sprite gets cut in half when loading a map the 2nd time. This, however, does not happen if you place a Set Sprite to 0 0 instead of the paste command. Now issue with this is... i cant seem to get Textcommands to appear above the set sprite as that one doesn't seem to reference the depth command. I believe that only affects pasted sprites.

Still trying to wrap my head around work around for this one. Not interested in the idea of creating a zillion graphics just for the text.
Store Assets - Store Link
Free Assets - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-03-29 08:02:08
Your offset time is: 2024-03-29 08:02:08