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 Sparky's objects?

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 19th Apr 2010 00:39
I'm having a little bit of a problem deleting objects that I've set up using sparky's dll.
I can delete the object, but the collision still stays behind to act like an invisible wall.
Can Some one please help fix or make a little set of commands that will actually delete my object?

Here is the code:



In the code im basically just creating a sprite when i collide with the object and then i try to delete the object and collision object when I press the A button
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 19th Apr 2010 12:10 Edited at: 19th Apr 2010 12:18
>edit<

Sorry, Didn't see the command at the end of your code.

Wil create some similar code and get back to you

>edit2<

Looking at your snippet, I fail to see how your code is deleting the object but not the collision settings.

Can I see some more of your code please? Including the bit where you load the object and set up the collision?

Thank you.

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 19th Apr 2010 12:48 Edited at: 19th Apr 2010 12:48
Have you tried deleting the object then removing it from Sparkys rather than the other way round? Thats how I delete my projectiles and it works fine.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2010 00:42
Quote: "Have you tried deleting the object then removing it from Sparkys rather than the other way round?"

...seems to be what the code is doing.

I can't see anything wrong here. I'd suggest putting some print statements in your loop like:


Is it possible that you are setting up the object again after you deleted it? Something like...


gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 20th Apr 2010 02:04
the problem im getting is that I delete the object then sparky's collision I get an error stating

Error During Intersect Check: Object(20) Not Setup

do you think this could have anything to do with the fact that I have the signs set up as the same group as my world?
ive done this so that i wont fall through the floor when I collide with the sign
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 20th Apr 2010 02:07
I'm 98% sure you in fact need to remove the object from Sparky's before deleting it.

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 20th Apr 2010 02:39
Quote: ""Have you tried deleting the object then removing it from Sparkys rather than the other way round?""


DOH! I did mean to say that the other way round! Sorry
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 20th Apr 2010 02:46 Edited at: 20th Apr 2010 03:08
i guess here's the whole thing...

gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 20th Apr 2010 03:12
Heres something even odder...

When i press the A key to delete the sprite and object
It will get rid of the object but if i then try to move it will give me the error:
Error During Intersect Check: Object(20) Not Setup

So if I just stand still, nothing happens, but the instant i try to move (arrows) I get the error! URGH!!!!!
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 20th Apr 2010 03:23
So I figured out the problem!!!!!!!!!!!!!!!
the reason I was getting that weird error was because the world collision and obj.20 collision were in the same group (which i needed)
So in the collision detection for the obj.20 I just excluded the world object!!!!!!!!!!!!

the command now looks like this


the last 10, at the end of the SphereSlideGroup is the addition
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2010 11:05
I should have spotted that as a possibility... curse me!

Well done.

Login to post a reply

Server time is: 2026-07-26 07:36:14
Your offset time is: 2026-07-26 07:36:14