HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 2 [3]

Author Topic: Static Characters as Player Controlled  (Read 4295 times)

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: Static Characters as Player Controlled
« Reply #30 on: Mar 13, 16, 10:15:57 PM »

yeah, currently you dont have an option for landing, so you'll need to add that and then do


Try the following for the .aas


Quote
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Prone, Dead, Sitting, Kneeling, Alive, Climbing
  OverridePosture = None, Jumping, Falling, Dead, Knockback, ResurrectTarget, Landing
  MoveType = Normal
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable AlreadyTurning =  True, False
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backward
}

action Default
{
set(1) AnimAllBody
{
   when OverridePosture {
   
     is Jumping:
       // NOTE: This is also done in a transition above
       //anim "jump"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
       change OverridePosture to Falling
       //stop
     is Falling:
       //anim "fall_loop"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
      Change OverridePosture to Landing
       //stop
     is Landing:
       //anim "fall_landing"
       //blend .1
       //hold .5
       //looping false
       change OverridePosture to None
       //stop
   }
when BasePosture {
      is Idle:
        when MoveType {
        is Swim:
          //anim "swim_idle"
        DEFAULT:
        anim "idle"
        align False
        blend 0.25
        hold 0.25 seconds recycle
        looping True
        change AlreadyTurning to False
        change CurrentMotion to Idle
       
        }
       

    is Turning:
         when TurnDirection {
         is Right:
         when TurnAmount {
          is T45Degrees:
            anim "T45Right"
          is T90Degrees:
            anim "T90Right"
          is T135Degrees:
            anim "T135Right"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningRight
         is Left:
          when TurnAmount {
          is T45Degrees:
            anim "T45Left"
          is T90Degrees:
            anim "T90Left"
          is T135Degrees:
            anim "T135Left"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningLeft
         }
         hold 1.0
         if (AlreadyTurning = True) {
         align True   
         }
         else {   
         blend 0.1
         align False
         }
         looping False
         change AlreadyTurning to True
      is Dead:
        //anim "dead"
      is Moving:
        when MoveDirection {
        is Forward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
         anim "Forward"
          }
          blend 0 
          hold 0 seconds
          change CurrentMotion to Forward
        is Backward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
            anim "Backward"
          }
          blend 0.25
          hold 0.25 seconds 
          change CurrentMotion to Backward 
        }
        looping True
        change AlreadyTurning to False
      }
}
}


dont worry too much about those animations at the moment but that will set the override posture which is set by the Engine if you jump/fall/land etc.

"Should" stop the falling

Yallia

  • General Accounts
  • *
  • Posts: 19
    • View Profile
Re: Static Characters as Player Controlled
« Reply #31 on: Mar 15, 16, 01:32:57 PM »

That .aas won't compile, the errors are:

not a 'variable' input referring to OverridePosture
and Enum Swim not found.

I added swim and tried putting variable OverridePosture but it still throws the same errors, so I'm a bit confused. Is there some reason the .aas wouldn't be updating in Heroblade and it's holding on to a previous version? I've tried uploading it while exited out of HeroBlade then opening Heroblade just to make sure it wasn't something weird with the dynamic updating. Here is the .aas:

Code: [Select]
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Prone, Dead, Sitting, Kneeling, Alive, Climbing
  MoveType = Normal, Swim
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable AlreadyTurning =  True, False
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backward
  variable OverridePosture = None, Jumping, Falling, Dead, Knockback, ResurrectTarget, Landing
}

action Default
{
set(1) AnimAllBody
{
   when OverridePosture {
   
     is Jumping:
       // NOTE: This is also done in a transition above
       //anim "jump"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
       change OverridePosture to Falling
       //stop
     is Falling:
       //anim "fall_loop"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
      change OverridePosture to Landing
       //stop
     is Landing:
       //anim "fall_landing"
       //blend .1
       //hold .5
       //looping false
       change OverridePosture to None
       //stop
   }
when BasePosture {
      is Idle:
        when MoveType {
        is Swim:
          //anim "swim_idle"
        DEFAULT:
        anim "idle"
        align False
        blend 0.25
        hold 0.25 seconds recycle
        looping True
        change AlreadyTurning to False
        change CurrentMotion to Idle
       
        }
       

    is Turning:
         when TurnDirection {
         is Right:
         when TurnAmount {
          is T45Degrees:
            anim "T45Right"
          is T90Degrees:
            anim "T90Right"
          is T135Degrees:
            anim "T135Right"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningRight
         is Left:
          when TurnAmount {
          is T45Degrees:
            anim "T45Left"
          is T90Degrees:
            anim "T90Left"
          is T135Degrees:
            anim "T135Left"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningLeft
         }
         hold 1.0
         if (AlreadyTurning = True) {
         align True   
         }
         else {   
         blend 0.1
         align False
         }
         looping False
         change AlreadyTurning to True
      is Dead:
        //anim "dead"
      is Moving:
        when MoveDirection {
        is Forward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
         anim "Forward"
          }
          blend 0 
          hold 0 seconds
          change CurrentMotion to Forward
        is Backward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
            anim "Backward"
          }
          blend 0.25
          hold 0.25 seconds 
          change CurrentMotion to Backward 
        }
        looping True
        change AlreadyTurning to False
      }
}
}
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: Static Characters as Player Controlled
« Reply #32 on: Mar 15, 16, 01:45:14 PM »

