Skip to content

changing UI for classes

dorpinchdorpinch Member Posts: 11
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?

Comments

  • GusindaGusinda Member Posts: 1,915
    Hi @dorpinch, I don't know the answer to your prob, but it might be possible to reengineer this Thieving button to make it a Traps button.

    Gus
  • dorpinchdorpinch Member Posts: 11
    how do I reengineer a an action button?
  • GusindaGusinda Member Posts: 1,915
    @dorpinch, you might be able to read the code that is mentioned in the discussion and modify it to suit your needs. Change its context so that it performs as a Trap function rather than a Thieving function. Give it the Trap icon etc.

    I think that the rest of the buttons are hard coded (at least until Bubb finishes his magic). This one is an addon.

    Gus
  • GusindaGusinda Member Posts: 1,915
    @dorpinch, not much on TV last night so had a little hack play. All credit here obviously goes to the Permanent Thieving Button discussion...

    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
  • dorpinchdorpinch Member Posts: 11
    Thanks Gus youv been very helpful, Ill try that
    Gusinda
  • The user and all related content has been deleted.
  • dorpinchdorpinch Member Posts: 11
    yea I was doing something like that, only that I need to alter the vanillas monk's thac0 so the kit will also get the same thac0 as a ranger per level, so I find modifying the ranger directly more simple
  • GrammarsaladGrammarsalad Member Posts: 2,582
    I would keep an eye on this:
    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
    GusindaArdul
  • dorpinchdorpinch Member Posts: 11
    Gus I know its been some time, but I couldn't work on this earlier. could you explain it to me further.
    I didnt even find the ui.menu :(
  • GusindaGusinda Member Posts: 1,915
    @dorpinch, right. Forgot that the UI.MENU is 'put away' until you need to mod it. There are a couple of ways to get it. I find using NearInfinity (need Java Runtim installed) the easiest method to make a copy of it.

    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
Sign In or Register to comment.