ID:160603
 
I created an interface. The problem is i made a code that loads up at World startup and lags for about 1/2 a minute (anywhere between 20-40 seconds) and tried to make a loading screen that dissapears after the world has loaded, but when you try to close it the dreamseaker stays open (as an invisible procedure running in background, can only be ended by task manager)

I was wondering how I would change the size of the screen at startup, to about 150x50 pixles, and change the panes of the main window (currently mainwindowcontrol) to "loadingpane" and null, then change back to normal after "worldload" has been set to 1 (normal being "leftpane" and "rightpane" with size of 800x416)

I believe it would be winset() proc, but I am not sure on the arguments for it

Thanks in advanced for any help
._ |\/\/\/\/\/\/\/|_
|_| KingCold999 |_|
I think i had the same invisable window thing...Your dmb file (the screen icon) should have the same name as the folder it's in, or you have more than 1 window set as the default. I forget which one it was but try those 2 and tell me how it works out.

For screen size, just edit it in the interface file.

If your game takes so long to load, youre considering a loading screen, you have serious problems with the game. :P

But it would help if you showed us some codes for this problem, such as the winset() you mentioned.
In response to Quiet Screams
Quiet Screams wrote:
I think i had the same invisable window thing...Your dmb file (the screen icon) should have the same name as the folder it's in, or you have more than 1 window set as the default. I forget which one it was but try those 2 and tell me how it works out.

The problem is because i have 2 windows, when one is closed the other stays open and is invisible, so the dream seaker stays open

Quiet Screams wrote:
For screen size, just edit it in the interface file.

I was going to make it all one window, so it would be size 150x50 with a single lable in the center, saying loading please wait, and then after load it changes to 800x416 with the original settings

If your game takes so long to load, youre considering a loading screen, you have serious problems with the game. :P

First of all, many games (not necessarily byond games) use loading screens
And second, its because world.new() calls a large proc that makes 1500 randomly placed tiles on a map that is 2500 tiles squared, which is the cause of the lag

But it would help if you showed us some codes for this problem, such as the winset() you mentioned.

winset() is a built in proc... shown in reference here:http://www.byond.com/docs/ref/info.html#/proc/winset
In response to KingCold999
winset() is a built in proc... shown in reference here:http://www.byond.com/docs/ref/info.html#/proc/winset

I meant your coding. I know what the proc is.

The problem is because i have 2 windows, when one is closed the other stays open and is invisible, so the dream seaker stays open

Like i said, open them up, click the background and un-default one.

First of all, many games (not necessarily byond games) use loading screens
And second, its because world.new() calls a large proc that makes 1500 randomly placed tiles on a map that is 2500 tiles squared, which is the cause of the lag

Thats not a good idea for a game. That will drive away many players. If you describe why you're putting random obj's and turfs in enough detail, I may be able to give you an alternative.
In response to Quiet Screams
Quiet Screams wrote:
client
New()
if(isnull(src.address) || src.address == "127.0.0.1")
host = src.ckey
if(players > maxplayers)
src << "Too many players have logged into this world, please choose another."
del(src)
return
players += 1
recheckpop:
if(haspopd)
winshow(src,"mainwindow")
winshow(src,"loadwindow",0)
return ..()
sleep(10)
goto recheckpop
..()

that is the code i used previously, for client log in, i need to know how to "close" loadwindow rather than setting it to invisible

Thats not a good idea for a game. That will drive away many players. If you describe why you're putting random obj's and turfs in enough detail, I may be able to give you an alternative.

The random map generation only happens once, when the world is loaded, and makes a randomly generated map of trees and mountains, another reason for the lag is because I had to re-call autojoin, because without this the trees do not join together as they should. (They still dont, but thats the icon's fault, i messed up when creating it)

also (kinda off topic)
How would i save a map with a specific Z level when the world closes, and load it when the world re-opens?

Btw its an RTS game
In response to KingCold999
Return is unnecessary after deleting the src. goto is a bad programming practice; use for() or while() instead. ! is better than isnull(). The parent is unnecessary at the end, as you're already returning the parent above indefinitely. I'm pretty sure you can't "close" a window through the code. I'm not positive, but setting the is-pane param to true might "close" it (it would still exist; it would just be gone).
In response to Jeff8500
SOLVED
All in one window, created using the winset() command (WOOT SKIN REFERENCE)

also fixed most of the "bad programming practice" i believe.

But does anyone have an answer to my second question:

How to save a map with a specific Z level? (for example, 2)
In response to KingCold999
You can use the block proc on a certain Z level and save everything there. range() and the likes probably work, too, though they would require being in the center of the map. If there is a proc like block() for squares, that would work, too.
In response to Jeff8500
will this save the entire map to a file, which is loadable afterwards? (saving the map avoids PWIPE during server restart)