February 04, 2012, 03:22:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: multiple level loads  (Read 1493 times)
Bensta
Jr. Member
**
Posts: 63



View Profile
« on: May 17, 2010, 10:35:43 AM »

Hey,

        Codeing is my least favorite thing, so forgive me..

Now for my project, at the end of the level i want it to automaticly load the next level. Now i followed the tutorial in the docs, and that works great! But..where ive run into problems is adding more triggers to load other levels in the main.gsl.

So at end of level 1 i want a trigger to activate level 2, and end of level 2 to activate level 3.. and so on.

Could anybody be kind enough to show me some example code of this? would stop me tearing my hair out Tongue
Logged
An0obis
Newbie
*
Posts: 17



View Profile
« Reply #1 on: May 17, 2010, 11:24:24 AM »

I *think* I have an example of this somewhere.

I'm not a coder either, but I've copied scripts from the old Beyond Virtual up to GameCore that community members have shared.

I don't remember what version of the engine it was, but Jim shared a setup for this with five worlds that loaded one after the other when you got close to the trigger. If I can find it, I'll post it. But if you can load .wld 2 from .wld 1, it should be the same for each level after that.

(I'm just getting back into this, it's been a while. I'll see what I can dig up though)
Logged
Bensta
Jr. Member
**
Posts: 63



View Profile
« Reply #2 on: May 17, 2010, 01:39:15 PM »

Thanks Wink
Logged
Bensta
Jr. Member
**
Posts: 63



View Profile
« Reply #3 on: May 19, 2010, 06:35:30 AM »

Any luck finding it?.. or anybody else??
Logged
ross.rockafellow
Global Moderator
Full Member
*****
Posts: 142



View Profile
« Reply #4 on: May 19, 2010, 09:10:11 AM »

I'll hunt for something today for you. I smell a new Advanced Concept section in our docs.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #5 on: May 19, 2010, 09:11:31 AM »

here is old script, from thre BV times but ross will probably have better soon
Logged
ross.rockafellow
Global Moderator
Full Member
*****
Posts: 142



View Profile
« Reply #6 on: May 19, 2010, 11:01:55 AM »

Okay I have a report for you:

The way the level change in the tutorial works it assumes you have a level1.wld and a level1.gsl. To make it work for more levels you will need the same scheme. Your next level would be level 2 and it would need its own .wld and.gsl to call with the script. This is very far from optimal. You would need to have all your gameplay script in EVERY level. That is a huge waste as the gameplay wont usually change drastically between levels (if level 1 is FPS level 2 usually isn't a flight sim).

What we have decided is to write a new script and include a level change object that will handle the level changing without having to copy the bulk of the script. This will be included in the next patch release along with some new light scripts i wrote (my first =D).

The above method should work for now. We'll get that optimization out soon.
Logged
Bensta
Jr. Member
**
Posts: 63



View Profile
« Reply #7 on: May 19, 2010, 12:05:33 PM »

Thanks ross and pixel

Yea i was thinking making diffrent triggers for each map, calling a diffrent .gsl from each trigger, but thought thats a bit messy... 

But my friend who doesnt know this script too well, but thinks he can get it working came up with a idea of cheking what levels being played and then loading a level based on that when the triggers activated (so only need the 1 trigger for all levels). He got it to display the world name, but were getting script errors after adding the load level part... this is what we have so far... could someone check it maybe it wount work, or it has typos or something..

or ill have to wait till its added Wink

Logged
ross.rockafellow
Global Moderator
Full Member
*****
Posts: 142



View Profile
« Reply #8 on: May 19, 2010, 04:03:02 PM »

Let try and see if my above theory would work.

save out our main.gsl 3 times and name them main1.gsl main2.gls and main3.gsl. In the portion of the code where you are switching through mapName you have something like:

   case "jail01.wld":
         nextMap = "../worlds/jail02.wld";
         break;

change the :

   LoadGameScript( "main.gsl", "MainGame");

to reflect the corresponding .gsl with the .lvl. You'll probably have to dig it out of the case with some custom variables but what you need to do is have the .lvl called and then the matching .gsl called. Its not working because as is you need a separate .gsl for each level.

...I think...
Logged
An0obis
Newbie
*
Posts: 17



View Profile
« Reply #9 on: May 19, 2010, 10:46:58 PM »

Cool!

Thanks guys.

I still haven't found the project I remembered downloading that did that. (it was Jim's old "Box Quest" example if anyone remembers or still has it. It loaded levels automatically when you got near the box object).

A newer example would be awesome.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #10 on: May 20, 2010, 06:42:55 AM »

I have the box quest in my homecomp so I can upload it later
Logged
Bensta
Jr. Member
**
Posts: 63



View Profile
« Reply #11 on: May 20, 2010, 09:16:46 AM »

I tried loading a diffrent main.gsl for each level like you suggested Ross, but had no luck, but anyway...

My friend got it working, attached is the working script for any interested.  Can just state which map should be played after each level in the one main gsl, and just use the 1 goal trigger.

So thanks for all the help again guys Wink
Logged
Kor
Newbie
*
Posts: 39



View Profile
« Reply #12 on: May 29, 2010, 12:03:12 AM »

Wow thanks Bensta, Been looking for something like this for a while.
Logged

Every artist was first an amateur.
-Ralph Waldo Emerson
Bensta
Jr. Member
**
Posts: 63



View Profile
« Reply #13 on: May 29, 2010, 07:26:14 AM »

No probs Wink We added a second trigger to go back a level too (see attached) But the problem we have now is when we go back our player is at the start again, instead of the end. The easy but rough way would be to clone/rename the map, and place player position to the end... Anyone know any way to do it without the need of a cloned map?
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #14 on: May 29, 2010, 01:06:34 PM »

easy answer is using spawn points...but then comes the hard part Smiley
Logged
Pages: [1] 2
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!