Is this a Container bug or do I not understand Containers?

0 favourites
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • See my second and fourth post.

    Do your second and fourth post say that the C3 editor is flawed so it disallows correct usage of Containers? If not, the Containers implementation is flawed. Regardless, thanks for the replies :-)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • locohost

    for some reason I thought you could make a family into a container... that would have solved your problem. But since that isn't an option, you might want to put all your monsters in one sprite object - and make a separate animation for each different monster. that way you can make the combined monster object into a container to hold the arrays. Then set the animation for the monster you want, and set any instance variable as necessary, and each monster object will have its own arrays as well.

    It is still a good idea to have a family as well - that comes in handy if you have to compare two monsters at the same time (you pick one from the object and one from the family).

    but, I just did a quick test... when you pick a monster by the family, the container objects (arrays) are NOT picked. They will only be automatically picked when you pick the monster by the object.

    if you DO pick a monster by the family and need the arrays, you would have to pass the UID into a function where you then pick the object by the UID...

    see my sample here...

    you press a number key to create a monster (from 1 to 4 across the top of the keyboard - not on the number pad). Left click on a monster to pick it by the object to display his info. or right click to pick by the family... doing the right click didn't work properly until I made it call a function.

    EDIT. this method would be ok, if you don't have too many monsters, and the monsters don't each have numerous animations, and you typically use the same monsters on every layout - otherwise you might start to run into memory issues.

    an array can hold a lot of data! I don't really have a clear idea of just how much data you are trying to store for each monster. Rather than have a separate array for each monster, you might be able to have the monster's UID be the key to one large array. (an array can be three dimensional, so one array could hold a lot of data for a lot of monsters). Another option would be to just use instance variables - you can have a lot of those as well, and store a lot of data that way too...

  • AllanR

    Thank you again AllanR for the great ideas!

    I'm still exploring a couple ways to simulate objects that have complex properties. i.e. object properties and arrays of object properties. C3 Containers is soooooo damn close to what we really need for this. But it just won't serve in it's current implementation.

    Right now I'm working on implementing the Monster complex properties as simple UID pointers to external arrays. I've put together a suite of functions (that take a MonsterUID as first param) to create, get, set, add, etc. the Monster properties.

    This "functions/UID-pointers" approach is waaaaay more "code" than we really should be forced to build. C3 Containers needs some improvements or we need some way to store and retrieve complex data properties in objects.

    I will definitely investigate your excellent suggestions. Thanks again my friend! :-)


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)