How do I define a custom key action?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

How do I define a custom key action?

Post by Anakin »

Hi,

just wanted to discuss about the possiblity to define an own key action. So for example if i play g the player makes a special attack.
It would be also ok if i overwrite an existing key. So lets say if you press Q you don't focus the next enemy, but you throw a grenade. But I don't want to change the right mouse klick to the key Q.

So if the secondary Attack is a grenade, i want to use the vibro attack everytime you press Q.

Is there a way to do this??
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: define own key action

Post by nobody3 »

might be just me but I dont get your question.. you want to map grenade to key Q but dont want to map it?
User avatar
Kingpin
Jedi
Jedi
Posts: 1096
Joined: Fri Sep 13, 2013 7:09 pm
Projects :: The Sith Wars II
Location: Denver, CO
Contact:

Re: define own key action

Post by Kingpin »

He wants to add a new function; by pressing Q, for example, adds a new attack of a melee. I would recommend that you just make it a secondary, change your secondary key to Q.

EDIT: Genius idea. I think you would have to make a new set of animations because normal units don't have block (heroes do). I know the XBox DLC Asajj Ventress has a block that deals damage. Maybe if you set up a block using the "F" key, then it will deal damage. Again, I am not sure how complicated this is, just an idea.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: define own key action

Post by MileHighGuy »

Kingpin wrote:He wants to add a new function; by pressing Q, for example, adds a new attack of a melee. I would recommend that you just make it a secondary, change your secondary key to Q.

EDIT: Genius idea. I think you would have to make a new set of animations because normal units don't have block (heroes do). I know the XBox DLC Asajj Ventress has a block that deals damage. Maybe if you set up a block using the "F" key, then it will deal damage. Again, I am not sure how complicated this is, just an idea.
That works with melee weapons because they use a combo file. You can assaign "states" to the 2(?) mouse keys and f in the combo. It would not work with normal weapons.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: define own key action

Post by Anakin »

mh ok i want to add the vibro attack to the key. But it's not a melee weapon, after i want it to work in the first perspective.
User avatar
Kingpin
Jedi
Jedi
Posts: 1096
Joined: Fri Sep 13, 2013 7:09 pm
Projects :: The Sith Wars II
Location: Denver, CO
Contact:

Re: define own key action

Post by Kingpin »

In BFX, they used the throw grenade animation, so it could work in first person. But, I still don't know if you can assign that to a certain key. Maybe you should look in the BF2 Limitations.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: define own key action

Post by Anakin »

mh. i also use the throw animation. But can i make a melee weapon without a combo file??

I think i'll have a look at this topic later. I'm not sure i'll add this to the RC mod
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: define own key action

Post by MileHighGuy »

You can just make it a short range projectile with the grenade throw animation (or whatever animation you choose). That's how a lot of mods do it.
User avatar
Kingpin
Jedi
Jedi
Posts: 1096
Joined: Fri Sep 13, 2013 7:09 pm
Projects :: The Sith Wars II
Location: Denver, CO
Contact:

Re: define own key action

Post by Kingpin »

But still, how do you define a key for that?
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: define own key action

Post by MileHighGuy »

you can't. it's either the secondary or primary weapon.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: define own key action

Post by [RDH]Zerted »

If you know how to create or edit IFS screens you can make invisible buttons and give them shortcut keys, but that'll only let you trigger Lua changeable things. There are ScriptCB functions that let you redefine keys, such as changing crouch to G, but I don't know of a way to create entirely new unit actions. However, I don't think the player will like you redefining their keys.

...especially if you make a region in the map that randomizes the player's controls :runaway:
LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Re: define own key action

Post by LRKfm946 »

[RDH]Zerted wrote:...especially if you make a region in the map that randomizes the player's controls :runaway:
That would be so evil but hilarious :funny2:
Post Reply