Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (AndrewAMD, Quad, soulman3, Ayumi), 675 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A question about #include #344019
10/12/10 21:24
10/12/10 21:24
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hello, i am programming a multi script project for the first time and i dont know how to do it right.

I have a main script which includes a sub script which loads a level file.

But there is somthing wrong because the level file cant be loaded, i get an error : cant load file.

What is the proper way to do this?

Re: A question about #include [Re: peteredlin] #344024
10/12/10 23:28
10/12/10 23:28
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
you can load the first level direct in the main
here a smple:
/////////////////////////////////////////
//main_script.c

#include <litec.h>;
#include <acknex.h>;
#include <default.c>;

function main()
{
video_mode = 7; //800x600
video_depth = 32;
video_screen = 2; // 1 = fullscreen, 2 = window

level_load("YouLevelName.wmb");
}
//*************************************//
check the following:

1. is the YouLevelName.wmb file in the projectfolder;
2. load the level with: level_load("YouLevelName.wmb");

//*************************************//

for levelload with a script, here a sample:
/////////////////////////////////////
//load_script.c

function load_my_level()
{
level_load("YouLevelName.wmb");
}

/////////////////////////////////////////
//main_script.c

#include <litec.h>;
#include <acknex.h>;
#include <default.c>;

#include "load_script.c";

function main()
{
video_mode = 7; //800x600
video_depth = 32;
video_screen = 2; // 1 = fullscreen, 2 = window

load_my_level();
}

Last edited by jane; 10/13/10 00:34.
Re: A question about #include [Re: jane] #344025
10/12/10 23:32
10/12/10 23:32
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
you can load the first level direct in the main
here a smple:
/////////////////////////////////////////
//main_script.c

#include <litec.h>;
#include <acknex.h>;
#include <default.c>;

function main()
{
video_mode = 7; //800x600
video_depth = 32;
video_screen = 2; // 1 = fullscreen, 2 = window
wait(1);

level_load("YouLevelName.wmb");
wait(1);
}
//*************************************//
check the following:

1. is the YouLevelName.wmb file in the projectfolder;
2. load the level with: level_load("YouLevelName.wmb");
3. test an wait(2); back the level_load("YouLevelName.wmb");
//*************************************//

for levelload with a script, here a sample:
/////////////////////////////////////
//load_script.c

function load_my_level()
{
level_load("YouLevelName.wmb");
wait(2);
}

/////////////////////////////////////////
//main_script.c

#include <litec.h>;
#include <acknex.h>;
#include <default.c>;

#include "load_script.c";

function main()
{
video_mode = 7; //800x600
video_depth = 32;
video_screen = 2; // 1 = fullscreen, 2 = window
wait(1);

function load_my_level();
}


Just some small suggestions/ adjustments:

sample:
/////////////////////////////////////
//load_script.c

function load_my_level() {
level_load("YouLevelName.wmb");
}

/////////////////////////////////////////
//main_script.c
#include <acknex.h>
#include <default.c>

#include "load_script.c"

function main()
{
video_mode = 7; //800x600
video_screen = 2; // 1 = fullscreen, 2 = window
load_my_level(); // the word ""function"" has to be removed
}


@jane: What's the purpose of the wait(2) in the following hint:
"3. test an wait(2); back the level_load("YouLevelName.wmb");" ?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: A question about #include [Re: Superku] #344026
10/12/10 23:40
10/12/10 23:40
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
@superku the wait(2); is for a big level with many models with actions or big levelmodels

EDIT: i have correct the first post, thanks

Last edited by jane; 10/12/10 23:53.
Re: A question about #include [Re: jane] #344028
10/12/10 23:54
10/12/10 23:54
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
And for what do you wait?
In A6 or prior engine versions, the level was not loaded immediately and therefore you had to wait at least a frame before you could create an entity, A7 and A8 load the level instantly.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: A question about #include [Re: Superku] #344029
10/13/10 00:11
10/13/10 00:11
Joined: Nov 2008
Posts: 216
J
jane Offline
Member
jane  Offline
Member
J

Joined: Nov 2008
Posts: 216
is in the level a lowpoly model with a function this use a pointer of a
highpoly model gives an error. i write the wait always as a precaution.

EDIT: ok the wait isnt mor necessary, but its make no
damge ... (wieder was gelernt)

Last edited by jane; 10/13/10 00:32.
Re: A question about #include [Re: jane] #344048
10/13/10 10:49
10/13/10 10:49
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
thanks for the awnsers, now it works.


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