Custom command property names for same interface action button (use door handle, pickup coin, press button)

  • #40, by sebastianThursday, 11. June 2015, 12:54 9 years ago
    so i have to implement the new script in the old one? I may have to try&error this out. I never did Lua but the functions are quite easy to understand whats going on. I'll give Feedback this afternoon when im home from work

    Thread Captain

    2346 Posts


  • #41, by sebastianThursday, 11. June 2015, 20:08 9 years ago
    Sadly i cant get this working.

    I thought naively about this, but it doesn't work either confuseroll :
    (mouse enter area):
    local button = getObject("Buttons[use]")
    button:setValue(VButtonName, jump in)

    Thread Captain

    2346 Posts

  • #42, by afrlmeThursday, 11. June 2015, 20:31 9 years ago
    You have to replace the text using the method shown in the script I posted. ButtonName is the name of the button & is nothing to do with the action text. The text is stored in the Language text tables.

    Imperator

    7278 Posts

  • #43, by sebastianThursday, 11. June 2015, 21:11 9 years ago
    You have to replace the text using the method shown in the script I posted. ButtonName is the name of the button & is nothing to do with the action text. The text is stored in the Language text tables.

    Then
    "ButtonNamet_link to TextOnly used if button is a command (ButtonType = '3' or '6'). The name of the command which is shown in the action text." from the Wiki is a bit misunderstanding wink

    Ok, I'll give it a second go.

    EDIT: When i enter the objectarea i get this error in the log:

    Unknown datafield
    TextTextLanguages
    


    PS: is it possible to get some kind of livelog or do i have to do "TAB; print log" everytime?

    Thread Captain

    2346 Posts

  • #44, by afrlmeThursday, 11. June 2015, 23:30 9 years ago
    I've requested a runtime log feature to be added to a future version of VS in our team bug / feature tracker. I'm hoping Simon or David will get around to implementing one at some point. I'd even be happy if it was just a floating window that updated on new content or refreshed itself after every x amount of time. The first method would be more ideal mind.

    Ahh I forget. You might need to add .ButtonName if you are using my setText() function. I left the input vague so that users could input various tables, such as objects, buttons, characters etc.

    So, if you were using the function I provided on the previous page then it would be something like this...
    setText(Buttons["use"].ButtonName,"new text")
    

    ... you could actually remove the second parameter & sort out a bit of script inside of the main function to return the correct text based on the current language & integer value of a specified value. Food (text rather) for thought.

    Imperator

    7278 Posts

  • #45, by sebastianFriday, 12. June 2015, 07:35 9 years ago
    Works razz
    Now I'll add language-support. I could try the language-table stuff in the "original" script you posted on the wiki. So the setText function goes like
    setText(Buttons["use"].ButtonName,2)
    

    and searches in the function the desired name of e.g. "2" in the active language .

    Thanks so far smile

    Thread Captain

    2346 Posts

  • #46, by sebastianThursday, 18. June 2015, 13:09 9 years ago
    Next question regarding the renaming:
    Now when i have an item in my inventory I also want to rename some commands when entering their item-field. Because the items are not always in the same order i cant use the mouse-enter action at the itemfields

    Is there a method to get a mouseenter on SPECIFIC items (not the itemslots in the inventory)?

    I only found dragging and some clicking-triggers but no mouse-enter stuff at the actions-tab of the desired item.

    Thread Captain

    2346 Posts

  • #47, by afrlmeThursday, 18. June 2015, 14:31 9 years ago
    You might be able to use Lua script & a mouseEventHandler with some tables & a function which checks the current object under the cursor & if it is a item & then go from there. I can't say for sure it would work though, as I've never tried updating names of items.

    Imperator

    7278 Posts

  • #48, by sebastianThursday, 18. June 2015, 17:00 9 years ago
    oha....oha....me and my lua skills red cry
    I will try my best and check if i can do this...

    Thread Captain

    2346 Posts

  • #49, by sebastianFriday, 19. June 2015, 23:51 9 years ago

    Thread Captain

    2346 Posts