The Daily Click ::. Forums ::. Klik Coding Help ::. Loading Active Object frames in a loop.
 

Post Reply  Post Oekaki 
 

Posted By Message

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
9th January, 2010 at 15:54:11 -

For a system I'm working on at the moment, I'm intending to load animation frames into an Active Object using definitions from an .ini file. The problem I'm having is that the same picture gets loaded into all of the active objects, even though they all definitely have separate defined images. I know this they're all defined properly because if I replace the Active Objects with Active Pictures, the images all load in correctly. Does anyone know if this is a bug with the Active Object or just something I'm not doing right? Using HWA beta #9.

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
9th January, 2010 at 16:35:06 -

Your active's animation you're loading frames into must have as many pre-created frames as the number of images you want to load in.
If there's only one frame created, only the first image will be loaded.

Here's an example incase you'd want to compare.
http://www.mediafire.com/file/uxmtjd0jzml/ImageLoadingLoopExample.rar

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
9th January, 2010 at 17:03:11 -

Thanks for the feedback, although that wasn't exactly what I meant (although what you said has pre-emptively fixed a bug I would have come across later in development!)

What I meant was this: Say there are two Actives, 1 and 2. When loading the level, they have loaded into them information from two ini files dictating what images they should have. When I use Active Pictures, 1 gets the 1 image, 2 gets the 2. When I use AOs, both get the 2 image.

Although I think I know why. I'm assuming two instances of the same AOs cannot have two different images loaded in to them?

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
9th January, 2010 at 17:28:56 -

Sorry, I should have read better.


Originally Posted by Rob Westbrook
I'm assuming two instances of the same AOs cannot have two different images loaded in to them?



You're right, duplicates all share the same animations. But couldn't you just load all the frames in and only display the right images/animations?

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
9th January, 2010 at 17:50:16 -


Originally Posted by ::SPITZNAGL::

You're right, duplicates all share the same animations. But couldn't you just load all the frames in and only display the right images/animations?



The thing is the reason to load in the frames eventually will to have custom Actors with their own animations, defined through an actor editor and placed as an event in the level editor. Now it looks like I'm going to have to code my own animation system based on Active Pictures... That's going to be fun.

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
9th January, 2010 at 20:43:02 -

Why not use the animated picture object then?
With it you can name the the different animations, so it would make it easy to access the right tileset even if all caracters don't have the same number of animations.

You could call the tileset with a string expressions such as this one;
Set Current image to (name( "Animated Picture" )+"walking")

This example uses an external ini file & the animated picture object (wich I included in the folder):
http://www.mediafire.com/?2n2jijonho4

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
10th January, 2010 at 02:35:05 -

As it happens I am using that now x) I found it just after resigning myself to a custom engine, and gave a tiny cry of relief. Thanks for the source though, where I got the extension from didn't include the help file.

 
There are 10 types of people in the world: Those who understand binary and those who don't.
   

Post Reply



 



Advertisement

Worth A Click