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
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,887 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
goto function #237547
11/20/08 16:23
11/20/08 16:23
Joined: Nov 2008
Posts: 15
Germany
R
rrv094055036862 Offline OP
Warez kiddie
rrv094055036862  Offline OP
Warez kiddie
R

Joined: Nov 2008
Posts: 15
Germany
Hi,

I have a problem with the Goto function.

I want to show some bitmaps for 5 seconds and then I want to show other bitmaps for 5 seconds. But I don´t know how to show the other bitmaps after 5 seconds.

Code is:
BMAP* Startbildschirm = "pictures/first.pcx";
BMAP* schriftzug = "pictures/schriftzug.pcx";

PANEL* Startbildschrim = // first panel (800x600)
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = Startbildschirm;
flags = OVERLAY | VISIBLE;
}

PANEL* schriftzug_pan = // Text as Bitmap (100x100)
{
pos_x = 80;
pos_y = 380;
layer = 2;
bmap = schriftzug;
flags = OVERLAY | VISIBLE;
}

function main()
{
video_mode = 7;
screen_color.blue = 0;
video_screen = 1;
wait (-5);
}
goto next;

next:
function next()
{
PANEL* zweitesbild = // this panel should cover the first panel after 5 seconds. But it doesn´t work.

{
pos_x = 0;
pos_y = 0;
layer = 3;
bmap = schriftzug;
flags = OVERLAY | VISIBLE;

}
}


Last edited by rrv094055036862; 11/20/08 16:24.
Re: goto function [Re: rrv094055036862] #237549
11/20/08 16:31
11/20/08 16:31
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
First of all, if you are going to use goto, it has to be contained in a function or action. goto is used in a function to go from one line to a label. goto also is rarely recommended for use.

Second of all, I don't think a panel can be declared in a function

The way this would be done is, declare the two panels, then in a function, set the VISIBLE flag when you need them.

Code:
PANEL* tartbildschrim = // first panel (800x600)
{
   pos_x = 0;
   pos_y = 0;
   layer = 1;
   bmap = Startbildschirm;
   flags = OVERLAY | VISIBLE;
}

PANEL* zweitesbild = // this panel should cover the first panel after 5 seconds. But it doesn´t work.

{
   pos_x = 0;
   pos_y = 0;
   layer = 3;
   bmap = schriftzug;
   flags = OVERLAY;

}

function switchPanels()
{
   wait(-5);  //wait 5 seconds
   set(zweitesbild,VISIBLE);      //turn on the second panel
   reset(tartbildschrim,VISIBLE);  //turn off the first panel
}



I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: goto function [Re: heinekenbottle] #237555
11/20/08 17:16
11/20/08 17:16
Joined: Nov 2008
Posts: 15
Germany
R
rrv094055036862 Offline OP
Warez kiddie
rrv094055036862  Offline OP
Warez kiddie
R

Joined: Nov 2008
Posts: 15
Germany
thx for your answer

another question:

set(...,VISIBLE); works fine
but reset(...,VISIBLE); doesn´t work

why not? laugh

Re: goto function [Re: rrv094055036862] #237557
11/20/08 17:42
11/20/08 17:42
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
use this code to toggle your panels visibility
replace yourpanel with your panel pointer

yourpanel.flags |= VISIBLE; // your panel will be visible

yourpanel.flags &= ~VISIBLE; // your panel will not be visible

Re: goto function [Re: badapple] #237562
11/20/08 18:01
11/20/08 18:01
Joined: Nov 2008
Posts: 15
Germany
R
rrv094055036862 Offline OP
Warez kiddie
rrv094055036862  Offline OP
Warez kiddie
R

Joined: Nov 2008
Posts: 15
Germany
same problem again.

First script works but second script doesn´t work.

Maybe the problem is caused, because I have this scripts in main function.

Re: goto function [Re: rrv094055036862] #237594
11/20/08 20:54
11/20/08 20:54
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Originally Posted By: rrv094055036862
thx for your answer

another question:

set(...,VISIBLE); works fine
but reset(...,VISIBLE); doesn´t work

why not? laugh


That is very strange. I use reset to turn off panels in my script and it works fine . . .

Code:


function loadLvlOne()
{
	mouse_mode = 0;
	level_load("tanklevel.wmb");
	wait(1);
	gameLoaded = 1;
	reset(newCPan,VISIBLE);
	reset(diffPan,VISIBLE);
	reset(mainPan,VISIBLE);
	sky_clip = -90;
	initScreen();
	initMouse();
	initCamera();
}


Just posting that as an example, the panels in the reset macros all turn off when this function is called.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: goto function [Re: heinekenbottle] #237617
11/21/08 00:13
11/21/08 00:13
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
I'm guessing you're drawing the initial panels over a "blank screen" so they are being turned off but the engine isn't updating it's image,

at the start try using
Code:
level_load("");
this will create a blue background and hopefully sort your problems

hope this helps

Re: goto function [Re: MrGuest] #237623
11/21/08 00:53
11/21/08 00:53
Joined: Nov 2008
Posts: 15
Germany
R
rrv094055036862 Offline OP
Warez kiddie
rrv094055036862  Offline OP
Warez kiddie
R

Joined: Nov 2008
Posts: 15
Germany
Yeah, now it works. Thank you much all


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