User Tag List

Results 1 to 4 of 4

Thread: Automatized frame loading into an active object

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2008
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automatized frame loading into an active object

    Hi there,

    I'm new to these forums and wanted to say "Hi!"
    Though I've been using MMF for quite a while now and my skills are quite advanced.
    However, I'm struggling with a problem at the moment.

    In my current project (yes, it's Zombie Smasherz) I coded a level object handler which defines all kinds of attributes of an active object. So this active object can act as whatever it is told (e.g. a door, an exploding barrel, a chest with treasure in it, a switch, and so on).

    The level object has two states: activated and deactivated. The state is determined by flag 0. It also has two different animations for the corresponding state. When it's activated, I want it to display an animation which can be 1-200 frames long. The animation frames are stored as PNG images in a folder and are enumerated, e.g. exploding_barrel01.png, exploding_barrel02.png and so on.
    I created a loop that loads images into the level object's activated animation. This, however, does not work.
    Here's what I do at the moment (pseudo-code):

    1.: Start of frame: start loop "load_object_animation" X times where X equals the alterable value "number_frames" of active object "Level Object" (this is necessary to know how many frames are loaded from the files).

    2.: On loop "load_object_animation":
    For active object "Level Object", load a image from file into animation "activated" of "Level Object" into the Xth frame of the animation, where X equals the loop index of "load_object_animation". With a bit of string trickery, the file to load is composed as follows: "animation_name"+"loop index of 'load_object_animation'"+".png"

    In theory I thought this will result in the level object having an activated animation with e.g. 4 frames loaded from the image folder:

    exploding_barrel01.png
    exploding_barrel02.png
    exploding_barrel03.png
    exploding_barrel04.png

    In practice the activated animation has only 1 frame, and not even that is altered, just the ol' green diamond.

    Checked the file name composition, that's working fine.
    Are there any pitfalls I stumbled into?
    Thanks so far!

    Cheers,
    the Colonel

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2008
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automatized frame loading into an active object

    Fixed it. Thanks.

    The Colonel

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Automatized frame loading into an active object

    Would you be willing to share your solution, in case other users come across this type of problem?

    stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  4. #4
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: Automatized frame loading into an active object

    If you want to load 4 picture files to use as 4 frames of an animation, then the animation must already be composed of 4 frames (default green diamond for example). Check the help file for more info.

Similar Threads

  1. Loading a pallet for an active object with index colour
    By kreeddem in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th November 2013, 10:35 AM
  2. [CRASH/Bug] Active in Subapp loading frame from same file
    By netninja in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 18th November 2012, 02:55 PM
  3. Loading an external ACTIVE OBJECT into main program?
    By Crian in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th April 2012, 01:16 PM
  4. loading flipped images to active object at runtime
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th January 2008, 04:54 AM
  5. Active Object loading external files?
    By Chokito in forum Extension Development
    Replies: 13
    Last Post: 25th July 2006, 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
  •