Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Splash screens loop #127768
05/03/07 03:36
05/03/07 03:36
Joined: Nov 2005
Posts: 68
S
scurvy Offline OP
Junior Member
scurvy  Offline OP
Junior Member
S

Joined: Nov 2005
Posts: 68
Hello I have written a small splash screen wdl for a game I am working on
that has four screens at the start of game. What I am looking for is a little
help on a function that will loop back to the first splash screen and continue
to do this until the space bar is pressed. Hopefully the space bar can be
pushed at any time to continue on to the game while the four screens loop.
Thank you for any help!
The script is listed below!

///////////////////////////////////////////////
// startup splash screens
// script written by william mason May 02,07
///////////////////////////////////////////////
bmap splash1 = <splash1.pcx>;
bmap splash2 = <splash2.pcx>;
bmap splash3 = <splash3.pcx>;
bmap splash4 = <splash4.pcx>;

panel splash_1(){bmap = splash1;layer = 25;}
panel splash_2(){bmap = splash2;layer = 25;}
panel splash_3(){bmap = splash3;layer = 25;}
panel splash_4(){bmap = splash4;layer = 25;}

starter splash_start
{
freeze_mode = 1;
splash_1.visible = on;
sleep (3);
splash_1.visible =off;
splash_2.visible = on;
sleep (3);
splash_2.visible =off;
splash_3.visible = on;
sleep (3);
splash_3.visible =off;
splash_4.visible = on;
sleep (3);
splash_4.visible =off;

freeze_mode = 0;

// remove bmaps from memory
bmap_purge(splash1);
bmap_purge(splash2);
bmap_purge(splash3);
bmap_purge(splash4);

Re: Splash screens loop [Re: scurvy] #127769
05/03/07 11:19
05/03/07 11:19
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Code:


var show_splash_now;

function end_slash()
{
show_splash_now = 0;
}

on_space = end_splash;

function show_splash()
{
show_splash_now = 1;
while(show_splash_now == 1)
{
freeze_mode = 1;
splash_1.visible = on;
sleep (3);
splash_1.visible =off;
splash_2.visible = on;
sleep (3);
splash_2.visible =off;
splash_3.visible = on;
sleep (3);
splash_3.visible =off;
splash_4.visible = on;
sleep (3);
splash_4.visible =off;
}
freeze_mode = 0;
}






?


~"I never let school interfere with my education"~
-Mark Twain
Re: Splash screens loop [Re: scurvy] #127770
05/03/07 11:21
05/03/07 11:21
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
Not tested but try it:

///////////////////////////////////////////////
// startup splash screens
// script written by william mason May 02,07
///////////////////////////////////////////////
bmap splash1 = <splash1.pcx>;
bmap splash2 = <splash2.pcx>;
bmap splash3 = <splash3.pcx>;
bmap splash4 = <splash4.pcx>;

panel splash_1(){bmap = splash1;layer = 25;}
panel splash_2(){bmap = splash2;layer = 25;}
panel splash_3(){bmap = splash3;layer = 25;}
panel splash_4(){bmap = splash4;layer = 25;}

panel* screen_syn = splash_1;

starter splash_start
{
freeze_mode = 1;
WHILE (1) {
WHILE (temper < 48) {
screen_syn .visible = on;
temper += time;
IF (KEY_SPACE == 1) { screen_syn.VISIBLE = OFF; return; }
wait (1);
}
screen_syn.VISIBLE = OFF;
IF (screen_syn == splash_4) { screen_syn = splash_1; continue; }
IF (screen_syn == splash_3) { screen_syn = splash_4; }
IF (screen_syn == splash_2) { screen_syn = splash_3; }
IF (screen_syn == splash_1) { screen_syn = splash_2; }
wait (1);
}

freeze_mode = 0;

// remove bmaps from memory
bmap_purge(splash1);
bmap_purge(splash2);
bmap_purge(splash3);
bmap_purge(splash4);


P.S. The bracket for closing the starter is missing!

EDIT: @Germanunkol You were faster, but in your code the loop will go on until he's finished and not break at once when space is pressed

Last edited by RedPhoenix; 05/03/07 11:25.
Re: Splash screens loop [Re: RedPhoenix] #127771
05/03/07 16:19
05/03/07 16:19
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
agreeed, I forgot about that part, sorry...
you win^^


~"I never let school interfere with my education"~
-Mark Twain
Re: Splash screens loop [Re: scurvy] #127772
05/04/07 03:29
05/04/07 03:29
Joined: Nov 2005
Posts: 68
S
scurvy Offline OP
Junior Member
scurvy  Offline OP
Junior Member
S

Joined: Nov 2005
Posts: 68
Thanks for your help! But am still having problems with it not working
I do have the ending bracket on my file and it works. But I am not sure
where to place germanunkol response. And have tryed the one by redphoenix
but it throws up a bunch of errors. Will continue to try to get it working
but if you see anything that don't look right, please write!
Thank you again

Re: Splash screens loop [Re: scurvy] #127773
05/04/07 07:45
05/04/07 07:45
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
can you tell us what the errors are? you should use redphoenix's, it's better than mine...
but I think it's scripted in lite_c...?


~"I never let school interfere with my education"~
-Mark Twain
Re: Splash screens loop [Re: Germanunkol] #127774
05/04/07 10:04
05/04/07 10:04
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
No it's c_script. But I forgot something: var temper; over the starter.
I'm using this var by default so I forgot the it's not declared in your code.

EDIT: And another thing I forgot:

It will may be better to do it like this:
IF (key_space == 1) { screen_syn.VISIBLE = OFF; Goto finish; }

This will replace the old IF structure.

But you have to declare a label to jump to:

finish :

Put this under the end of the While (1) { } structure.


Last edited by RedPhoenix; 05/04/07 10:11.
Re: Splash screens loop [Re: scurvy] #127775
05/04/07 18:06
05/04/07 18:06
Joined: Nov 2005
Posts: 68
S
scurvy Offline OP
Junior Member
scurvy  Offline OP
Junior Member
S

Joined: Nov 2005
Posts: 68
I have installed your updates in what I beleive is the right places and now
when I run the script my game starts. But the first splash screen appears and
then it jumps right into the game and locks it up. No second, third or forth
splash screens are shown and I do not have to push any keys. It just go's
stright into the level 1 then locks up. Below is the updated script.
Once again thank you!

///////////////////////////////////////////////
// startup splash screens
// script written by william mason May 02,07
///////////////////////////////////////////////
bmap splash1 = <splash1.pcx>;
bmap splash2 = <splash2.pcx>;
bmap splash3 = <splash3.pcx>;
bmap splash4 = <splash4.pcx>;

panel splash_1(){bmap = splash1;layer = 25;}
panel splash_2(){bmap = splash2;layer = 25;}
panel splash_3(){bmap = splash3;layer = 25;}
panel splash_4(){bmap = splash4;layer = 25;}

panel* screen_syn = splash_1;

var temper;

starter splash_start
{
freeze_mode = 1;
WHILE (1) {
finish :

WHILE (temper < 48) {
screen_syn .visible = on;
temper += time;
IF (key_space == 1) { screen_syn.VISIBLE = OFF; Goto finish; }
wait (1);
}
screen_syn.VISIBLE = OFF;
IF (screen_syn == splash_4) { screen_syn = splash_1; continue; }
IF (screen_syn == splash_3) { screen_syn = splash_4; }
IF (screen_syn == splash_2) { screen_syn = splash_3; }
IF (screen_syn == splash_1) { screen_syn = splash_2; }
wait (1);
}

freeze_mode = 0;

// remove bmaps from memory
bmap_purge(splash1);
bmap_purge(splash2);
bmap_purge(splash3);
bmap_purge(splash4);

}

Re: Splash screens loop [Re: scurvy] #127776
05/04/07 20:54
05/04/07 20:54
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
No the
finish :

isn't set right, I meant under the complete structure, that means under the closing bracket of the While (1).

2: Where you now have the finish : put in temper = 0;

Re: Splash screens loop [Re: RedPhoenix] #127777
05/04/07 22:03
05/04/07 22:03
Joined: Nov 2005
Posts: 68
S
scurvy Offline OP
Junior Member
scurvy  Offline OP
Junior Member
S

Joined: Nov 2005
Posts: 68
Sorry it's me again and it looks like I'm still doing something wrong. I put
temper=0; where the finish; was. And moved the finish: to the end of the
complete structure as I have intered below. But now I'm back to a startup
failure when I run the compiler. It says bad or missing parameter splash_start
finish no target label defined then It says script error missing bracket. I
with guess that the finish is not in right place. But not sure as to where
my mistake is? I am trying to teach myself c script but not doing a good job.
I will work with it but if you see my mistake please write back.
Thank you again! Maybe someday I can return favor.
///////////////////////////////////////////////
// startup splash screens
// script written by william mason May 02,07
///////////////////////////////////////////////
bmap splash1 = <splash1.pcx>;
bmap splash2 = <splash2.pcx>;
bmap splash3 = <splash3.pcx>;
bmap splash4 = <splash4.pcx>;

panel splash_1(){bmap = splash1;layer = 25;}
panel splash_2(){bmap = splash2;layer = 25;}
panel splash_3(){bmap = splash3;layer = 25;}
panel splash_4(){bmap = splash4;layer = 25;}

panel* screen_syn = splash_1;

var temper;

starter splash_start
{
freeze_mode = 1;
WHILE (1) {
temper=0;

WHILE (temper < 48) {
screen_syn .visible = on;
temper += time;
IF (key_space == 1) { screen_syn.VISIBLE = OFF; Goto finish; }
wait (1);
}
screen_syn.VISIBLE = OFF;
IF (screen_syn == splash_4) { screen_syn = splash_1; continue; }
IF (screen_syn == splash_3) { screen_syn = splash_4; }
IF (screen_syn == splash_2) { screen_syn = splash_3; }
IF (screen_syn == splash_1) { screen_syn = splash_2; }
wait (1);
}

freeze_mode = 0;

// remove bmaps from memory
bmap_purge(splash1);
bmap_purge(splash2);
bmap_purge(splash3);
bmap_purge(splash4);

}
finish:

Page 1 of 2 1 2

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

Gamestudio download | 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