User Tag List

Results 1 to 8 of 8

Thread: Enemies are sharing health?

  1. #1
    Clicker Fusion 2.5

    Join Date
    Feb 2014
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Enemies are sharing health?

    I'm using alterable values to contain the hp of my enemies. When they collide with a bullet object, that value is subtracted by ten. When the value reaches zero, the enemy should destroy itself.

    I have used a counter bar to see exactly what is happening. As per expected, each enemy has their own life bar that works independently of one another. If I shoot enemy A then enemy B is not affected. However, once enemy A's health value hits zero, for some reason it is enemy B that destroys, and enemy A's health is reset to full.

    What could be happening to cause this?

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Can you post a mfa example so we can be of more help.

    Thanks,
    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Maybe switch Enemy A's health Bar with Enemy B's health bar instead?

  4. #4
    Clicker Fusion 2.5

    Join Date
    Feb 2014
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had to remove a lot of the little addons I had as well as most of the stuff that's for the game and unrelated to this before uploading the mfa, and for some reason that broke the player movement even though none of that used the addons, but for the sake of testing this enemy thing I just threw the player on 8 direction. The folder you're wanting to look at is labeled "Baddies", in it are "FoxFeral" and "Wolfman". Sorry about the messy workplace, I haven't exactly tidied it up yet. The code however is in nice groups. I probably should have commented it though.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I haven't looked at your code yet but the first thing to try would be:

    Enemy health = 0
    +Pick one enemy at random
    --> destroy enemy

    This should solve the scoping issue, otherwise you may have to run a ForEach loop.

  6. #6
    Clicker Fusion 2.5

    Join Date
    Feb 2014
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man, I'm still having this problem. Sorry to say SolarB, but neither method worked.

  7. #7
    Clicker

    Join Date
    Jul 2011
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://mfa.aquadasoft.com/upload/1398768734-feral.mfa

    I'm not sure if this will help.

    [edit]

    I took another quick look at your .mfa. I think the problem may be that you have the HP and collisions set in the feral fox, but the feral fox active object is always being positioned over a collision object ("Fox Collision"). It may be that when a fox is destroyed, MMF automatically redistributes the remaining foxes over the collision objects. You may want to either eliminate the collision objects, or rewrite the lines so that the HP and bullet collisions happen with the collision object.

    I dunno if that made sense.

    [edit 2]

    I made the fox collision object visible and the feral foxes invisible. I can see that when a fox is destroyed, that all of the fox collision objects remain. I am nearly certain this is the problem.

  8. #8
    Clicker Fusion 2.5

    Join Date
    Feb 2014
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, thanks. Got it working now.

Similar Threads

  1. Health for Enemies
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th March 2011, 06:30 PM
  2. Enemies with Health? (read more)
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 30th July 2010, 06:16 PM
  3. Spreading health bars on enemies
    By Bernardo3D in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th October 2009, 01:27 AM
  4. thrown enemies not detecting other enemies
    By mobichan in forum File Archive
    Replies: 4
    Last Post: 8th April 2009, 06:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •