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 Professional Discussion / Delete all/everything for restarting game

Author
Message
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 21st Jul 2010 11:59
Hi guys
this is the first time i posted but we all were beginners at the start.

I need help with deleting everything (objects,sounds,images etc) .
A function is needed please help me.
lol thanks

ALLAH IS THE GREATEST
May he forgive me
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Jul 2010 13:43
You could step through them all and delete as you go, something like this maybe:

For id=1 to 10000
If object exist(id)=1 then delete object id
If image exist(id)=1 then delete image id
if sound exist(id)=1 then delete sound id
Next id

Untested, but that's what I usually do when I want to exit out nicely - although I think most of it is taken care of automatically when you exit. I mean, I do it, but I think that any issues with freeing up memory will remain even if you do clean up.


Health, Ammo, and bacon and eggs!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jul 2010 14:01
here you go:



Untested, but it gives you an idea on how to do it. I wasn't sure about the camera and the music limit... Check into it.

There are also other things you can delete that aren't listed there, but most of it is covered.

TheComet

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 21st Jul 2010 14:03 Edited at: 21st Jul 2010 14:04
or

set display mode screen width(),screen height(),screen depth()

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jul 2010 14:04
@ Link102

That won't change anything, will it? I just noticed that all of the textured objects go white, and the background turns white, but the images and objects still exist...

TheComet

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 21st Jul 2010 21:29
WOW 4 posts in one day thanks for replying guys.

That is good function "Thecomet".

but what about the types and dims and vectors?

Again thanks for the replies!

ALLAH IS THE GREATEST
May he forgive me

Login to post a reply

Server time is: 2026-07-25 05:32:39
Your offset time is: 2026-07-25 05:32:39