The Daily Click ::. Forums ::. Klik Coding Help ::. super awesome gun
 

Post Reply  Post Oekaki 
 

Posted By Message

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 19:21:35 -

i have a super awesome gun in my game, that decided for some reason the last couple of days, once it hits one of the zombies heads in my game, it hits every zombie that is currently in play in the head, so therefore every single zombie dies.

sounds great but it really sucks because i just cant seem to figure it out.

heres how i have my system set up.
everytime a zombie is created, so is a sprite, a head sprite, its own PMO and a target (to find the player). its set up with a loop so all i have to create is the zombie collision detector and everything else spawns from that. on top of that, each zombie cd is given a value assigned to it on 4 variables that have the fixed number of each object associated with it.

its been fairly air tight so far and everything works perfectly, of course except this.

ive tried several combinations, which are

bullet collides with head
head is overlapping zombie
fixed value of head is equal to assigned head of zombie

this one worked fine for a while, but if two zombies were touching eachother (even if the bullet wasnt touching one) they would both die. id set it back to that, but it doesnt work anymore, for some reason its like MMF2 slips a "or" statement after the collision statement.

bullet collides with head
fixed value of head is equal to assigned head of zombie

bullet collides with head
assigned head of zombie is equal to fixed value

bullet collides with head
bullet collides with zombie

assigned head of zombie is equal to fixed value
bullet collides with head

ive done various combinations of all of these, i even tried working it into the movment loop

on movment loop
spread value of zombie equals loop index
:various combinations of code that dont work:

but none of them work. im sure there is something extremely simple, because it seems like it just measures which ever zombie has a head with its fixed equal to the assined value.

the last thing im gonna try that i just thought of is working a "bullet collides" in the movement loop and if it does sets a value into the bullet to equal the fixed value of the zombie and then in the collision event set hit zombie is equal to fixed of zombie then do stuff. but incase it dont work, anyone have any other suggestions?

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 19:28:56 -

oh yeah, and no, that didnt work either. im stumped guys.

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
8th March, 2009 at 19:36:50 -

didnt read through every variation you tried but you need to use the compare two values function instead of comparing the alt value of zombie directly.

 
n/a

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!
8th March, 2009 at 20:36:05 -

Using spread values:

+ everytime new Zombie is created
-> spread value 0 in Head
-> spread value 0 in Zombie

+ bullet collides with Head
+ Zombie value = Head value
-> kill Zombie
-> kill Head

------------------------------------------------------------------------------------------

Or using MMFs "object matching":

+ bullet collides with head
-> set AltVal("Head") to 1

+ always
-> set AltVal("Zombie") to AltVal("Head")

+ AltVal("Zombie") = 1
-> kill Zombie

+ AltVal("Head") = 1
-> kill Head


You almost never want to use "compare two general values" when you have duplicates, as it will always retrieve values from just the most recently created instance, regardless of what other conditions you have.


 
n/a

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 20:52:41 -

@cecil - didnt work...

@sketchy - that first one is basically what i have, except not only do i have that, but it sets the fixed value to an alt value aswell... but unfortunatly i tried using just the spread value aswell. like i said its like it wants to put an or statement instead

ill try the second one tho, ill let you know if it works. thanks!

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
8th March, 2009 at 20:57:17 -


Originally Posted by Sketchy

You almost never want to use "compare two general values" when you have duplicates, as it will always retrieve values from just the most recently created instance, regardless of what other conditions you have.



youre kidding.

+compare alt value a("object 1") > 10
-destroy object 1

will only destroy all instances with alt value > 10.
at least im pretty sure. im at work and dont have mmf handy but thats how ive always handled it.

@chloecakes - try grouping all zombies into a qualifier and compare the alt value of the group.

 
n/a

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 20:59:21 -


Originally Posted by Sketchy
+ always
-> set AltVal("Zombie") to AltVal("Head")



i think this line killing it.

it dont work.

@cecil - ...ill give it a shot!

Edited by Chloe Sagal

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

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!
8th March, 2009 at 21:04:48 -

Both ways will work fine, unless you're doing something else strange.

What events are you using to keep the heads attached to the zombies etc?


Yet another alternative:

+ new zombie created
-> spread 1 in head altval
-> spread 1 in zombie altval

+ always
-> set counter to 0

+ bullet collides with head
-> set counter to altval of head

+ altval of zombie = value counter
-> kill zombie




 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
8th March, 2009 at 21:10:58 -

I'm surprised you can't just use a normal "bullet collides with zombie head -> destroy head" event. Unless there's 500 zombies on the screen at once shouldn't that work? Geez, no wonder my coding sucks if it wouldn't haha.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 21:29:09 -

i really dont understand why this isnt working. i set the spread value to a completely separate value, unrelated to the rest of the program, and put in that system that you stated and it still doesnt work, so it might be what you said, the head snap, because its in a loop and it might just be tossing the same random heads all over the place or something, i really dont get how that is working. its retarded, ive tried eveyrthing and there is no reasonable explaination of why this particular event stopped working, and why it continues to screw itself repeadedly.

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

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!
8th March, 2009 at 21:31:03 -


Originally Posted by miss chloecakes

Originally Posted by Sketchy
+ always
-> set AltVal("Zombie") to AltVal("Head")



i think this line killing it.

it dont work.



In that case, there's something wrong with the system you used for matching the heads to the bodies in some other events (maybe for the positioning, or attacks or something).
If you just allow MMF to automatically match them, all 3 methods work fine.

If you post the source maybe we could help.


 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
8th March, 2009 at 21:33:17 -

Hm. If bullet is touching a zombie, destroy bullet, add 1 to an alterable value. If that alterable value is above 1 then destroy zombie. Or, if bullet hits zombie, pick one zombie at random and destroy zombie.

It might be that you aren't being selective enough with your zombie picking with the fixed value. MMF is picky and doesn't play well with others.f

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 21:40:11 -

lol, i did pick on at random, and if the headID was equal to kill counter, than it dies, but it just ignored the value portion and just picked on at random, so i shot this one zombie in the face and blew his head off, he was fine, but the guy behind me bled to death for an unexplained reason.

i think it mightve been because i still have the set counter to 0, and by the time the game processes the right one its already at 0, so ill set it after the event happens and see how that goes, if not i guess im posting my source code.

EDIT: yeah it didnt work. i got it down to one zombie at a time though, just not the right zombie (go figure). anyone interested in taking a gander at my source code? if you want let me know and ill pm it.

Edited by Chloe Sagal

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
8th March, 2009 at 21:46:06 -

If you mark the problematic lines with a comment, I'll look at it.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
8th March, 2009 at 21:55:13 -

sent.

anyone else interested in taking a whack at it?

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal
   

Post Reply



 



Advertisement

Worth A Click