|
1 registered members (Grant),
999
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Multiple Levels
#242052
12/21/08 01:23
12/21/08 01:23
|
Joined: Jan 2008
Posts: 1,580
Blade280891
OP
Serious User
|
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
#include <acknex.h>
#include <default.c>
void main()
{
level_load("level1.wmb");
}
My level1.c (which is attached to level1.wmb)
#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: Spirit]
#242108
12/21/08 13:08
12/21/08 13:08
|
Joined: Jan 2008
Posts: 1,580
Blade280891
OP
Serious User
|
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: Nowherebrain]
#242121
12/21/08 14:08
12/21/08 14:08
|
Joined: Jan 2008
Posts: 1,580
Blade280891
OP
Serious User
|
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
OP
Serious User
|
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
Senior Expert
|
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
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
Quoting Blade28081991. 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
OP
Serious User
|
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"
|
|
|
|