Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Need help switching levels while using NGC, details inside->

Author
Message
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 10th Sep 2005 06:29
i managed to build 2 levels in Deled and load them into DBC. The NGC dll works perfectly, and the level loads.

Heres the problem, I want to switch to the next level by hitting the spacebar. Now I setup the spacebar event and the level does load, but when I tell the game to delete the last level, it only makes it invisible! The first level is still in the world at the same time the second one is and the collision STILL RUNS?? wha-?

If anyone else is using NGC and knows how to move between levels, please help.

Thank ya'

Comics and Games-Bread and Butter.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 11th Sep 2005 11:28
Try the following:

1. Define a collision type that does not collide with anything special, when you load the next level set it to the aforementioned collision type then delete it.

2. Tell it to StopCollisionPRO then do StartCollisionPRO and set everything up all over again (a function would be handy) except with the new level.


I'm going to eat you!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 13th Sep 2005 05:06
any examples anywhere I can use? Cause that just went right-over-my-head

Comics and Games-Bread and Butter.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 13th Sep 2005 07:51
Here's the framework using the dummy collision type.

true=1
false=0
playerObj=1
level1Obj=2
level2Obj=3

load object "player.x", playerObj
load object "level1.x", level1Obj

StartCollisionPRO(0,0,0)
leveltype=1
playertype=2
dummytype=3

SetCollisionsPRO(playertype, leveltype,ELLIP_2_POLY, RESP_SLIDE, DYN_NORESP)
SetCollisionsPRO(dummytype, leveltype, ELLIP_2_ELLIP, RESP_NONE, 0)

CollisionTypePRO(playerObj, playertype)
CollisionTypePRO(level1Obj, leveltype)

do
rem Run game logic
if TimeToSwitchLevels=true then Switch()
loop

function Switch(level2Obj)
load object "level2.x", level2Obj
CollisionTypePRO(level1Obj, dummytype)
CollisionTypePRO(level2Obj, leveltype)
endfunction



The second method should be very straight forward. StopCollisionPRO clears everything, you can do something like FLUSH VIDEO MEMORY to get rid of all the objects and images and such (if that command doesn't work then just keep track of everything and delete it manually). Then you just set it up all over again except with the new level.


I'm going to eat you!
Game Freak10K
21
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 16th Sep 2005 06:38
holy-- that was quick... I thought all of the values they had set in place were permanent cause I tried changing the SceneryObjNo and got errors beyond the known universe. Ok enough complaining, Im working on it. Thank you seriously, im gonna do a new folder and start from scratch, cause I got loads and loads of copied files in the directory and um...yeah whatever ditto, thanks Bear!

Comics and Games-Bread and Butter.

Login to post a reply

Server time is: 2025-05-22 08:38:35
Your offset time is: 2025-05-22 08:38:35