User Tag List

Results 1 to 5 of 5

Thread: ID / Parent Child connection, object linking, ones and for all

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,196
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Question ID / Parent Child connection, object linking, ones and for all

    I always find myself in every single project I make to get the most headache over getting several objects of the same "class" to be linked together.
    I usually get it to work somewhat from hours of trial and error, but it never feels like I have nailed it or that it is very robust. It often ends up more like a mess of code that I half understand in the end from all trial and error but *seem* to work.

    What I mean is for example to have 10 enemy objects that each have an individual head and health bar "attached" to them.
    So when something affects enemy number 3 the other "parts" of him react accordingly. For example when the character dies his head display its death animation and when his health is low his health bar starts to flash and so on. When he is destroyed the other parts gets destroyed with him.

    Why is this so hard to get to work right without a lot of messy code? Or am I missing something? As far as I know the only way to do this is with fast loops?
    Is there some easy "logical" way to do this that really work at all time? I think I found some good tutorial on this subject on Chris Burrows article site, but his site seems to be down now :/.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    If you don't need to support other runtimes, there is an extension called the Sticky Object which does exactly this.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,196
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    If you don't need to support other runtimes, there is an extension called the Sticky Object which does exactly this.
    That is not an option :/ I don't like the idea of using an object that limits the number of runtimes it can be exported to.

    But is this really so hard an object is needed? I mean it feels like something very essential.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ussually tend to use fixed values for such things since this can rarely go wrong, when you create the enemies objects, set healthbar altval A to fixedofEnemy, and Head altval A to fixedofEnemy

    So when the enemy dies:
    -enemy is dead
    -Healthbar A = enemyFixed
    -Head A = enemyFixed
    =destroy healthbar
    =destroy head

    And make sure you do not use compare two alterable values, but use compare to alterable value. Also depending whetever multiple enemies can die at the same time you must add pick one enemy at random.

    If you want objects to move with the main object and you have multiple enemies moving at once instead of sticky object or a fast loop, you would need to learn about pairing objects.
    http://www.create-games.com/article.asp?id=2248
    http://www.create-games.com/article.asp?id=1960

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1
    [Movement Events if using Custom movement]

    2
    If Body Health_ = 0
    - Body set BodyState_ to -1

    3
    Allways
    - Set Head position to Body position
    - Head set HeadState_ to BodyState_

    4
    If Head HeadState_ = -1
    - Head destroy

    If Body BodyState_ = -1
    - Body destroy

    ...
    This will auto pair up Bodys and Heads, and Heads will know if their Body is destroyed.

Similar Threads

  1. Understanding ForEach Object and Parent/Child Objects...
    By TheFieryPlumber in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 24th May 2013, 03:19 PM
  2. Is there a parent child heirarchy object?
    By turtle in forum Multimedia Fusion 2 - Technical Support
    Replies: 18
    Last Post: 12th July 2010, 04:40 AM
  3. Parent-Child?
    By xhunterko in forum File Archive
    Replies: 2
    Last Post: 6th December 2009, 08:18 PM
  4. 2-parent, 1-child creation
    By Ultimo240 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th November 2009, 10:26 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
  •