Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Loading Screen with Progress Bar #209107
06/01/08 02:14
06/01/08 02:14
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
Is it possible to make a Loading Screen with a progress bar, if so how?

Re: Loading Screen with Progress Bar [Re: xbox] #209110
06/01/08 03:16
06/01/08 03:16
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline
Member
Ilidrake  Offline
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
check the manual as I've seen this in there a couple times. Not on my PC now so I couldnt remember where but it does have a command for that.


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php
Re: Loading Screen with Progress Bar [Re: Ilidrake] #209111
06/01/08 03:33
06/01/08 03:33
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
search the manual for a function called "on_level". That'll do what you're after.

Re: Loading Screen with Progress Bar [Re: DJBMASTER] #209425
06/02/08 23:08
06/02/08 23:08
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
now does this work in A6?

Re: Loading Screen with Progress Bar [Re: xbox] #209636
06/04/08 14:38
06/04/08 14:38
Joined: Sep 2002
Posts: 1,065
Germany, Jena, Thüringen
3D_Train_Driver Offline
Serious User
3D_Train_Driver  Offline
Serious User

Joined: Sep 2002
Posts: 1,065
Germany, Jena, Thüringen
Yes. It is possible.
But it could be a little bit difficult because loading a level happens within one single frame. So you have to code something that just looks like a progress bar depending on the amount of objects created by script in your level.
You could devide the loading process in to several processes.
For example:
process1 = loading the level
process2 = loading the models
process3 = loading the sprites
and so on....
The progress bar is full when a certain VAR has reached 100.

Code example:
Code:
var loading_percent;
var loading_processes = 3; //number of loading processes
var process_number;
var process_activity;
var bar_progress_per_model;
var bar_progress_per_sprite;

var models_to_load = 200; //the amount of models to load 
var sprites_to_load = 400; //the amount of sprites to load

define loading_level, 1;
define loading_model, 2;
define loading_sprite, 3;

define I_am_loading, 1;
define I_finished, 2;

function load_my_world(){
progress_bar.visible=1;
loading_percent = 0;
Now_load_level();
while(process_activity==I_am_loading){
wait(1);
}
Now_load_models();
while(process_activity==I_am_loading){
wait(1);
}
Now_load_sprites();
while(process_activity==I_am_loading){
wait(1);
}
}

function Now_load_level(){
process_activity=I_am_loading;
process_number = loading_level;
level_load("level_name.wmb");
wait(3);
loading_percent = 100/loading_processes * loading_level; //this is 100/3 * 1 = 33,3333333...
process_activity=I_finished;
}

function Now_load_models(){
process_activity=I_am_loading;
process_number = loading_model;
bar_progress_per_model = 100/loading_processes/models_to_load;
temp.x=0;
temp.y=0;
while(temp<models_to_load){
ent_create(model_name,vector,function);
temp.x+=1;
temp.y+=1;
loading_percent = (100/loading_processes * loading_level)+ (bar_progress_per_model*temp.x);
if(temp.y>10){temp.y=0;wait(1);} //wait every 10 models, so that the progress bar can update on the screen
}
loading_percent = 100/loading_processes * loading_model; //100/3 * 2 = 66,6666...
process_activity=I_finished;
}

function Now_load_sprites(){
process_activity=I_am_loading;
process_number = loading_sprites;
bar_progress_per_sprite = 100/loading_processes/sprites_to_load;
temp.x=0;
temp.y=0;
while(temp<sprites_to_load){
ent_create(sprite_name,vector,function);
temp.x+=1;
temp.y+=1;
loading_percent = (100/loading_processes * loading_model) + (bar_progress_per_sprite*temp.x);
if(temp.y>20){temp.y=0;wait(1);} //wait every 20 sprites, so that the progress bar can update on the screen
}
loading_percent = 100/loading_processes * loading_sprite; //this is 100% (100/3 * 3)
process_activity=I_finished;
}



I think, this is it. I shrinked it a bit but I think you can see the way it works.

First the bar will make a large step of 33,3333% then until 66,6666% it will move in small steps, depending on the amount of models and then until 100% in small steps again depending on the amount of sprites.
So now you just have to change only some vars in case you want to add some more processes.

Please don`t mind typing mistakes or grammar thingys :-). It`s not my native language.

best regards

Re: Loading Screen with Progress Bar [Re: 3D_Train_Driver] #209741
06/05/08 11:35
06/05/08 11:35
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
on_level instruction is what you want; however according to the manual it appears to be an A7 only command, so it's of no use to you.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1