Changing animation groups from file

This forum is currently in read-only mode.
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Let's say your game has 26 different gangs and each gang has its own color. In the gang selection screen, you have a gang called the "Bashers" and their color is red. There are 22 gang members in the "Bashers", so that means that all 22 men have multiple animation angle sets in the animator.

    But, you want to select the "Crushers". They have the same number of gang members and the same number of animation angle sets, except their color is navy blue.

    How would I call up the Crushers frames from file and replace all of the Bashers animation frames in the Animator?

  • You were a little ambiguous on some details, in particular how many sprites your using.

    I'm assuming, you have 1 sprite which is used for each member in the gang and each member uses a different animation set? I'm also assuming you wanted to use this same sprite for all 26 gangs, but for each gang you want to replace all the frames with frames for their gang?

  • EDIT: Okay, the diagram shows 23 gang members each (lol) but that doesn't change anything

    You were a little ambiguous on some details, in particular how many sprites your using.

    That's because I'm not able to get an approximate number at the moment, but in the diagram below I've attempted to ball park the number.

    I'm assuming, you have 1 sprite which is used for each member in the gang and each member uses a different animation set?

    Correct.

    I'm also assuming you wanted to use this same sprite for all 26 gangs, but for each gang you want to replace all the frames with frames for their gang?

    Well, some frames will be different. But the idea is to be able to call up the frames from a file folder for any gang and then replace the frames of a gang that already has its frames in the Animator.

    The red dots represent the Bashers and its 23 gang members (with all of its animation frames and angles), the green dots represent the Rammers and its 23 members (with all of its animation frames and angles).

    <img src="http://farm3.static.flickr.com/2721/5731839159_22ac7ef893.jpg">

    Now, imagine that one of the Rammers 23 gang members animations are in the Animator box and there are several animation angles there as well:

    <img src="http://farm4.static.flickr.com/3118/5731853921_96a54d70d3.jpg">

    As the first diagram shows, I'm trying to replace all of the Rammers animation frames with the Crushers animation frames by calling the frames up from a file when I press a controller button or press a key.

  • Remember that each instance of that sprite will get any new frames you load.

    Anyway, this is the solution to the question I think you were asking.

    http://dl.dropbox.com/u/1024727/gang.zip

    Oh I forgot to do different gang types, but it should give you an idea? I only did 2 angles and 2 animations. Couldn't be bothered doing more, it shows a method for how to do it all though.

  • Thanks for .cap. I think your example is different from what I'm trying to do though. Here is a .cap with image folders that fully illustrates my target.

    https://rapidshare.com/files/2388230909 ... ample1.zip

    In the .zip you'll find:

    1. One main folder for the Crushers and one main folder for the Rammers. Both folders contain sub-folders that correspond directly with the animations named in the Animator in the .cap, and they contain the image files that would need to be called up using events and populated into the correct animation sets (i.e. the image frames in the "BobMoving" folder would need to be called up into the "BobMoving" animation set in the .cap at runtime based on selecting the gang Bob is a part of which in this case would be the blue gang - The Crushers).

    2. The .cap

    In the "Gang Selection" screen, select one of the gangs by using the up and down arrow on the keyboard, and then press 'Enter'. This will take you to Layout 2 which is the "Fight" area and it shows the gang you selected fighting with the Bashers gang (in red).

    In a nutshell, when you select a gang in Layout 1, in the next layout (Layout 2) the gang you selected should be visible there (based on a Global Variable), and all of the frames for each animation name for each gang member of that gang should be called up from the proper folder and sent into the proper named animation sets.

  • My example did basically that, except I didn't use folders and I had a different naming convention. I had all the animation's names as a number so that it would be simple to just have it correspond to a loop index.

    You could continue to use named, but it may be quicker in events to use a numbered naming convention. I'll alter your example to show this.

    http://dl.dropbox.com/u/1024727/AlsGang ... xample.zip

    This example changes it to the right gang member using the global variable, and all of his frames for each of his animations are replaced from the appropriate folder.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, alspal! I understand exactly now. This is fantastic!

    At first I was concerned with how I would keep track of each gang members folder in an organized way, but now I'm thinking I should be okay changing both the 'data' part of the expression and the primary gang folders to the name of a gang, and then using a separate chart to match animation names with gang member names like:

    CrushersData >>> 0-1 >>> Chart says '0-1' is Bob

    CrushersData >>> 2-3 >>> Chart says '2-3' is Mike

    ... and so on.

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