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 / [DBP] delete all objects

Author
Message
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 23rd Mar 2010 05:44
Hey Guys,

This is pretty basic, but I\'m still just getting used to everything. You coders rock.

Anyway, this little snippet will delete every object in the program in the blink of an eye. It\'d be great for clearing the old objects out when the player beats a level of a massive game or something. Can you believe I used to delete objects one at a time like this: \"delete object 1, delete object 2, del... (you get it)\"



You could change the 100000 to a bigger number if you think you have object with numbers that big. Is there someone out there that knows something like this that will reset all the algebra? (Instead of having to go \"Speed#=0, Lap=0, Race=0, ect.)

Sorry for all the blabber. I like to tall about code a lot.

Have a nice day, May God give you a hope and a future.

Daygamer
GreenDixy
15
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 25th Mar 2010 02:59
thanks great code i was just going to do the normal delete object (N) lol

===================
No life, Lots of love, 2 Kids, God save me LOL
GreenDixy
15
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 25th Mar 2010 03:25
sorry for double post but had a question for this code would it work if i did



i know test it but not at home wanted to post it while i remembered lol

===================
No life, Lots of love, 2 Kids, God save me LOL
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 25th Mar 2010 05:25
Yeah, that should work. You could do all kinds of things with this snippet. The idea is that you can access all your objects without any "Object does not exist" errors or anything. Here's another variation that colors all objects orange (my favorite color)



Thank you very much for the feedback!

Daygamer
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Mar 2010 16:54 Edited at: 25th Mar 2010 16:55
If we have several files fx...let say 20, and the file names are:
bubble1.fx
bubble2.fx
bubble3.fx bla bla...




Using this piece of code, we load the 20 fx files.


cheers.

I'm not a grumpy grandpa
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 25th Mar 2010 16:59
cool, I wouldn't have thought of that. Thanks

Daygamer
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Mar 2010 23:38
You might want to lookup up the command DELETE OBJECTS which will delete a range of objects in the blink of an eye.

Quote: "
DELETE OBJECTS

This command will delete a group of objects between the two specified values, inclusively, and is faster than deleting the range of objects individually.

Syntax

DELETE OBJECTS Object Number From, Object Number To
"


Boo!
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 29th Mar 2010 06:45
Wow, that's great. Now we got it down to one line. Thanks for the post.

Have a nice day, God Bless You!

Login to post a reply

Server time is: 2024-03-28 12:31:05
Your offset time is: 2024-03-28 12:31:05