Display text in scene without the character.

  • #1, by divas1980Sunday, 15. June 2014, 10:59 10 years ago
    Hello, I have a scene without the character ,it is a image close of the table and any way system..
    In the table there are various object and interactive area. .Tthe character is not seen. I have a problem when I use Dsplay text , the text dont appears.
    I can not use "display text narration" because it uses a different font.

    How can I do? I wish you could see the text centered at the bottom. I checked other topics but nothing that would be right for me.
    Thank you again.

    Newbie

    46 Posts


  • #2, by afrlmeSunday, 15. June 2014, 13:13 10 years ago
    You could create a blank (empty) character which you can assign to any scenes you need to use normal display text, without the character. & then use the registerHookFunction for setting the text to the bottom.
    local pos -- empty variable
    local y_offset = 100 -- amount of pixels from the bottom it should be...
    
    function txtPos(text)
     if text:getLink(VTextOwner):getId().tableId == eCharacters and text:getLink(VTextOwner):getName() == "character_name" then
      pos = game:getPoint(VGameWindowResolution) -- get window resolution
      text:setValue(VTextPosition, {x = (pos.x / 2), y = (pos.y - y_offset)}) -- set text position
      return true
     end
    end
    
    registerHookFunction("setTextPosition", "txtPos")
    

    Replace character_name with the actual name of the blank character you have created. This will only trigger the text position for texts spoken by that character.

    Imperator

    7278 Posts

  • #3, by divas1980Sunday, 15. June 2014, 15:09 10 years ago
    Great! works fine thank you.

    I have a 'other question if possible. In the properties of each object of each scene, there is Object Name.

    When you pass the cursor over the area the name appears. And it is perfect.
    But I have a key (a example) visibile at begin but in the game can not be taken. It becomes interactive only after a condition set to true.

    I wanted to know there is a script or something to make visible the Object Name not immediately but only after a condition is true.
    thanks...

    Newbie

    46 Posts

  • #4, by afrlmeSunday, 15. June 2014, 15:55 10 years ago
    You can actually assign a condition the properties tab of each scene object. This means the object, its name, & all of its actions will only be active/available if the linked condition is met. The images & animations will also be hidden.

    If "negate" checkbox is ticked then the object will only be active if the linked condition value is false else if "negate" checkbox remains unchecked, then the object will only be active if the linked condition value is true.

    Technically it is possible to use lua script to rename objects based on current language or all available languages, but we won't go into that right now.

    P.S: it may be a good idea to create the key name & actions inside of a separate object than the object containing the key image/animation.

    Imperator

    7278 Posts