Changing animation groups from file

For questions about using Classic.

Post » Tue May 17, 2011 2:32 am

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?
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 18, 2011 1:12 am

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?
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Wed May 18, 2011 2:34 am

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

[quote="alspal":1o6a5p2l]You were a little ambiguous on some details, in particular how many sprites your using.[/quote:1o6a5p2l]

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.

[quote="alspal":1o6a5p2l]I'm assuming, you have 1 sprite which is used for each member in the gang and each member uses a different animation set?[/quote:1o6a5p2l]

Correct.

[quote="alspal":1o6a5p2l]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?[/quote:1o6a5p2l]

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).



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:



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.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 18, 2011 3:25 pm

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.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Thu May 19, 2011 5:21 pm

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.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Fri May 20, 2011 3:55 am

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.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sat May 21, 2011 3:12 am

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.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests