User Tag List

Results 1 to 5 of 5

Thread: How to know when a specific object be destroyed ?

  1. #1
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to know when a specific object be destroyed ?

    Hi, i have a question
    I have 2 enemy with different ID (create with Spread Value), and enemy #1 have 10HP, enemy #2 have 20HP. When an enemy has been destroyed, i need create "new" enemy at a specific position, if enemy #1 has been destroyed then i need create it again at X100, Y100, but if enemy #2 has been destroyed then i need create it again at X200, Y200
    I don't know how to do it, i can destroy a specific that i need, but i can't make MF2 understand which enemy had been destroyed (#1 or #2)
    Please help me !

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    To clarify, are you struggling to detect a specific instance of the enemy object which is about to be destroyed or are you struggling with creating a new enemy at specific location depending on enemy ID?

  3. #3
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I struggling with creating a new enemy at specific location depending on enemy ID

    Something like this
    if enemy #1 has been destroyed then Internal Flag 1 = off,
    if enemy #2 has been destroyed then Internal Flag 2 = off.
    Then
    if Internal Flag 1 = off then Create Enemy at X100, Y100, Internal Flag 1 = on
    if Internal Flag 2 = off then Create Enemy at X200, Y200, Internal Flag 2 = on

    sorry for my bad English

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ok, when an object is destroyed with the "Destroy" action, no other events can affect it. So this means you need to create the new objects before you destroy the old objects.

    I suggest passing the coordinates of where you want to create the new objects to the old object's variables.

    Example Image:


    When an object should get destroyed, you can then turn a flag on, such as Flag 0. Then you can do the following event. All objects with their Flag 0 on mean that should be destroyed in the current event cycle.


    **Note**
    This event only works if the object being destroy and object being created are two different objects, as shown below.


    If you want to use only one instance of an object it would be easier to simply manually place the objects via fixed coordinates, as shown below.


    **Note**
    It is crucial for event 5 to be on its own after events 3 and 4.

  5. #5
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks you so much I changed it a little, as i use new Alterable Value instead Flag, and this is result



    I think It's working fine (atleast now )

Similar Threads

  1. Destroyed object reapears!
    By AftPeakTank in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 24th June 2013, 09:11 AM
  2. Last object has been destroyed with a flag on
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 22nd May 2011, 12:27 AM
  3. object not completely destroyed?
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 30th June 2010, 04:23 PM
  4. Object destroyed if not on frame
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 12th April 2010, 03:26 AM
  5. How can a destroyed object be visible?
    By RayMarble in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th October 2008, 06:57 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
  •