The Daily Click ::. Forums ::. Klik Coding Help ::. Objects that wont destroy
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
30th November, 2013 at 30/11/2013 13:32:01 -

I often create Active objects as part of an effect, and destroy them rather quickly. Sometimes if I spam these effects rapidly, the active objects will just kinda get stuck on the screen. I've had this issue with loads of projects over the years, so I'm sure others must have encountered this. It's usually when I create an objects, then destroy it after it's animation has finished.

I know it may be difficult to judge based on this vague description, but have you encountered this, and found a way to correct it?

 
Image

Tell 'em Babs is 'ere...

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
30th November, 2013 at 30/11/2013 13:42:44 -

Instead of relying on completed animations to trigger the Destroy action, I use an internal counter in the form of an Alterable Value.

I've been trying to structure my events in separate groups per object. So say for example I have a group labeled "debris" which deals with everything related to the chunks of bricks leftover from explosions.



IF Always
THEN Add 1 to Alterable Value A of "debris"

IF Alterable Value A of "debris" is Greater or Equal To 100
THEN Destroy "debris"



One other interesting thing you can do is link an object's transparency to an Alterable Value so you can manipulate its transparency during runtime. In those cases, Destroy the object after Alterable Value A is greater than 128 so the object is Destroyed only after the object disappears.

EDIT: Oh! And if you don't want your objects to be Destroyed all at the same time, then change the first Event to this:

IF Always
THEN Add Random(5) to Alterable Value A of "debris"




Edited by s-m-r

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49564

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
30th November, 2013 at 30/11/2013 21:05:14 -

Destroying objects based on their animation hasn't worked for me since KnP.
Use a variable instead.

You can even link the animation to your variable similar to s-m-r's suggestion of linking it to the transparency.

 
n/a

nim



Registered
  17/05/2002
Points
  7233
1st December, 2013 at 01/12/2013 08:10:54 -


Originally Posted by -Liam-
I often create Active objects as part of an effect, and destroy them rather quickly. Sometimes if I spam these effects rapidly, the active objects will just kinda get stuck on the screen. I've had this issue with loads of projects over the years, so I'm sure others must have encountered this. It's usually when I create an objects, then destroy it after it's animation has finished.

I know it may be difficult to judge based on this vague description, but have you encountered this, and found a way to correct it?



I only ever use the bouncing ball built-in movement for particle effects, but in my experience, objects aren't destroyed if the object is also using a built-in movement and is moving. If the objects are "launched (at speed x)" they won't respond either.

 
//

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
1st December, 2013 at 01/12/2013 13:20:02 -

Thanks for all the info guys, I really appreciate it! It's good to know it's a common bug. Well, it's a bad thing really, but at least I know it's not just me!

Anyway, this info helps a lot - thanks!

 
Image

Tell 'em Babs is 'ere...

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
2nd December, 2013 at 02/12/2013 10:00:03 -

I use either an internal value or only put graphics in the disappear animation, then it'll initiate with that animation and automatically destroy itself when it's done. I can't recall that being buggy.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd December, 2013 at 02/12/2013 22:33:42 -

That's a great idea!

 
Image

Tell 'em Babs is 'ere...

nivram



Registered
  20/07/2006
Points
  171
3rd December, 2013 at 03/12/2013 00:13:11 -


Originally Posted by Eternal Man [EE]
I use either an internal value or only put graphics in the disappear animation, then it'll initiate with that animation and automatically destroy itself when it's done. I can't recall that being buggy.



I do the exact same thing and haven't had a problem yet.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
3rd December, 2013 at 03/12/2013 16:11:12 -


Originally Posted by Eternal Man [EE]
...put graphics in the disappear animation, then it'll ... automatically destroy itself when it's done.



You learn something new every day - I had no idea it did that!
Cheers

Anyway, I've never encountered this problem, so don't really know what to say...

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
8th December, 2013 at 08/12/2013 00:34:57 -

i used to have this problem all the time and it drove me insane. as everyone else stated if you have it destroyed at the end of the animation it tends to get stuck. ive also had it where it basically pastes part of the sprites onto my background and thats just really strange looking and kind of annoying lol. using an alterable value is what ive found to be the best way to fix this problem. ive not tried the other way they said by putting it in the destroyed animation but honestly i think it would be better to use an alterable value that way you can control easily how long the particles or chunks stay on screen before getting destroyed.

 
[Game design makes my brain feel like its gonna explode.]

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
10th December, 2013 at 10/12/2013 21:33:30 -

I'd say it's a question of efficiency/simplicity and how you want it destroyed.
Having only the disappear animation filled is the most simple, efficient way. It gets the job done without a single event. However both ways should be used depending on what you want; the animation dependant way will always destroy after a set TIME(since animations follow timers not ticks) whilst the value dependant way will destroy after a set NUMBER oF TICKS. So depending on what you want you'll switch ways.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image
   

Post Reply



 



Advertisement

Worth A Click