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

Author Topic: Character Behave Commands  (Read 4516 times)

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Character Behave Commands
« on: Sep 28, 13, 12:10:33 AM »

Hi All,

Another newbie question / request for help :) .

After doing the quick (and helpful tut), "Tutorial Exercise," at the bottom of the wiki page, 'Character Behave Commands' (http://wiki.heroengine.com/wiki/Character_Behave_Commands), I was hoping to test more animations on the character using that method.  Very fun to see the character swimming around in the Fantasy Lowlands  :D .

I attempted some guessing at other 'inputs' for getting other animations to run ( "combat_idle_crit," "combat_impact," "combat_slicer," "drink_potion," "emote_femaledance," etc.) using; 

input BaseMode Combat ,
input BaseMode Combat combat_idle_crit,
input BaseMode combat_idle_crit,
Input EmoteMode Dance,

Obviously bad guesses  ;D   

The page does list common Behave commands, and it mentions,
"input BaseMode Combat"        // Note that this is an HJ-only mode"

Being an artist/animator new to scripting & Hero, I was hoping someone more skilled at understanding the Behave commands might list other 'inputs' that would get the other animations to play   ?

Thank You for any help or advice, I appreciate it  :)
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Character Behave Commands
« Reply #1 on: Sep 28, 13, 12:22:12 AM »

There are few examples of anims here https://community.heroengine.com/forums/index.php/topic,4270.0.html
I pulled these from the HE editor before it was changed/updated.

Code: [Select]
  // emotes
  if args.value == "chat"
    meNode["Behave"] = "input BasePosture Idle"       // clear old
    meNode["Behave"] = "input IdleType Conversation"
  .
  if args.value == "dance"
    meNode["Behave"] = "input BasePosture Idle"       // clear old
    meNode["Behave"] = "input IdleType Normal"        // clear old
    meNode["Behave"] = "input Emote FemaleDance"
  .
  if args.value == "sleep"
    meNode["Behave"] = "input BasePosture Idle"       // clear old
    meNode["Behave"] = "input IdleType Dead"
  .
  if args.value == "stun"
    meNode["Behave"] = "input IdleType Normal"        // clear old
    meNode["Behave"] = "input BasePosture Paralyzed"
  .
  if args.value == "wave"
    meNode["Behave"] = "input BasePosture Idle"       // clear old
    meNode["Behave"] = "input IdleType Normal"        // clear old
    meNode["Behave"] = "input Special Wave"
  .
Logged

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Re: Character Behave Commands
« Reply #2 on: Sep 28, 13, 12:34:17 AM »

Outstanding, Thank You Thazager !
I appreciate it :)
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Character Behave Commands
« Reply #3 on: Sep 28, 13, 11:59:15 AM »

if you open the animator tool, select the main character, you can look at all the possibly animations for that character.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Character Behave Commands
« Reply #4 on: Sep 28, 13, 12:08:43 PM »

For a given character specification, the input options for BaseMode (and other inputs) are defined in the AAS file for that character.  In the DAT file for a character is where it specifies which AAS file that character uses. So different characters can and often do share the same AAS.

You can open and edit the DAT, AAS, and ASQ files in any text editor; I like to use Notepad++ with it customized to hightlight pretty well for those files.

See here for more details on AAS files.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Character Behave Commands
« Reply #5 on: Sep 28, 13, 12:18:21 PM »

A note on the str() function that is mentioned at the bottom of that page.  We have found through experimentation that the first argument must be a string and the second must be the name of an input.  It does not seem to work with any other combination of arguments.

But we were able to concatenate two inputs using this form:
str(str("", BaseMode), ImpactHit)

Since str needs the first argument to be a string and str() returns a string, we first use the inner str call to turn BaseMode into a string, then use the outer str() to tack value of ImpactHit onto that.


We used that technique to combine inputs such as having the basemode first followed by the impactHit.  So, for instance, we might create animations called warriorDamaged.asq and clericDamaged.asq.  That way when different impacts happen, they can vary based on the base mode.  Thus, each base mode effectively constitutes a set of common animations, such as melee, dodge, damaged, death, etc. but done in a different style from one base mode to another.  When we set the base mode, such as to warrior or cleric, we are setting which animation set that will be used.
« Last Edit: Sep 28, 13, 12:23:02 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Re: Character Behave Commands
« Reply #6 on: Sep 28, 13, 12:45:28 PM »

if you open the animator tool, select the main character, you can look at all the possibly animations for that character.
Thank You keeperofstars !  Great tool / Editor  :D
Logged

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Re: Character Behave Commands
« Reply #7 on: Sep 28, 13, 12:53:16 PM »

For a given character specification, the input options for BaseMode (and other inputs) are defined in the AAS file for that character.  In the DAT file for a character is where it specifies which AAS file that character uses. So different characters can and often do share the same AAS.

You can open and edit the DAT, AAS, and ASQ files in any text editor; I like to use Notepad++ with it customized to hightlight pretty well for those files.

See here for more details on AAS files.
Thank You ScottZarnke  :D !   Perfect, great tips, very appreciated!  I also like / use Notepad++  ;D

A note on the str() function that is mentioned at the bottom of that page.  We have found through experimentation that the first argument must be a string and the second must be the name of an input.  It does not seem to work with any other combination of arguments.

But we were able to concatenate two inputs using this form:
str(str("", BaseMode), ImpactHit)

Since str needs the first argument to be a string and str() returns a string, we first use the inner str call to turn BaseMode into a string, then use the outer str() to tack value of ImpactHit onto that.


We used that technique to combine inputs such as having the basemode first followed by the impactHit.  So, for instance, we might create animations called warriorDamaged.asq and clericDamaged.asq.  That way when different impacts happen, they can vary based on the base mode.  Thus, each base mode effectively constitutes a set of common animations, such as melee, dodge, damaged, death, etc. but done in a different style from one base mode to another.  When we set the base mode, such as to warrior or cleric, we are setting which animation set that will be used.

Thank You, outstanding tip on the str() function !!  DIG how you can have it vary based on the base mode, "When we set the base mode, such as to warrior or cleric, we are setting which animation set that will be used."  <--Great!!  Thank you for sharing, I appreciate it .
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Character Behave Commands
« Reply #8 on: Sep 28, 13, 07:03:09 PM »

When you start making your own characters / animation make sure to stop by my tutorial on the base scripts, they trim out some of the fluff, and give you just the core scripts and such you need from there you can add your custom stuff.
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Re: Character Behave Commands
« Reply #9 on: Sep 28, 13, 11:40:00 PM »

When you start making your own characters / animation make sure to stop by my tutorial on the base scripts, they trim out some of the fluff, and give you just the core scripts and such you need from there you can add your custom stuff.
Excellent, I certainly appreciate that keeperofstars :)
Do you have a link? (Pardon, it's probably very obvious, I'm very new to searching the forums / wiki / youtube channels / links, etc.).
Thank You
Logged