Jump to content

Need Help Creating Custom Character Walking Animations


Recommended Posts

So animating is kinda foreign to me.  More than that is testing animations.  I got a general idea on how spriter works with the klei tutorials but I'm not sure of the most efficient way to make animations for characters themselves.

 

I have my .lua file functioning as intended with the appropriate game features, right now I'm trying to figure out how to create the custom animations that make character needs to be in.

 

 

Essentially my character has a nervous state and a panic state, when hes in the nervous state he walks slower, and for the panic state he runs faster.

 

I want to create custom animations to replace the character movement animations when these states are changed, but I don't have any base to work off of.

 

So I'm not exactly sure how I should start my spriter files for the animations.

Link to comment
Share on other sites

@Zackreaver,

 

You can, but it's not incredibly easy.  If you export some walking animations and then remove the build.bin and atlas-0.tex files from the resulting compiled zip, you can then use the zip(with only anim.bin left in it) as extra animations for a character.  I would start with an easier task and work your way up, though.

Link to comment
Share on other sites

On a related/unrelated note, I have a similar question. Say I made a character that was naturally slower than other characters, is there any way I can slow their walking animation so it doesn't look like he is jogging in place and slowely moving forwards.

Link to comment
Share on other sites

Don't bother, you can't do it. The animations will break once it's exported into the game. It'll work for creatures, but not actual characters.

you're 100% wrong, we've had custom player animations in our mod for months now.

Link to comment
Share on other sites

Yea, I think there is. I know very very little about it myself, but I've toyed around with it.