yes, you've removed OverridePosture as an input, thats a required input for HE.

OverridePosture isnt a variable but an expected Input (notice where i added it below) :)

for your swim, uncomment the portion of code for swim (where its commented) and
insert the name of your swim animation instead.

Use the following:

Quote
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Prone, Dead, Sitting, Kneeling, Alive, Climbing
  OverridePosture = None, Jumping, Falling, Dead, Knockback, ResurrectTarget, Landing
  MoveType = Normal, Swim
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable AlreadyTurning =  True, False
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backward
}

action Default
{
set(1) AnimAllBody
{
   when OverridePosture {
   
     is Jumping:
       // NOTE: This is also done in a transition above
       //anim "jump"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
       change OverridePosture to Falling
       //stop
     is Falling:
       //anim "fall_loop"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
      change OverridePosture to Landing
       //stop
     is Landing:
       //anim "fall_landing"
       //blend .1
       //hold .5
       //looping false
       change OverridePosture to None
       //stop
   }
when BasePosture {
      is Idle:
        when MoveType {
        is Swim:
          //anim "swim_idle"
        DEFAULT:
        anim "idle"
        align False
        blend 0.25
        hold 0.25 seconds recycle
        looping True
        change AlreadyTurning to False
        change CurrentMotion to Idle
       
        }
       

    is Turning:
         when TurnDirection {
         is Right:
         when TurnAmount {
          is T45Degrees:
            anim "T45Right"
          is T90Degrees:
            anim "T90Right"
          is T135Degrees:
            anim "T135Right"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningRight
         is Left:
          when TurnAmount {
          is T45Degrees:
            anim "T45Left"
          is T90Degrees:
            anim "T90Left"
          is T135Degrees:
            anim "T135Left"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningLeft
         }
         hold 1.0
         if (AlreadyTurning = True) {
         align True   
         }
         else {   
         blend 0.1
         align False
         }
         looping False
         change AlreadyTurning to True
      is Dead:
        //anim "dead"
      is Moving:
        when MoveDirection {
        is Forward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
         anim "Forward"
          }
          blend 0
          hold 0 seconds
          change CurrentMotion to Forward
        is Backward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
            anim "Backward"
          }
          blend 0.25
          hold 0.25 seconds
          change CurrentMotion to Backward
        }
        looping True
        change AlreadyTurning to False
      }
}
}

Yallia

  • General Accounts
  • *
  • Posts: 19
    • View Profile
Re: Static Characters as Player Controlled
« Reply #33 on: Mar 15, 16, 02:26:54 PM »

OverridePosture = None, Jumping, Falling, Dead, Knockback, ResurrectTarget, Landing

still throws the error: not a 'variable' input for the lines with change OverridePosture to Something.

Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: Static Characters as Player Controlled
« Reply #34 on: Mar 15, 16, 02:35:39 PM »

EDIT: Opps i added a few custom values to overridePosture :) removed them

you are correct!  It is actually a variable and not an input.

I'll make sure to make that change in the tut as well.

you had it right in the last posted .aas file you quoted.

The following should work:


Quote
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Dead
  MoveType = Normal, Swim
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable OverridePosture = None, Jumping, Falling, Landing, Dead
  variable AlreadyTurning =  True, False
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backward
}

action Default
{
set(1) AnimAllBody
{
   when OverridePosture {
   
     is Jumping:
       // NOTE: This is also done in a transition above
       //anim "jump"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
       change OverridePosture to Falling
       //stop
     is Falling:
       //anim "fall_loop"
       //blend .025
       //hold 1
       //looping false
       //FreezeLastSequence true
      change OverridePosture to Landing
       //stop
     is Landing:
       //anim "fall_landing"
       //blend .1
       //hold .5
       //looping false
       change OverridePosture to None
       //stop
   }
when BasePosture {
      is Idle:
        when MoveType {
        is Swim:
          //anim "swim_idle"
        DEFAULT:
        anim "idle"
        align False
        blend 0.25
        hold 0.25 seconds recycle
        looping True
        change AlreadyTurning to False
        change CurrentMotion to Idle
       
        }
       

    is Turning:
         when TurnDirection {
         is Right:
         when TurnAmount {
          is T45Degrees:
            anim "T45Right"
          is T90Degrees:
            anim "T90Right"
          is T135Degrees:
            anim "T135Right"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningRight
         is Left:
          when TurnAmount {
          is T45Degrees:
            anim "T45Left"
          is T90Degrees:
            anim "T90Left"
          is T135Degrees:
            anim "T135Left"
          is T180Degrees:
            anim "T180Left"
          }
          change CurrentMotion to TurningLeft
         }
         hold 1.0
         if (AlreadyTurning = True) {
         align True   
         }
         else {   
         blend 0.1
         align False
         }
         looping False
         change AlreadyTurning to True
      is Dead:
        //anim "dead"
      is Moving:
        when MoveDirection {
        is Forward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
         anim "Forward"
          }
          blend 0
          hold 0 seconds
          change CurrentMotion to Forward
        is Backward:
          when MoveType {
          is Swim:
            //anim "swim"
          DEFAULT:
            anim "Backward"
          }
          blend 0.25
          hold 0.25 seconds
          change CurrentMotion to Backward
        }
        looping True
        change AlreadyTurning to False
      }
}
}
« Last Edit: Mar 15, 16, 02:37:51 PM by ToY-Krun »
Logged
Pages: 1 2 [3]