SCUMM Interface with Noun Cases

  • #1, by dionousMonday, 07. August 2017, 15:33 7 years ago
    Hi all,

    As you know, one of the tricky parts for the Scumm interface is the noun cases (nominativ/ genitiv etc..) in some languages, like Greek (and German).

    So for example (in GREEKlish as the forum doesn't support UTF-8??):

    Object Name: YPOLOGISTIS (this means COMPUTER)

    Command Name: KOITA (means LOOK AT)

    If you want to LOOK AT COMPUTER, the action text should be:

    KOITA TON YPOLOGISTI

    Notice that the last S is removed and the article TON (= THE, or DEN in German) is added. Also the article TON (masculine) could be THN(feminine) or TO (neutral) depending on the noun that follows, similar i guess to German DIE / DEN etc...

    I'm sure above sound very familiar to all German guys here, and i guess some solution is there with LUA, but some guidance on where to start would be appreciated.




    Forum Fan

    246 Posts


  • #2, by sebastianMonday, 07. August 2017, 16:53 7 years ago
    you could hook into the action text change by a lua function. This would result into rebuild every possible "not standard" constillation of your words manually (for each language) . But yes thats possible... 
    I use it to display no action text when I use ItemA on ItemA which would look silly... 

    The function needs to hook into
    "getActionText" and needs to return the new action text:



    Thread Captain

    2346 Posts

  • #3, by afrlmeMonday, 07. August 2017, 17:31 7 years ago
    Sorry, I would have replied to this, but wasn't sure what was being asked/said.

    Imperator

    7278 Posts

  • #4, by dionousMonday, 07. August 2017, 17:44 7 years ago
    Yeah, for sure RegisterHookFunction is the way to go. Will do some tests and revert, thanks guys

    Forum Fan

    246 Posts

  • #5, by dionousThursday, 10. August 2017, 09:08 7 years ago
    Hi all,

    Doing well so far with the registerHook function, but i can't get the inventory items (interface placeholder buttons) names when hovering.

    I think i can't use getTextStr(VButtonName) because this would work only for commands.

    So the question is: how is it possible to get the name of the inventory item inside an interface item placeholder when hovering the mouse over it with the registerHook?

    Thanks!

    Forum Fan

    246 Posts

  • #6, by afrlmeThursday, 10. August 2017, 13:27 7 years ago
    Try using game.CurrentObject as that's basically any type of visObj from scene objects, to characters, to items.

    if game.CurrentObject.ObjectIsItem then
     whatever = game.CurrentObject:getTextStr(VObjectName)
    end

    It's not just for buttons. That was just an example. You can access objects or characters with it too. You change the bit in the getTextStr to match the object type. Items fall under Object whereas characters fall under VCharacterName & interface buttons fall under VButtonName.

    Imperator

    7278 Posts

  • #7, by dionousFriday, 11. August 2017, 09:08 7 years ago
    Thanks for the assistance, i think i got the whole concept smile

    Just a quickie:

    i know there is eObjects, eCharacters; is there eItems or eButtons also or are they included in eObjects?

    Forum Fan

    246 Posts

  • #8, by constantinThursday, 21. December 2017, 16:01 6 years ago
    Can somebody please explain how this works? i couldnt find out myself.
    in the command "Benutzen" i have set the name "Benutze" under command properties. Is it possible, to change the name "Benutze" into something like "Öffne" depending on wether the object is a door or a water pipe? 
    I would love to have the adventure grammatically as correct as possible. So I would be happy to use prepositions as well, if it was something like "Gehe durch die Tür" but "Gehe nach hinten" or "Gehe zu dem fremden Mann" and so on. 

    Forum Fan

    167 Posts

  • #9, by sebastianFriday, 22. December 2017, 08:21 6 years ago
    Yes, this is possible but would involve some lua script. You either can only change the button text depending on the language or (additionally) just rewrite the whole action text to also change order/arrangement of words, etc.

    Currently im on my way to work, so i can't provide any scripts or snippets right now to keep you on the right track. 

    Not sure if atrus also can provide his solution to his question from earlier. 

    Thread Captain

    2346 Posts

  • #10, by sebastianFriday, 22. December 2017, 19:30 6 years ago
    This would rename a buttons text for the current active language (code mainly by AFRLme): 

    make this a definition script in your scripts workspace:

    function setText(obj, txt)
      local texts = obj.TextTextLanguages -- get all texts belonging to the object
      for i = 1, #texts do -- iterate through the stored texts
        if texts[i].language == game.StandardLanguage:getId().id then
          texts[i].text = txt; obj.TextTextLanguages = texts ; break -- update old text with new text and break out of loop
        end
      end
    end

    Then you can use the following in "execute a script" actionparts when hovering over specific objects or items:
    For example on a door:
    setText(Buttons["use"].Name , "Öffne")

    Thread Captain

    2346 Posts

  • #11, by constantinFriday, 22. December 2017, 20:00 6 years ago
    Thank you!

    Forum Fan

    167 Posts