Go Back   Warhammer Forums > Gameplay Forums > UI Discussion

Reply
 
Thread Tools Display Modes
Old 09-09-2008, 05:57 AM   #1
FuriousGuy
WAR Soldier
 
 
Join Date: Aug 2008
Career: Undecided
Server: Undecided
PlanB - Swordmaster/BlackOrc Hotbar Page Swapper

Well, after much screwing around, I've got a working mod that updates the main hotbar page whenever your balance/plan state changes. I called it Planned Balance, or PlanB for short. You can download it here:

http://war.curse.com/downloads/details/13638/

You must also download and install the LibSlash mod (version 2.1 or later), which you can get here:

http://war.curse.com/downloads/details/13510/


INSTALLATION INSTRUCTIONS
  1. Download both PlanB and LibSlash from Curse (see links above).
  2. Create a folder called Interface in the WAR game folder.
  3. Create a folder called AddOns inside the Interface folder you created in step 2.
  4. Unzip the contents of the PlanB zipfile that you downloaded into the WAR/Interface/AddOns folder.
  5. Unzip the contents of the LibSlash zipfile that you downloaded into the WAR/Interface/AddOns folder.
As of 2.0, PlanB no longer reports its status when you first log in or change zones. You can use the "/planb status" command to see whether it is enabled at any time, however.


Slash commands:
  • /planb - Toggles the mod on or off.
  • /planb hotbar=# - Sets which hotbar the mod will affect.
  • /planb pages=#,#,# - Sets which hotbar pages the mod will swap to for the three plan/balance states.
  • /planb pagemax=# - Sets the maximum number of hotbar pages shown on all your hotbars.
  • /planb usage - Shows list of slash commands.
  • /planb status - Shows active hotbar and hotbar pages for each balance state.
  • /planb silent - Turns on/off the chat window notification when you do the /planb command (I added this so you could use the command in a macro without filling your chat window with spam).
Other stuff you should know:
  • The mod will only work if you are playing a Swordmaster or Black Orc. You can toggle it on or off regardless of class using the /planb command.
  • To create a macro to turn PlanB on or off, set the macro text to: /script slash("planb")
Post here if you have any problems with it! Special thanks to Dorgudurk for a major code overhaul in version 2.0!

Edit: Version 2.1 changes.

Last edited by FuriousGuy; 10-11-2008 at 02:57 AM..
FuriousGuy is offline   Reply With Quote
Old 09-09-2008, 07:18 AM   #2
Dashel
WAR Veteran
 
Dashel's Avatar
Definitely will try this when I get to working on a Black Orc. Thanks.
Dashel is offline   Reply With Quote
Old 09-09-2008, 08:43 AM   #3
khalid
WAR Soldier
 
khalid's Avatar
 
Join Date: Sep 2008
Career: A White Lion
Server: Eerie Downs
Guild: Hate
First of all, great work, there is great need for a mod like this!

I was actually looking to code a mod like this myself, so I was looking at different functions, so let me comment a bit after looking at your code. Please do not take offense, just trying to help.


I notice that you are using CareerResourceData:GetCurrent() to tell what "stance" you are in. As you say in your post, the problem with this is that this function also will detect you in stances when using other classes. For example, on BW it would use your combustion as this number.

However, looking at the WarWiki Api there is a function called...

Swordmaster_GetPointsString(self) which you can compare to

StringTables.Default.LABEL_SWORD_MASTER_IMPROVED_B ALANCE
and
StringTables.Default.LABEL_SWORD_MASTER_PERFECT_BA LANCE

to see what stance you are in.

No idea if this works for Black Orcs, but if it did, that would be a way to not get it to mess with other classes.


Though looking at your code, probably would be alot easier just to turn it off if you arent on a SM or BO. At least no string comparisons that way.
khalid is offline   Reply With Quote
Old 09-09-2008, 12:19 PM   #4
FuriousGuy
WAR Soldier
 
 
Join Date: Aug 2008
Career: Undecided
Server: Undecided
If I can't find a function that gives the career directly, I might end up doing just what you suggest. There is a function called CareerResource.GetActiveCareerLine which might give me what I want; I won't know until I play around with it tonight. I figured out what I needed to do with the current version of the mod mostly by trial and error, and combing through other functions on the API wiki to see what functions they were calling.

I don't mind constructive criticism at all by the way; I need all the help I can get with this stuff!
FuriousGuy is offline   Reply With Quote
Old 09-09-2008, 12:33 PM   #5
Aiiane
Alliance Champion
 
Aiiane's Avatar
 
Join Date: Aug 2008
Career: Undecided
Btw FuriousGuy, the event handler for the career_resource_updated event actually gets passed two arguments - the first is the old value for the resource and the second is the new value. You could just accept those arguments with your handler function and then not have to poll the CareerResource object to get the value.

(See my Mechanic mod for an example of accepting the arguments if you want.)
__________________
#waruidev @ irc.freenode.net | WAR Addon FAQ | WAR API Reference (on TheWarWiki) | WAR Addons @ Curse.com
Aiiane is offline   Reply With Quote
Old 09-09-2008, 02:02 PM   #6
FuriousGuy
WAR Soldier
 
 
Join Date: Aug 2008
Career: Undecided
Server: Undecided
Ahh, I did not know that! When I get down to business tonight, I'll make that change (no sense calling more stuff than I need).

Say Aiiane, since I have you in my thread, do you know if there is a function to tell you what class the player is playing?
FuriousGuy is offline   Reply With Quote
Old 09-09-2008, 02:10 PM   #7
Aiiane
Alliance Champion
 
