Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Switching levels/maps [Re: Darrel] #372069
05/27/11 19:21
05/27/11 19:21
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline
Junior Member
JakeBilbe  Offline
Junior Member
J

Joined: Apr 2009
Posts: 81
Shouldnt function_main be at the very bottom?

Re: Switching levels/maps [Re: JakeBilbe] #372079
05/27/11 22:54
05/27/11 22:54
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Lite-C looks for things in order they appear in the script, so it's looking for the PANEL* but it's defined later down in the script.

You can use a 'prototype' which makes the engine aware of a function or object but doesn't have to define it. It can be defined later on...
Code:
#include <acknex.h>
#include <default.c>

function begin_level(); // prototype

function main()
{
screen_size.x = 800;
screen_size.y = 600;
screen_color.blue = 150;
mouse_mode = 4;
}

PANEL* main_pan =
{
bmap = "Background.png";
pos_x = 0; 
pos_y = 0; 

button (518, 520, "Singleplayer2.png", "Singleplayer.png", "Singleplayer2.png", begin_level, NULL, NULL);
flags = OVERLAY | SHOW;
}

function begin_level()
{
level_load("ID.wmb");
reset(main_pan,SHOW);
}



Re: Switching levels/maps [Re: DJBMASTER] #372086
05/28/11 05:44
05/28/11 05:44
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
Thanks, but down with one issue and another arises :<
So now the level loaded, but I don't have control over anything like I do when I run the level separately. I don't think it loaded the script for the level.

Re: Switching levels/maps [Re: Darrel] #372087
05/28/11 09:04
05/28/11 09:04
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
It can't, because level_load basicly is just a file loading instruction. So it does only load the .wmb file, including all the entities and informations like action names and stuff, but not the script you applied to the level in WED. There's nothing like "changing scripts". You have to have ONE script, or set of sripts, that deal(s) with all levels.

Re: Switching levels/maps [Re: the_clown] #372107
05/28/11 15:32
05/28/11 15:32
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
I kinda assumed that last night. Thank you all for the help.

Page 2 of 2 1 2

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