HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: How to make your character Walk Run  (Read 1625 times)

grogbro

  • World Owners
  • ****
  • Posts: 117
  • ZOMBIES! YAY! RUN!!
    • View Profile
    • My Portfolio
How to make your character Walk Run
« on: Oct 09, 12, 09:18:02 PM »

(still editing this)

This is a quickie tutorial on how to make your character Walk & Run. I know there are other threads talking about this subject but I was very happy when I finally got this working so I wanted to share in case anyone else has similar issues.

Hero Engine does a nice blending of your Walk and Run, called WalkRun. At least that's what its called in existing examples so why change it. WalkRun as far as I know takes your Walk animation and Run animation and blends them together depending on whether you are holding shift or not. It's pretty cool.

This example uses the Monkeytok .AAS example which I have been told is the easiest .AAS to start with. If you are not sure what the .AAS is, check out the Wiki. Things you need:

  • I am using 3dsMax but as long as you already have a functioning character, idling in-game you should be set.
  • character mesh rigged/weighted to the Hero Engine skeleton example. I used the example rig provided in the HEExampleArt that is downloadable. File: character_sample_dynamic.max
  • your character already 'works' with the monkeytok.aas, and possibly has its idle animation working (just so we can make sure its actually working and you have all of your files situated)
  • A walk animation exported called walk (all of my animations sit in the Animation folder)
  • A run animation exported called run
  • make sure you have .ASQ files for both the run and walk animations. I actually copied my idle.asq that the character tools made for me and changed the name and settings for the walk.asq and run.asq
.

So first off. There is an example of a walkrun.asq that comes with all of your content examples. I grabbed mine from the Animations folder. If you dont have it, it looks similar to this:

Code: [Select]
!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Speed Blend
    .SequenceA=walk
    .SequenceB=run
    .SpeedController=Speed
    .LowSpeedA=0
    .HighSpeedA=.4
    .LowSpeedB=.4
    .HighSpeedB=1
    .SequenceAFeedbackName=Feedback_WalkSpeed
    .SequenceBFeedbackName=Feedback_RunSpeed


Note: I've already edited the example above where it says walk and run. It used to have 'walk_male' and 'run_male'. But, my animations are just walk and run so I changed them accordingly.

Create the walkrun.asq file (or copy it and edit) and put it in your Animation folder for your character. Make sure walk.asq/walk.hgm and run.asq/run.hgm are there as well.

Next go to your .AAS file, which you've hopefully already renamed to something appropriate to your character. Although, I don't think it matters as long as you call to the right .aas file in your main .dat file. (the .dat should live in your character root folder(but the ANIMATION.dat lives in your Animation folder)). In your .aas file look for this code:

Code: [Select]
  {   
    when MoveDirection {
    is Forward:
          when MoveType {
is Normal:
anim "walkrun"
          DEFAULT:
            anim "walkrun"
          }

Note: I am sure this is not exact as we've edited this code, but you should find something similar. There are also examples of this in the bipedagent.aas

Previously we just had 'walk' where it says 'walkrun' and he only would walk. Now the animations blend depending on whether you are holding shift or not. And the run is a bit faster. All of that can be adjusted.

I hope this helps someone. I realize this is a very basic tutorial by now. Sorry for the bad code pastes! Please correct me on those if I have them wrong.

EDIT: the shift key makes the run faster and holding control makes him walk. Although you can switch all of this around to suit your game. I am going to try to get it so you dont need control and when you just move forward he walks, and runs when you hold Shift.
« Last Edit: Oct 10, 12, 08:44:36 PM by grogbro »
Logged

SOULSSAGA

  • World Owners
  • ****
  • Posts: 5
  • THE SOULS SAGA - HERO JOURNEY ADMIN
    • View Profile
    • SOULS SAGA
Re: How to make your character Walk Run
« Reply #1 on: Feb 22, 13, 08:28:52 AM »

Hy !

THANK YOU DEEPLY SO MUCH FOR THIS AWSOME TUTTORIAL !! I was reaaly looking for this ...

Now a personal question:

- HOW CAN WE CUSTOMIZE THIS TO BE 4 STATES Using 4 Animations & 3 Buttons :

1 - Walk
2 - Run
3 - HyperSpeed / With MEga Jumps Conected ..
4 - Fly ! With Less Gravity Included...


???
...
Realy needing That kind of Thing For my 1Man Army Powered Mmo Called SOULS SAGA ... : - )

THANK YOU DEEPLY SO MUCH !!!

SILVA DINISSOULS SAGA
Logged

THE SOULS SHINE ONLINE | OPEN DEVELOPMENT INTERACTIVE UNIVERSE | http://WWW.SOULSSAGA.ORG/3DDEV

grogbro

  • World Owners
  • ****
  • Posts: 117
  • ZOMBIES! YAY! RUN!!
    • View Profile
    • My Portfolio
Re: How to make your character Walk Run
« Reply #2 on: Feb 24, 13, 02:15:55 PM »

Hi Soulssaga! I barely got the walk/run to work never mind all the things you want to accomplish. ;)  I am sorry I can't help you more on this. I am sure it's possible and a coder/scripter would most likely be able to help you out. As well as an animator ;)

Thazager

  • General Accounts
  • *
  • Posts: 1137
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: How to make your character Walk Run
« Reply #3 on: Feb 24, 13, 07:17:53 PM »

1 - Walk
2 - Run
3 - HyperSpeed / With MEga Jumps Conected ..
4 - Fly ! With Less Gravity Included...

Parts of these are in the Hero Engine already. By looking at the gamekeybindings.ini file in the repository, one can find which keys are asigned to which functions.

Shift key is used for running.
Control is used for walking.
Backspace is for autoforward.

In the clientside controller code E_ACCControllerClassMethods, do a search for skippy.
In one section is the value for fast running. By changing the conditions from if mychar = Skippy:GetMe() to your checking, you can use the same speed = runspeed * 5.

We also have basic forms of mega jumps and fly in place, and still working on these. Though we do not have any animations yet.
Logged