Aiiane's Avatar
 
Join Date: Aug 2008
Career: Undecided
It's not a function, it's just a subproperty in the GameData table:
GameData.Player.career.name

However, that value has certain control characters in it, so if you just want the actual name w/o any invisible control characters, use this:

Quote:
local career = WStringToString((GameData.Player.career.name):matc h(L"[a-zA-Z ]+"))
(for some reason the forum puts a space between matc and h, making it "matc h"... the correct function of course doesn't have a space)

That'll give you a regular string (instead of a wstring) that's just the career name, nothing else.
__________________
#waruidev @ irc.freenode.net | WAR Addon FAQ | WAR API Reference (on TheWarWiki) | WAR Addons @ Curse.com
Aiiane is offline   Reply With Quote
Old 09-09-2008, 03:10 PM   #8
khalid
WAR Soldier
 
khalid's Avatar
 
Join Date: Sep 2008
Career: A White Lion
Server: Eerie Downs
Guild: Hate
Aiiane, is there a link to exactly what is in the GameData table? I cant find very much info about it at the WarApi site. Just a few functions that use it but that is it.
khalid is offline   Reply With Quote
Old 09-09-2008, 03:33 PM   #9
Aiiane
Alliance Champion
 
Aiiane's Avatar
 
Join Date: Aug 2008
Career: Undecided
Quote:
Originally Posted by khalid View Post
Aiiane, is there a link to exactly what is in the GameData table? I cant find very much info about it at the WarApi site. Just a few functions that use it but that is it.
Haven't had a chance but at some point I'll try to get a full dump up.
__________________
#waruidev @ irc.freenode.net | WAR Addon FAQ | WAR API Reference (on TheWarWiki) | WAR Addons @ Curse.com
Aiiane is offline   Reply With Quote
Old 09-09-2008, 10:04 PM   #10
FuriousGuy
WAR Soldier
 
 
Join Date: Aug 2008
Career: Undecided
Server: Undecided
Version 1.1 is up. Now the mod doesn't activate unless you are playing SM / BO. Also cleaned up the code to get rid of that unecessary call! Thanks for the help all!
FuriousGuy is offline   Reply With Quote
Old 09-10-2008, 02:22 AM   #11
Crazyhorse
WAR Recruit
 
 
Join Date: Sep 2008
Career: A Swordmaster
Server: Beta Server
what i was searching for
you're awesome man
Crazyhorse is offline   Reply With Quote
Old 09-10-2008, 12:17 PM   #12
Fischer
WAR Soldier
 
Fischer's Avatar
 
Join Date: Aug 2008
Career: A Squig Herder
Server: Undecided
I changed the "function PlanB_SetHotbarPage" based on your entry in the comments on Cursed. What it does now is, it uses the hotbars 1, 5 & 6. Which means you will still be able to use hotbars 2-4 as normal.

BTW: What does i have to change to start PlanB automatically? Or is there any reason why you did not do that?

Quote:
-- If the mod has been turned off, don't do anything
if planBEnabled then

-- GetCurrent will be 0 for normal balance, 1 for improved balance, or 2 for perfect balance.
-- These will correspond to hotbar pages 1, 5, & 6.
local current = CareerResourceData:GetCurrent() + 4

if current < 5 then
current = current - 3
end

-- Set action bar page based on plan state
-- NOTE: First argument is which hotbar, second argument is which page!!!
SetHotbarPage(1, current)
end
return
Fischer is offline   Reply With Quote
Old 09-10-2008, 08:01 PM   #13
FuriousGuy
WAR Soldier
 
 
Join Date: Aug 2008
Career: Undecided
Server: Undecided
Version 1.2 is up. Now the user can edit the file PlanBSettings.lua to set which hotbar to flip, and which page to go to for each balance state. Hopefully that should make it a bit easier for you guys to get it to do exactly what you want.

For example, you could have some Normal and Improved Balance moves on hotbar page 1, and some Normal and Perfect Balance moves on page 2. Then, edit the settings file to use page 1 for both Normal and Improved Balance, and page 2 for Perfect. This way, you can have access to your Normal Balance moves at all times, but still re-use some keys for multiple moves.

@Fischer: PlanB should start automatically if you are playing a Swordmaster or a Black Orc. You should see a message in your chat window when you log in that says, "PlanB is now enabled." If you are playing another class, it won't turn on. If you have modified the lua file, you might want to turn on the debugging window (/debug) to see if you are getting any errors, which will cause the mod not to run. It is probably best if you get version 1.2 and just edit the settings file for the pages you want. Let me know if you are still having trouble.
FuriousGuy is offline   Reply With Quote
Old 09-10-2008, 09:03 PM   #14
Johnnyrobot
WAR Soldier
 
Johnnyrobot's Avatar
 
Join Date: May 2008
Career: Undecided
Server: Undecided
Doesnt work for me. I installed it as explained. Logged in. Nothing.
__________________

Johnnyrobot is offline   Reply With Quote
Old 09-11-2008, 05:23 AM   #15
Fischer
WAR Soldier
 
Fischer's Avatar
 
Join Date: Aug 2008
Career: A Squig Herder
Server: Undecided
Using a level 7 Black Orc nothing happened. Trying to force PlanB by /PlanB gets the following message:

"PlanB is not compatible with your current career; not enabled!"
Fischer is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

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


All times are GMT -7. The time now is 10:09 AM.