Thread Tools Display Modes
03-20-06, 11:56 AM   #1
takras
A Defias Bandit
Join Date: Mar 2006
Posts: 3
Shapeshifting and keybindings

One thing I've found out discord aciton bar has trouble with, is the key bindings for the different special actions; druid shapeshifting, stances and pet actions.

What I've done is to make bar 10 have the CTRL1-5 keybindings. Only problem now is for the ones using my custom files without knowing how discord works to be able to use these keybindings as default for their class.

Confused?

When a warrior hits CTRL1 he wants to go to battle stance. But when a hunter or warlock uses that keybinding they expect for the pet to attack. And since DAB can't do this in its keybindings, and the default keybinding from wow is screwed up at these actions, I thought about using scripts for Bar 10.

Here's some pseudo-code that I thought I could use:

if(class eq warrior) then
if(key eq ctrl1) setStance(1)
end

And just go on from there. Only problem is; how can I detect what key the user has pressed? I know you can use isCtrlKeyDown(), but not the specific key.

Or maybe there's a much easier way to do this?
  Reply With Quote
03-20-06, 12:14 PM   #2
Gaean
A Fallenroot Satyr
 
Gaean's Avatar
Join Date: Sep 2005
Posts: 24
Originally Posted by takras
One thing I've found out discord aciton bar has trouble with, is the key bindings for the different special actions; druid shapeshifting, stances and pet actions.

What I've done is to make bar 10 have the CTRL1-5 keybindings. Only problem now is for the ones using my custom files without knowing how discord works to be able to use these keybindings as default for their class.
I think you are seriously confusing yourself. First of all, have you been modifying your default setting or did you save a new setting (this is under dab controls, Misc. Options). If you been messing with defaults, congratulations you wrecked your chances of a clean worktable. erase and re-install or erase the scripts you made.

My hunter with the aspected mod (check here or curse-gaming.com) has Ctrl F1-F6 [Shapeshift group] set as aspects, and by default cntrl 1-0 for pet commands on the pet action bar. Messing with these in the past has caused more trouble than its worth. I suggest you unbind these in DAB controls and in game default keybindings reset to default.

You just have to know when to use dab and when to use game keybindings controls.

First when setting up dab what I did was use button control and freed all the buttons. Then on Bar 1 I set it to 12 buttons and at least 3 pages. When I had buttons on other bars some buttons mysteriously appeared on multiple bars.

Now I found it easy to change pages when I shapeshift using when shapeshift form active [bla] change to page [bla].

Start with Humanoid then bear then cat.

After that add however many buttons and bars you want.

Hope this helps, if not well read the FAQ on Discord's website :-P
  Reply With Quote
03-20-06, 12:36 PM   #3
takras
A Defias Bandit
Join Date: Mar 2006
Posts: 3
Thing is, I never set any actions for the control keys in DAB.

But I have several characters which use the special buttons, and when I log on with my druid after playing with my hunter, I have to enter the default keybinding window and set the key. And then, if I went back to play the hunter, the key bindings there were changed from my druid setting. Shouldn't been an issue in the first place.
  Reply With Quote
03-20-06, 12:48 PM   #4
lord_cat
A Defias Bandit
Join Date: Mar 2006
Posts: 3
Search in the DAB saved variables file for the ctrl-1/etc key bindings... I was having the same issue with my hunter... and every time I'd change it in the ingame keybindings and change characters/mess with dab... dab would screw the bindings up....

Apparently DAB doesn't 'unsave' the bindings when you change them in the WoW binding... so you have to delete/remove them from the saved variables lua... (just removing the line with the CTRL-1 through CTRL-5 worked for me... leaving the rest of the 'variable'/'data' intact)
  Reply With Quote
03-20-06, 03:59 PM   #5
Lozareth
An Onyxian Warder
 
Lozareth's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 366
Keybinding changes not saving have long-since been fixed in v3.1. And it was patch 1.9 that broke keybindings not saving appropriately, not DAB screwing up. 3.1 has a workaround in it for what 1.9 broke.

Bars and Floaters have OnKeybindingDown and OnKeybindingUp handlers in thier Scripts tab. The variable param will hold the button ID of the button who's keybinding was pressed. So say you had a bar who's button IDs run 1, 2, 3, 4, 5. Say Shift+1, Shift+2, Shift+3, Shift+4, and Shift+5 were bound to those buttons. When you press Shift+1 through 5, the OnKeybindingDown scripts gets run. If you press Shift+3, param will be set to 3 because that's the button ID of the button that keybinding is bound to. So checking if button 3's keybinding was pressed is as simple as:

if param == 3 then
... do something because the keybinding of button 3 was pressed ...
end

param is set to a button ID rather than the keybinding pressed or action ID because many keybindings can refer to the same button and the same action ID can be on different buttons.
__________________
High Pope of the Divine Chihuahua
http://www.discordmods.com
  Reply With Quote
03-20-06, 04:59 PM   #6
takras
A Defias Bandit
Join Date: Mar 2006
Posts: 3
Guess I could make floaters for each of the actions then, since I don't know the lua code in wow api to check what key you are pressing.

This is what I have for the first floater:

Code:
-- Battle Stance, Bear Form, Pet Attack, Rogue Stealth --

local lokalKlasse, Klasse = UnitClass("player");

if(Klasse == 'WARRIOR') then
 CastShapeshiftForm(1);
 DAB_Bar_SetPage(1, 1);

elseif(Klasse == 'DRUID') or (Klasse == 'ROGUE') then
 local icon, name, active, castable = GetShapeshiftFormInfo(1);

 -- Go back to caster
 if(active) then
  DAB_Bar_SetPage(1, 1);
-- Change to Bear
 elseif(castable) then
  DAB_Bar_SetPage(1, 2);
 end;
 CastShapeshiftForm(1);

elseif(Klasse == 'HUNTER') or (Klasse=='WARLOCK') then
 PetAttack();
end;
It's not optimal if there's lag in the picture, but it works. However, is there a function that removes the action from a floater? Just in case there are some actions on these floaters which aren't supposed to be used for other than the scripting.

Last edited by takras : 03-20-06 at 06:46 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » Shapeshifting and keybindings


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off