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
1 registered members (Grant), 999 guests, and 2 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
Multiple Levels #242052
12/21/08 01:23
12/21/08 01:23
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
How would i load multiple levels using lite-c

Also if i am correct when you use level_load(); it will load that level and it's attached script

If so please explain why this does not work as i expect.

My first script
main.c
Code:
#include <acknex.h>
#include <default.c>


void main()
{
	level_load("level1.wmb");
}


My level1.c (which is attached to level1.wmb)
Code:
#include <acknex.h>
#include <default.c>

void main()
{
	level_load("level1.wmb");
	wait(-2);
	camera.x = 0;
	camera.y = -2;
	camera.z = 863;
	camera.tilt = -90;
	camera.pan = 180;
	camera.roll = 0;	
}


When i run main.c it does not re-position the camera, but if i just run the level or the level1.c script it does

Anyone please explain
Thanks,
Blade


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Multiple Levels [Re: Blade280891] #242089
12/21/08 11:14
12/21/08 11:14
Joined: Sep 2003
Posts: 928
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 928
Level_load is for loading a level and not for starting a script. You can only have one main function and not two.

So when your script has the name "main.c" then you must put the camera placement in the main function of "main.c". What you do in "level1.c" is irrelevant as long you don't start this script.

Re: Multiple Levels [Re: Spirit] #242108
12/21/08 13:08
12/21/08 13:08
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
o ok, so how can i have multiple levels with different camera positions etc.


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Multiple Levels [Re: Blade280891] #242119
12/21/08 14:00
12/21/08 14:00
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
use the same scripts in all levels.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: Multiple Levels [Re: Nowherebrain] #242121
12/21/08 14:08
12/21/08 14:08
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
Hmm, ok i will need to rethink my logic :s
Thanks


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Multiple Levels [Re: Blade280891] #242140
12/21/08 16:32
12/21/08 16:32
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
I am totally confused :s

For each level it will have different variables configured differently, how would i (for example) set the camera position for each level.

I was planning on storing all the camera positions for each level in variables in one script but then how would i know which variables to use and what level the player is on :S


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Multiple Levels [Re: Blade280891] #242144
12/21/08 17:07
12/21/08 17:07
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
make your all level's script sprate files.(dont use any main.)

and then include them all in your main script file.

make functions like, level1_init(){}, set your camera and global var here after loading level. say you have a map/level selector, which returns the number of selected level.


var selected_level = <do your level selecting thingy here, button click, or trigger and such.>;

if(selected_level==1){
level_load(lv1);
level1_init();
}
if(selected_level==2){
level_load(lv2);
level2_init();
}

....

hope this hepls.


3333333333
Re: Multiple Levels [Re: Blade280891] #242147
12/21/08 17:26
12/21/08 17:26
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Quoting Blade28081991.
Quote:
For each level it will have different variables configured differently, how would i (for example) set the camera position for each level.

(If WED ->) Maybe, 'you' could place / use dummy / marker entities in each level, and set (camera?) positions / angles to the positions / angles / skills of those entities.
(That is probably an obvious suggestion.)

(If WED->) 'I' believe level_name (STRING?) contains the name of the level currently loaded.

Re: Multiple Levels [Re: testDummy] #242149
12/21/08 17:38
12/21/08 17:38
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
Solved by Quadraxas, thanks for all the replies though


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"

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