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

Author Topic: [Resolved] Assign New Command to existing Animiation  (Read 1410 times)

Aroton

  • General Accounts
  • *
  • Posts: 5
    • View Profile
[Resolved] Assign New Command to existing Animiation
« on: Sep 26, 11, 05:19:20 PM »

Hey,

This may be the wrong place for this, but, I am working with the Hero's Journey test level that came with my world. I simply want to assign the attack animation to a specific key, lets say x.

So, every time I press x, regardless of if I have an enemy targeted, I will swing.

But, I for the life of me, can not find existing scripts saying that when 1 is pressed, and you have a target, you swing. I would assume this would be in client scripts since it is an animation.

This seems like it would be so simple, but it is driving me insane!

Thanks
« Last Edit: Nov 01, 12, 09:54:16 AM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Assign New Command to existing Animiation
« Reply #1 on: Sep 26, 11, 05:41:34 PM »

There are two scripts involved.

First is the GameKeyBindings.ini script found the root of your repository.  It maps controls to particular named commands.  Initially, there are some "Hotkey" commands mapped to the first few number keys and those are the ones that are tied to playing some animations.  That script groups commands into layers, which may be activated or deactivated at-will from script.

While a layer is active, if the particular control is used by the player, the mapped command is sent to the second script involved, which is the hsl script input_command.  The actual script used to handle the commands is denoted in the ini file on a layer-by-layer basis.  Note that there are older versions of the input scripts that begin with _, but I am pretty sure it is the non-underscore ones that we are to modify, since they are the ones named in the ini file.

The input_command script then dictates what happens when any particular command is issued.  That way, you can have something happen for a command, such as "fire", and the code is agnostic as to which actual keyboard/mouse/whatever input device triggered it, allowing game function controls to be remapped.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Aroton

  • General Accounts
  • *
  • Posts: 5
    • View Profile
Re: Assign New Command to existing Animiation
« Reply #2 on: Sep 26, 11, 06:39:26 PM »

Thanks so much, exactly what I needed.
Logged