Using an item from inventory on a scene object with a text " use 'item' on 'scene_obj'

  • #1, by AkcayKaraazmakFriday, 19. September 2014, 17:39 6 years ago
    Hi guys,

    I want to select the key from inventory and use it on a lock. But when I do it, I want to write a text on screen " use key on lock". How I can write it?
    When I select the key from inventory (drag-drop), key moves with the cursor and when I come on the lock (scene object) it just writes "lock". But I want to write "use key on lock". I'm using 3 cursors for the game. 1 default arrow, 2nd is look and 3rd is for any interaction (take, push, use etc..)

    Any ideas? smile

    Cheers...

    Great Poster

    437 Posts


  • #2, by afrlmeFriday, 19. September 2014, 19:10 6 years ago
    I believe I wrote a lua script for this a while back. It's on the forum somewhere. It might actually be on the wiki too but I don't remember. If you weren't using dragged items then you would be able to use the junction command names.

    * edit: found it. Not sure if it's using the valid text code though as it was changed at some point. http://wiki.visionaire-tracker.net/wiki/Dynamic_Action_Names...

    Imperator

    6842 Posts

  • #3, by AlexFriday, 19. September 2014, 20:07 6 years ago
    Hi,

    of course you can always use a getActionText hook for full flexibility (so you can define the displayed text in lua). In your case this isn't necessary though.

    What you want to achieve is the standard behavior. All you have to do is set the language dependent name for the command, conjunction word and item. This is the input field next to the flag icon. When you click on the flag icon you can change the displayed language (in case you support multiple languages). The name fields are found at:
    Interface -> select command -> command properties tab -> Name and conjunction word.
    Scene -> select scene object -> Properties tab -> Object name

    Great Poster

    378 Posts

  • #4, by afrlmeFriday, 19. September 2014, 22:14 6 years ago
    With dragged items I don't think it displays the text associated with the command/item? only with items selected using the set item command. Actually not tried in 4.0 builds I don't think but previous builds it seemed to remove the text when dragging items.

    Imperator

    6842 Posts

  • #5, by AlexFriday, 19. September 2014, 22:47 6 years ago
    it does. This was changed with release of Visionaire 4.0

    Great Poster

    378 Posts

  • #6, by afrlmeFriday, 19. September 2014, 23:40 6 years ago
    That's me told then! razz

    Imperator

    6842 Posts

  • #7, by AkcayKaraazmakSaturday, 20. September 2014, 00:01 6 years ago
    Hello Lee, thank you mate for that script. May I ask you to give an example how to use it in the game?
    I pasted the script and made it definition script. Then what should I do, how I should use the script and use it on which objects?

    Thank you mate!

    Great Poster

    437 Posts

  • #8, by AlexSaturday, 20. September 2014, 00:35 6 years ago
    why do you want to use a script when it's not necessary? as mentioned above this is already standard behavior.

    Great Poster

    378 Posts

  • #9, by afrlmeSaturday, 20. September 2014, 01:11 6 years ago
    Alex said the script is no longer required because they updated 4.0 so that it displays the action text, for dragged items too.

    I don't think my script is valid any longer anyway as I think I wrote it before the new getText methods & the old method no longer works.

    P.S: the page contained instructions but as said, you shouldn't need to use the script anyway.

    @Alex: I think the problem is that he is only using 1 interaction command & he's wanting the conjunction words to adjust based on which item is selected & which scene object it is hovering over the top of. If I remember correctly that was one of the reasons why I wrote the script as it decided which words to use from tables based on a value set on mouse enters action part on each scene object.

    Imperator

    6842 Posts

  • #10, by AkcayKaraazmakSaturday, 20. September 2014, 10:24 6 years ago
    Yes Lee, that's the problem. I'm using just 1 interaction command.

    Great Poster

    437 Posts

Write post