The Daily Click ::. Forums ::. Klik Coding Help ::. Even more duplicate problems.
 

Post Reply  Post Oekaki 
 

Posted By Message

Tokinsom



Registered
  22/11/2009
Points
  25
30th March, 2010 at 18:06:26 -

My enemies, all duplicates, work fine if created at the start of frame. However, if killing one enemy is to create another enemy, the other enemy doesn't work AT ALL. Seems the IDs and Loop index are all out of whack. Any ideas?

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
30th March, 2010 at 18:41:13 -

Are you spreading the value of 1 in the loop? Try spreading 0 as it resets all values instead of adding 1 to them, I think

 
www.Solgryn.org

Image

Tokinsom



Registered
  22/11/2009
Points
  25
30th March, 2010 at 19:11:53 -

Nah I always spread 0. Thanks though lol

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
30th March, 2010 at 23:09:15 -

An example is always helpful. Much easier to understand and help you with your problem.

What do you mean with "doesnt work at all"?
Maybe you should save the numer of the enemies in a value and if that value changes
(one is detroyed) create another...

Edited by Duke Highway

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

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!
31st March, 2010 at 00:15:48 -

Or just spread the values every loop instead of only once at the start of the frame.

 
n/a

Tokinsom



Registered
  22/11/2009
Points
  25
31st March, 2010 at 05:01:22 -

^^; Figured it out.

I ran into another "duplicates problem" though. I should mention this is in a platformer.. I gave my player the ability to pick up and throw blocks, and I'm having problems destroying the thrown block when it collides with another instance of the same block. More specifically: the detector of the thrown block colliding with the mask of another instance of the same block (It's only supposed to get destroyed if it touches the other block on the left or right side, so I gave them detectors)


I used this code to destroy the thrown block when its detector hits a platform, and that works fine, but it doesn't work when hitting the other instance's mask like I mentioned above. The value "Thrown" is if the block has been thrown and is in motion.


+On loop "Block"
+ID of ("Block_Mask")=LoopIndex("Block")
+ID of ("Block_Detector")=LoopIndex("Block")
+Thrown of ("Block")=1
+("Block_Detector") is overlapping backdrop

-Destroy the moving block and its objects, play sfx, create particles, blah blah.


EDIT: All platforms that are active objects, including the blocks I'm talking about, were given the qualifier ("Group.0"). I just noticed that not only will the block not be destroyed when colliding with another instance of it, it also doesn't get destroyed when colliding with ("Group.0"). Aggghhh

Thanks for any help. Dealing with duplicates sucks.. O_o;





Edited by Tokinsom

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
31st March, 2010 at 17:33:29 -

It TOTALLY sucks ^^

 
n/a

Tokinsom



Registered
  22/11/2009
Points
  25
31st March, 2010 at 22:31:51 -

lol Nevermind I figured it out. Ended up using a little workaround that "acts" like a collision has taken place.

 
n/a

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
1st April, 2010 at 04:04:01 -

These Unique/All bugs are nasty, but there are ways to get around them almost all the time.

Playing around with it helps a lot to see what actually selects a certain object and all objects and so forth.

For the record, I LOVE using duplicated objects.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.
   

Post Reply



 



Advertisement

Worth A Click