Wouldn't you just add an action to the character's stategraph? Like "walkslow" and "walkfast" (so that you wouldn't have to re-animate the default "walk" animation)

I remember there being a tutorial about adding your own custom idle animation to a character, looking at that might help show you how to add onto stategraphs.

Link to comment
Share on other sites

@kraken121, 4 months late to the topic and providing no additional details on how to do it; why?

I don't see why the date of the post has anything to do with this topic..

 

as for how we managed to do it , I would have to call in DeathDisciple ( I can't believe this "mention" stuff is still broken after a year or so)our coder. 

 

(edit and srsly deleting your posts lol )

Link to comment
Share on other sites

Ugh, you make me write a wall of text that noone will find readable, let alone useful... you've been warned, read at your own risk, I suck at explaining.
 
The cheerio's custom animation template is the base idea, yet incomplete for people that don't understand underlying logic. To have proper custom animation that runs on every character you need to add the override symbols, as well as all the missing symbols that belong to other characters than wilson. To have proper custom animation that works on your character alone, you still need to add overrides and missing symbols that don't exist on wilson's template.
 
Obviously, you could add extra symbols too, as long as you add them to your build as well, but they would be seen just on your new animation. The images you can use for making those animations have to exist on a player build that the animation is referencing/running on, so you'd have to add them to your character build file.
 
About a year ago, maybe a bit less, I've done the full template for DS (no DST symbols/links, it's easy to add them, I just couldn't justify spending time and memory on something I don't use) without the tail symbols placed (since I don't use them, and decompiler didn't export them 100% correctly IIRC, you can add them but will likely need tuning). swap_face and hairfront are not used anywhere as far as I know, not even properly animated on default animations, so I didn't bother with actually placing them. It's possible I mixed some layers and/or have fixed some stuff since, but I'll crosslink it here because that's what I have uploaded that doesn't require you to download 600mb git and hunt it down.

Monks attacks and whirlwind of hitd are the proof it does work and it works independent on character build (as well as a bunch of other stuff that's not live, like sneaking, zombie animations, instruments and what not on dev build). Alternatively, the file itself comes with a pluggable proof of concept scml (player_anims). 

attachicon.gifplayer.zip
 
There's another problem, layer names need to be maintained/converted and modtools doesn't have support for that. I've mentioned before why that's the problem, as well as my way to fix it. The example expects that approach to work, otherwise show/hide layers wont work.
 
Main thing to note tho, is that you're calling on anim.bin, the build/atlas files that modtools would export are being ignored and should be just deleted from the output zip file for the sake of space if anything. I have used 'real' objects instead of placeholders for swaps cause I find it crazy to try to animate dots, but they are just placeholders. As such, pivots should never be changed as the pivots that game would use are those that belong to the original build.bin not the ones you set in spriter animation (unless the template is mistaken about their values and they need to be readjusted, but not for/during animation purposes).

 

Assuming the animations are properly built, the only thing remaining is to change stategraph to load them instead of default ones when certain conditions are met (e.g. "run_loop" state and/or start/end in case of OP) and load the anim file just as you would load any other, i.e.
    Asset( "ANIM", "anim/fa_player_anims.zip" )

Since the bank is named wilson, the animations would be just added to the existing wilson anims, and available to be called as usual.

 

As to when and after how much time we respond to threads, I dunno about kraken but I certainly am not watching the boards 24/7. I would say 4 months later may still be worth it to the people that come after, or are still interested. And don't worry so much about being wrong, it happens to the best of us.

Link to comment
Share on other sites

Ugh, you make me write a wall of text that noone will find readable, let alone useful... you've been warned, read at your own risk, I suck at explaining.

The cheerio's custom animation template is the base idea, yet incomplete for people that don't understand underlying logic. To have proper custom animation that runs on every character you need to add the override symbols, as well as all the missing symbols that belong to other characters than wilson. To have proper custom animation that works on your character alone, you still need to add overrides and missing symbols that don't exist on wilson's template.

Obviously, you could add extra symbols too, as long as you add them to your build as well, but they would be seen just on your new animation. The images you can use for making those animations have to exist on a player build that the animation is referencing/running on, so you'd have to add them to your character build file.

About a year ago, maybe a bit less, I've done the full template for DS (no DST symbols/links, it's easy to add them, I just couldn't justify spending time and memory on something I don't use) without the tail symbols placed (since I don't use them, and decompiler didn't export them 100% correctly IIRC, you can add them but will likely need tuning). swap_face and hairfront are not used anywhere as far as I know, not even properly animated on default animations, so I didn't bother with actually placing them. It's possible I mixed some layers and/or have fixed some stuff since, but I'll crosslink it here because that's what I have uploaded that doesn't require you to download 600mb git and hunt it down.

Monks attacks and whirlwind of hitd are the proof it does work and it works independent on character build (as well as a bunch of other stuff that's not live, like sneaking, zombie animations, instruments and what not on dev build). Alternatively, the file itself comes with a pluggable proof of concept scml (player_anims).

attachicon.gifplayer.zip

There's another problem, layer names need to be maintained/converted and modtools doesn't have support for that. I've mentioned before why that's the problem, as well as my way to fix it. The example expects that approach to work, otherwise show/hide layers wont work.

Main thing to note tho, is that you're calling on anim.bin, the build/atlas files that modtools would export are being ignored and should be just deleted from the output zip file for the sake of space if anything. I have used 'real' objects instead of placeholders for swaps cause I find it crazy to try to animate dots, but they are just placeholders. As such, pivots should never be changed as the pivots that game would use are those that belong to the original build.bin not the ones you set in spriter animation (unless the template is mistaken about their values and they need to be readjusted, but not for/during animation purposes).

Assuming the animations are properly built, the only thing remaining is to change stategraph to load them instead of default ones when certain conditions are met (e.g. "run_loop" state and/or start/end in case of OP) and load the anim file just as you would load any other, i.e.

Asset( "ANIM", "anim/fa_player_anims.zip" )

Since the bank is named wilson, the animations would be just added to the existing wilson anims, and available to be called as usual.

As to when and after how much time we respond to threads, I dunno about kraken but I certainly am not watching the boards 24/7. I would say 4 months later may still be worth it to the people that come after, or are still interested. And don't worry so much about being wrong, it happens to the best of us.

So what your saying is, yes? It can be done? If so, I could use your help, after I read your text and give it a go. Would you mind if I pm'd you? I wanted to have a different face on my character during the run loop, but I am not confident I have the lua magic skill to do so.

Link to comment
Share on other sites

So what your saying is, yes? It can be done? If so, I could use your help, after I read your text and give it a go. Would you mind if I pm'd you? I wanted to have a different face on my character during the run loop, but I am not confident I have the lua magic skill to do so.

 

If the only thing you want to do is replace the face while running, I would say the easiest way to do it would be to make a file with the new char build (well, just face directory of a normal char build really), and then add anim:OverrideSymbol("face",facebuildname,"face") in stategraph for entering run loop state, and the same with original (non-running) build name on exit. Way less hassle.

 

Only if you want to entirely rewrite the run animation, then you'd need to make full custom animation.

Link to comment
Share on other sites

If the only thing you want to do is replace the face while running, I would say the easiest way to do it would be to make a file with the new char build (well, just face directory of a normal char build really), and then add anim:OverrideSymbol("face",facebuildname,"face") in stategraph for entering run loop state, and the same with original (non-running) build name on exit. Way less hassle.

 

An entire file? or just a new in the face file? (like face 31) or would that not work? 

So it should be something, during developement, like exported/altface/face30.png 

then in the stategraph 

anim:OverrideSymbol("face",face30,"face" ? like that? 

 

or do you mean the actual buildname of the charecter?

 

Sorry im so daft, scripting isnt my strongpoint. 

 

And thank you so much for the reply. I appreciate your work!

Link to comment
Share on other sites

An entire file? or just a new in the face file? (like face 31) or would that not work? 

So it should be something, during developement, like exported/altface/face30.png 

then in the stategraph 

anim:OverrideSymbol("face",face30,"face" ? like that? 

 

or do you mean the actual buildname of the charecter?

 

Sorry im so daft, scripting isnt my strongpoint. 

 

And thank you so much for the reply. I appreciate your work!

 

Sorry for being late, ran into some hardware issues.

 

You would need to use spriter file with all the face 'frames' that the regular character build has, that would be the directory structure similar to the sample character templates. E.g.

 

-->face

-----face-0.png

-----....

-----face-13.png

face30.scml

 

with face30.scml referencing all the png files in order. (filenames don't matter, the order is the only thing that matters, but keeping it simple for the sake of example). The actual animation doesn't matter, as the only thing build would read are face 'frames'. Also you wouldnt necesarily need all frames, but I don't know exactly which frames is walking/running referencing, so its safer to just replace all.

 

Then you'd use autocompiler to make the anim.zip, and load the anim the same way as every other in prefab or modmain asset block.

 

I know I had some better explanation on how overrides work but I can't find it. But basically, OverrideSymbol arguments are: original animation symbol name (that you're trying to replace), build name (of a build you will pull the symbol that you want to put in the original one's place from), symbol name of replacement (that is the name of the symbol as defined in the build you supplied as 2nd argument = directory name in the scml file above, "face"), all strings. So in this case,

inst.AnimState:OverrideSymbol("face", "face30", "face") 

 

You should be able to use ClearOverrideSymbol("face") to get the normal face back on once you don't need it anymore.

Link to comment
Share on other sites

Sorry for being late, ran into some hardware issues.

 

You would need to use spriter file with all the face 'frames' that the regular character build has, that would be the directory structure similar to the sample character templates. E.g.

 

-->face

-----face-0.png

-----....

-----face-13.png

face30.scml

 

with face30.scml referencing all the png files in order. (filenames don't matter, the order is the only thing that matters, but keeping it simple for the sake of example). The actual animation doesn't matter, as the only thing build would read are face 'frames'. Also you wouldnt necesarily need all frames, but I don't know exactly which frames is walking/running referencing, so its safer to just replace all.

 

Then you'd use autocompiler to make the anim.zip, and load the anim the same way as every other in prefab or modmain asset block.

 

I know I had some better explanation on how overrides work but I can't find it. But basically, OverrideSymbol arguments are: original animation symbol name (that you're trying to replace), build name (of a build you will pull the symbol that you want to put in the original one's place from), symbol name of replacement (that is the name of the symbol as defined in the build you supplied as 2nd argument = directory name in the scml file above, "face"), all strings. So in this case,

inst.AnimState:OverrideSymbol("face", "face30", "face") 

 

You should be able to use ClearOverrideSymbol("face") to get the normal face back on once you don't need it anymore.

 

Thank you for the reply, I really appreciate the help. I don't have the greatest comprehension skills when it comes to scripting, so it may take me a few times to get it right. I'm just glad It's possible to do something like this.  

 

Off topic, If you know any Spriter gurus out there, please have them send me a pm, I have a snag. Completely unrelated.  I dont want to take it any farther off topic then I have to.  But i'm in a jam.

Link to comment
Share on other sites

Thank you for the reply, I really appreciate the help. I don't have the greatest comprehension skills when it comes to scripting, so it may take me a few times to get it right. I'm just glad It's possible to do something like this.  

 

Off topic, If you know any Spriter gurus out there, please have them send me a pm, I have a snag. Completely unrelated.  I dont want to take it any farther off topic then I have to.  But i'm in a jam.

 

No problem. As for Spriter, I'm afraid I'm not an animator, I can try to help with modtools bugs or otherwise unimplemented features of spriter->game engine conversions, but otherwise I'm useless.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...