License from €75
DE EN FR ES IT CZ

How To Hide Inventory During Display Text

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 years ago
    Hello, I have an inquiry.

    I would like to hide the inventory whenever there is display text.

    Is there a simple way to accomplish this ?  

    Thank you for your time.
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 9 years ago
    It should automatically hide providing you haven't set the inventory interface to be displayed permanently via its properties.

    P.S: could you please edit & delete the multiple duplicate threads you have created please? Cheers.
  4. · 9 years ago
    @afrlme the inventory doesnt get hidden when showing a display text...

    Probably you need to hide and reshow the interface  manually. 
    Or use lua to hook into a textStarted/textStopped event and temporary hide hide/show it globally
  5. · 9 years ago
    No? Oh yeah, sorry. Forgot. grin

    Just use the Lua event handlers for textStarted & textStopped.

    Create a script in the script section of the editor & add this to it... (replace "inventory" with whatever you have named your inventory interface)

    function txtStart(text)
     if text.Owner:getId().tableId == eCharacters or text.Owner == nil then
      Interfaces["inventory"].Visible = false
     end
    end
    
    function txtEnd(text)
     Interfaces["inventory"].Visible = true
    end
    
    registerEventHandler("textStarted", "txtStart")
    registerEventHandler("textStopped", "txtEnd")

  6. · 9 years ago
    Hello, thank you for replying to this thread.

     
    I have added the script, and replaced the "inventory" with what I named the interface, however the script is not working

    In editor there is a big red line under the second last line of code:
    registerEventHandler("textStarted" "txtStart")

    Thank you again.
  7. · 9 years ago
    Yeah sorry, seems I missed the comma between the 2 different values. I've updated the code block.
  8. · 9 years ago
    Thank you for that.

    One last small bug with the code.

    After every display text, the inventory pops open. Even when it was closed to begin with.

    Kind Regards
  9. · 9 years ago
    So you just want it to hide only? If that's the case then...

    function txtStart(text)
     if text.Owner:getId().tableId == eCharacters or text.Owner == nil then
      Interfaces["inventory"].Visible = false
     end
    end
    
    registerEventHandler("textStarted", "txtStart")

    I have no idea what your inventory looks like or how you've rigged it up. Anyway, you're going to have to use Lua to show & hide it as needed.

    Use an execute a script action part & with this line of code whenever you want to show the interface... replace "inventory" with the actual name of the inventory interface.

    Interfaces["inventory"].Visible = true

    & same again when you want to hide it, but true should be false instead.
  10. · 9 years ago
    Hi, that worked perfectly. Thank you for your help.
  11. · 9 years ago
    Just edited my last post with additional information.
  12. · 9 years ago
    Hello, Thanks for the update.

    I will use that new code, whenever adding a new item to the inventory.

    Kind Regards

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?