changing UI for classes
dorpinch
Member Posts: 11
in BG:EE Mods
hey
I want to create a mod that gives rangers the ability to detect traps and disarm them, I can manage enabling the skills to do that (when they level up) but I figure out I also need to change their action buttons on the bottom to that of a thief so I as a player can actually use the find trap/detect illusion and disarm traps skills, and I dont know how to do it.
does anyone knows how to do it?
I want to create a mod that gives rangers the ability to detect traps and disarm them, I can manage enabling the skills to do that (when they level up) but I figure out I also need to change their action buttons on the bottom to that of a thief so I as a player can actually use the find trap/detect illusion and disarm traps skills, and I dont know how to do it.
does anyone knows how to do it?
0
Comments
Gus
I think that the rest of the buttons are hard coded (at least until Bubb finishes his magic). This one is an addon.
Gus
This would only work for the Ranger if the class can Find and Disable Traps. It can be tested however, using a Thief. You must setup hotkeys for both Thieving and Find Traps in your game's options.
This is a bit tricky and probably only use personal use at the moment, but with this in the UI.MENU, you should get Dee's Permanent Thieving button at the end of the World Action Bar. If you left click on it, you should get the standard thieving functions (Ranger disarm traps, then this would be the button to select). If you right click on the button, then the Ranger should go into Trap Finding mode. If you are using a mobile device, then the right click would be Long Press.
button
{
name "PermanentThieving"
area 765 1 52 52
enabled "keybindings[2][7][6] ~= 0"
bam GUIBTACT
frame 26
tooltip lua "string.format('%s : %s',string.upper(string.char(keybindings[2][7][6])),getHotkeyName(2,7))"
action "Infinity_PressKeyboardButton(string.format('%c', keybindings[2][7][6]))"
actionAlt "Infinity_PressKeyboardButton(string.format('%c', keybindings[2][9][6]))"
}
button
{
area 765 1 52 52
enabled "keybindings[2][7][6] == 0"
clickable lua "false"
bam GUIBTACT
frame 27
tooltip lua "string.format('%s : %s',string.upper(string.char(keybindings[2][7][6])),getHotkeyName(2,7))"
}
My thoughts would be is that you are more likely to want the Trap Finding function as the showing icon and the Disarming Trap as the alternate function. If this is the case the use this code instead:
button
{
name "PermanentThieving"
area 765 1 52 52
enabled "keybindings[2][9][6] ~= 0"
bam GUIBTACT
frame 26
tooltip lua "string.format('%s : %s',string.upper(string.char(keybindings[2][9][6])),getHotkeyName(2,9))"
action "Infinity_PressKeyboardButton(string.format('%c', keybindings[2][9][6]))"
actionAlt "Infinity_PressKeyboardButton(string.format('%c', keybindings[2][7][6]))"
}
button
{
area 765 1 52 52
enabled "keybindings[2][9][6] == 0"
clickable lua "false"
bam GUIBTACT
frame 24
tooltip lua "string.format('%s : %s',string.upper(string.char(keybindings[2][9][6])),getHotkeyName(2,9))"
}
It's not the greatest solution as it isn't intuative as to how to disable traps, but it should work for what you are seeking. I just don't know enough about the scripting to show the alternate hotkey and text in the tooltip. If you are not a keyboard user and/or don't care about showing the hotkey required then you could replace this line in the first button:
tooltip lua "string.format('%s : %s',string.upper(string.char(keybindings[2][9][6])),getHotkeyName(2,9))"
with
tooltip "Find Trap/Disable Trap"
and in the second button with
tooltip "Disabled No Hotkey Set"
Where to put the code:
Open UI.MENU and search for:
name "WORLD_ACTIONBAR"
The code is inserted at the end of section (just added as another button)
menu
{
name "WORLD_ACTIONBAR"
and before the start of
}
`
loot =
To test to make sure it is working properly, the use the thief and watch the icons for the Trap/Theiving change when you right and left click on the 'new' button.
The original code was modified using BG1EE (no SOD) so the location settings are based around this.
area 765 1 52 52
You will probably have to adjust the first setting (765) to change the button's location in the other games.
I have tested this BG1EE without SOD, BG1EE with SOD, BG2EE and IWDEE.
If this doesn't make sense, let me know and I will try to make it more understandable...
Good luck with your mod, I look forward to using it.
Gus
https://forums.beamdog.com/discussion/71798/whos-up-for-some-new-lua-functions/p1
Looks like bubb is going to make custom action bars a reality
I didnt even find the ui.menu
Another method is to edit your baldur.lua and add the line:
SetPrivateProfileString('Program Options','UI Edit Mode','1')
Save and close. Run game and press F11, make slight change (evenly adjust the width of the version number on screen), press F11 again. This makes a copy of UI.menu in Override folder. Make backup of the clean(ish) file.
One other method is to grab another one and download it. What game are you editing. I could upload a clean version. You could also have a look here and grab them all but with the console button in the bottom right hand corner. All the instructions are there so it can easily be removed if yo don't want it.
Gus