Weird Bug
tutyses
Member Posts: 134
Hello everyone!
I started a new project a few days ago, and i am already facing a big Bug. There is almost no code, and it's so simple! i dont why it doesnt work
Basically i have a Zombie walking from left to right, the zombie has 2 different actors, one for the head and another one for the body. When i shoot the head it changes ZOMBIEHP to ZombieHP-100, and when i hit the body it Changes ZOMBIEHP to ZOMBIEHP-50
There is a rule in the body which says that if the ZOMBIEHP Is lower or Equal than 0, it will be relocated to the left part of the screen, and the life will be changed to 100 again
The problem is that sometimes the zombie WILL NOT DIE and the life will go to negative numbers, it s like the rule isnt working but i dont know why!
If i deactivate the collision of the head it does work well, if i deactivate the body collision, it does work well too, the problem is when both are activated.
The bug is solved if i put the rule which checks if zombiehp is lower than 0 inside a timer, but i dont want to do this for every zombie on Screen
Here is My project http://www.putlocker.com/file/51FEA5384CF801DB
To see the bug in action, aim to the head, and in less than a minute you will see it
I started a new project a few days ago, and i am already facing a big Bug. There is almost no code, and it's so simple! i dont why it doesnt work
Basically i have a Zombie walking from left to right, the zombie has 2 different actors, one for the head and another one for the body. When i shoot the head it changes ZOMBIEHP to ZombieHP-100, and when i hit the body it Changes ZOMBIEHP to ZOMBIEHP-50
There is a rule in the body which says that if the ZOMBIEHP Is lower or Equal than 0, it will be relocated to the left part of the screen, and the life will be changed to 100 again
The problem is that sometimes the zombie WILL NOT DIE and the life will go to negative numbers, it s like the rule isnt working but i dont know why!
If i deactivate the collision of the head it does work well, if i deactivate the body collision, it does work well too, the problem is when both are activated.
The bug is solved if i put the rule which checks if zombiehp is lower than 0 inside a timer, but i dont want to do this for every zombie on Screen
Here is My project http://www.putlocker.com/file/51FEA5384CF801DB
To see the bug in action, aim to the head, and in less than a minute you will see it
Comments
You use for your attribute real o integer values? Game values or player values?
I recommended you to put a text on scene to display the real value on any moment for evaluate the problem.
I already have text displays showing the attributes but trust me, it wont help me :P it s a pretty weird bug
If i change the Overlaps or Collide Event and instead of it i activate the behavior pressing the Key on the Keyboard it wont be bugged
Is this a Gamesalad Bug with Overlap Or collide?
Here is the project https://mega.co.nz/#!mwwkXAwZ!FwNFwRasIIL98igNpQT7BAi8QjxsywtRz-aVpsBp_O0
Alright, I'll take a look and see if I notice anything.
Edit: it took me three tries to download the file correctly. PutLocker @#*(%&%*!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Take the "death" rule out of the collision rule and see if that fixes it. Edit: it didn't fix it for me. I suspect it's a timing issue... that the HP is being reset at same moment that the fireball is hitting the zombie. Try adding a timer after 0.1 seconds for all of your reset HP & position behaviors so that they fire slightly after the fireball is destroyed.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have been using gamesalad for 2 years, but i have to take a break because i had to buy a 64 bit mac and i didnt have time either, so i am a little rusty now, It would take me several days more or even a week to figure it out
thank you again :P
Edit: i hate to ask people for help but this was bothering me so much
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User