Page 1 of 1

How do I define a custom key action?

Posted: Tue Apr 01, 2014 10:46 am
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??

Re: define own key action

Posted: Tue Apr 01, 2014 2:26 pm
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?

Re: define own key action

Posted: Tue Apr 01, 2014 3:04 pm
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.

Re: define own key action

Posted: Tue Apr 01, 2014 5:28 pm
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.

Re: define own key action

Posted: Wed Apr 02, 2014 5:18 am
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.

Re: define own key action

Posted: Wed Apr 02, 2014 12:12 pm
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.

Re: define own key action

Posted: Wed Apr 02, 2014 12:32 pm
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

Re: define own key action

Posted: Wed Apr 02, 2014 5:23 pm
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.

Re: define own key action

Posted: Wed Apr 02, 2014 7:52 pm
by Kingpin
But still, how do you define a key for that?

Re: define own key action

Posted: Wed Apr 02, 2014 9:05 pm
by MileHighGuy
you can't. it's either the secondary or primary weapon.

Re: define own key action

Posted: Fri Apr 04, 2014 3:23 pm
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:

Re: define own key action

Posted: Fri Apr 04, 2014 4:08 pm
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: