User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: How do I kill it without kill an enemy without automatically killing the other?

  1. #1
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I kill it without kill an enemy without automatically killing the other?

    I have an enemy in the map, uses alterable values for health and itís supposed to die when it hits 0. Thereís a problem: I put two of the same enemy in, and I canít hit or kill one without hitting/killing the other at the same time. Any ideas on how to fix this? A similar problem is occurring with boxes I can pick up and throw later on in the map. One is picked up, the other seemingly disappears and if it goes off screen when I climb up the ledge, it disappears.
    Attached files Attached files

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    401
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well, there's a lot of things going on there...
    You have hitboxes, you play dissapearing animation but don't destroy the enemy, only the hitbox...
    Destroying an object will automatically play the Disappearing animation, you don't need to play it first then destroy the object when it finishes...

    To destroy the proper enemies and hitbox you would need that the enemy had the hitbox fixed ID or at least and spread of values into a variable that would be it's ID...
    This is advaced stuff... So I recommend you using embed sensors which is also advanced but require simpler conditions and actions to work...

    Here's a tutorial: http://www.diybandits.com.au/MMF/tut...embedded1.html
    In your case you seem to be using two external sensors, so you can simplify this...
    Also, for the animations to work properly, you will need to enable the compatibility option under the enemy runtime options called "Do not reset current frame duration..."

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    On line 134 you're not specifying which enemy - so it's going to deduct 4 Health from every enemy - which means they all die together.

    An easy way to get around this is to set a flag on - so if the player jumps on an enemy - set his flag on. If his flag is on - deduct 4 health and set his flag off.

    Same thing with your boxes - when one is picked up - set a flag on - then do all interactions only when that flag is on. That means the box that isn't picked up will be left alone.

  4. #4
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I’m still getting the enemy issue sorted but I did manage to get the boxes working and even managed to get them to stack. The problem here is that when they’re stacked, the collision won’t work for the top box. He’s supposed to stop upon touching the box and he just goes through it. Do I have to use the “box position is greater than the y position of bottom edge of player” thing to get this to work right?

    EDIT: Nevermind! I figured it out. Now to try to fix the enemy.

  5. #5
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Janette5 View Post
    On line 134 you're not specifying which enemy - so it's going to deduct 4 Health from every enemy - which means they all die together.

    An easy way to get around this is to set a flag on - so if the player jumps on an enemy - set his flag on. If his flag is on - deduct 4 health and set his flag off.

    Same thing with your boxes - when one is picked up - set a flag on - then do all interactions only when that flag is on. That means the box that isn't picked up will be left alone.
    This worked with the boxes, but not with the enemies on the ground. I even set it so that it dies on one hit and with the Q key and charge attacks. It says "Flag 0 is on - Destroy, Set Flag 0 off". It's still affecting all the enemies.
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    What must I do to kill the enemies? Jump on them, shoot them, press a key?

  7. #7
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I said press Q. It has to overlap the electric ball.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Well you have multiple commands that interact with the enemy - I'm trying to work out what must happen. So if the player presses Q and there is an energy ball then do you want the enemy to die immediately or to lose health?

    Because you have all these commands - and in each one where you're referencing the enemy you are not scoping to a particular enemy, and so it's doing this to all the enemies.

    * EnemyHitbox is overlapping ChargeAttackEffectLevel01
    + ChargeAttackEffectLevel01 is visible
    Enemy : Set Flag 0 on
    EnemyHitbox : Set Flag 0 on


    * Enemy: Flag 0 is on
    Enemy : Destroy
    * EnemyHitbox: Flag 0 is on
    EnemyHitbox : Destroy




    * EnemyHitbox is overlapping ChargeShotEffectLevel02
    + ChargeShotEffectLevel02 is visible
    Enemy : Set Flag 0 on
    EnemyHitbox : Set Flag 0 on


    * EnemyHitbox is overlapping ChargeShotEffectLevel03
    + ChargeShotEffectLevel03 is visible
    Enemy : Set Flag 0 on
    EnemyHitbox : Set Flag 0 on


    * EnemyHitbox is overlapping EnergySHot
    + EnergySHot is visible
    Enemy : Set Flag 0 on
    EnemyHitbox : Set Flag 0 on


    You need to connect these to an enemy and there are many ways of doing that in Fusion - using values, fixed values, flags etc.

    For example you can create the enemies, instead of having Fusion automatically create them:

    * Start of Frame
    New Objects : Create EnemyCollisionBox at (632,1614) layer 4
    EnemyCollisionBox : Set Flag 5 on
    New Objects : Create Enemy at (0,0) from EnemyCollisionBox
    Enemy : Set Flag 5 on
    New Objects : Create EnemyHitbox at (0,0) from EnemyCollisionBox
    EnemyHitbox : Set Flag 5 on


    * Start of Frame
    New Objects : Create EnemyCollisionBox at (407,1616) layer 4
    EnemyCollisionBox : Set Flag 6 on
    New Objects : Create Enemy at (0,0) from EnemyCollisionBox
    Enemy : Set Flag 6 on
    New Objects : Create EnemyHitbox at (0,0) from EnemyCollisionBox
    EnemyHitbox : Set Flag 6 on



    Now one set of enemies has Flag 5 on and the other set has Flag 6 on.

    Now when you reference them you have to test which enemy is which:

    * EnemyHitbox: Flag 5 is on
    + EnemyHitbox is overlapping ChargeShotEffectLevel02
    + Enemy: Flag 5 is on // by inserting this - we're now scoping to a particular enemy that is matched to that particular hitbox
    + ChargeShotEffectLevel02 is visible
    Enemy : Set Flag 0 on // now only the enemy with Flag 5 on, will have Flag 0 switched on - instead of all the enemies.
    EnemyHitbox : Set Flag 0 on

  9. #9
    Clicker Fusion 2.5

    Join Date
    Dec 2019
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked! Thanks!

    EDIT: Well, for the most part. Fo4 some reason both enemies are playing the disappearing animation even though only one of them is destroyed.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Yes, you have to change that linking everywhere there is any interaction with the enemy. So everything has to be referenced by the flag, your always events and this one too, your kickback and knockout events etc.

    * Collision between PlayerHitbox and PoundIndicator
    Enemy : Sub 4 from Health
    Enemy : Set Buffer to 15

    I wanted to change it in your game for you, but I was really struggling to work out what exactly had to happen with the enemies, so gave you an explanation instead. If you can comment everywhere there's an enemy interaction what is happening and post it again, I can change it in your game for you.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Raise Kill counter when enemy is killed
    By jman in forum Fusion 2.5
    Replies: 4
    Last Post: 29th April 2015, 12:44 AM
  2. enemy floats in air after i kill it
    By gamebuilder in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 19th February 2013, 10:27 PM
  3. Kill enemy from top ?
    By basit in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th September 2008, 12:59 AM

Posting Permissions

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