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.

Code Snippets / [DBC/DBP] Delete All Command

Author
Message
Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 6th Sep 2007 00:47 Edited at: 8th Sep 2007 23:35
I know this command is probably crappy and useless, but I was using this instead typing in

cls
delete object 1
delete matrix 1
blah blah...

This Will Be Added in My Soon to Come eyeCORE Functions.
Recoded by JosephB


If you improve it please post it and I will change it here.

Windsept
18
Years of Service
User Offline
Joined: 9th Jun 2006
Location: United States
Posted: 6th Sep 2007 01:57
Nice! but the only problem is with one call of you function you can only delete 1 object, 1 matrix, and 1 sprite at a time. So in essence you really don't save yourself any time or space with the function.

Us the for next loop like this.....



This function will delete all existing objects,matrices and sprites with one command.

Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 6th Sep 2007 02:55
Oh thank you! I put it in my original post.

Mr Tank
22
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 6th Sep 2007 03:53
Nice. People should use this at the end of their projects, because i heard somewhere that you should delete your resources at the end, because it doesn't do it automatically or something.
Also, in DBP there's a command:
"delete objects startobject,endobject", that deletes all objects that exist between the start and end objects (inclusive). Not sure whether it's any faster than your code.

SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 6th Sep 2007 04:05
Thanks!

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 6th Sep 2007 14:27
The "Flush Video Memory" command deletes everything.. I think...

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
NA170425
User Deleted
Posted: 6th Sep 2007 23:35
set display mode does so, I think.

Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 7th Sep 2007 02:09
@Zotoaster: I thought it only flushed the video card's memory?

@Code Dragon: I think you're wrong. It didn't work for me.

Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 7th Sep 2007 11:38
I don't think Flush Video Memory works.... I've made a test program using it.

Also, this may be the best way to approach doing the DeleteAll function:



*NOTE* Untested Code


Cheers,

-naota

DBP, $80. DBP's plugins, $320. Watching DBP Crash, Priceless.
NG Website Aex.Uni forums

Attachments

Login to view attachments
Aralox
18
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 7th Sep 2007 13:42
you missed out on deleting meshes and sprites, i think.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Sep 2007 17:06
As long as you have your media sequentially ordered "1,2,3" instead of "1,3,99" then you could do it like this



Then you can have an infinite amount of media and it will leave each loop when it finds the end of the list.

In programming, nothing exists
JosephB
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 8th Sep 2007 15:38
This function is very usefull. One command that I found that seems to work nice is Delete Objects 1 , lastobjectnumber

I placed it in the function and tested it and it works:

Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 8th Sep 2007 23:34
Thanks you are now in the original post.

Login to post a reply

Server time is: 2025-05-11 21:48:37
Your offset time is: 2025-05-11 21:48:37