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.

Newcomers DBPro Corner / levels/changeing model

Author
Message
chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 14th Aug 2003 01:30
Eh-up all heres one for ya. im having problems changing level in new survival horror style game. ive posted all of the code used Compleate newbie to this so dont rip me code too much! every things coded in darkbasic classic

cheers
chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 14th Aug 2003 01:47
By the way, the model which im trying to delete in this is rest4.x (object 4)
LOAD OBJECT "falgetup.x",17 is something i was playing with and isnt really involved in the level itself just something i used to test shooting, etc and is basicly a stand-in for an enermy. Im trying to delete the set (object 4) so i can load another and also use a diffrent set of camera angles. if theres anything you dont understand at all give me a shout n i'll tell ya what it does.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Aug 2003 06:05
write a list of the objects created with their media numbers then create a function that loads them all into the correct sequence,its easy this way to also make one that destroys all the media ready for the next level.


say for example we have a game with 10 objects and a matrix

instead of destroying the matrix we just update its height values to save load time.

If the models need to be reloaded then we destroy all of level one media and reload them back in.

a player model usually doesnt have to be reloaded as well as head up display data so its best to make a list with two columns, ones that need to be destroyed and ones that need to be hidden until the next level.

dont forget its sometimes essential to undim arrays but usually flushing data in them is ok until the end of the game where you do have to undim them as well as all media


how can I make this simpler?

instead of using functions you can change your main games loop to a while /endwhile command. this will make the main loop work until a condition is met, in this example its the escapekey. Using gosubs to load and destroy your data keeps all local and globular


gosubs
rem pre main
disable escapekey
while escapekey()=0
rem inside of main loop
sync
endwhile
rem end program and cleanup

Login to post a reply

Server time is: 2024-09-20 19:47:32
Your offset time is: 2024-09-20 19:47:32