Item fail action?

  • #1, by RadicaaMonday, 26. January 2015, 19:00 10 years ago
    Just wondering: is there a way in visionaire to set a pre-determined display text or other action when an item is combined/used on something and it doesn't result in any action? It is of course possible to write every possible wrong combination of mixing items and the wrong way to use them on objects and environment, but with a large list of items this can become quite the daunting task.

    Newbie

    25 Posts


  • #2, by ke4Monday, 26. January 2015, 19:42 10 years ago
    Hi,

    Visionaire has an option for that. There is "Comment sets" tab in characters section. You can create various sets for character and then change them with Visionaire actions.

    Key Killer

    810 Posts

  • #3, by afrlmeMonday, 26. January 2015, 19:46 10 years ago
    The comment set system is for that. You can create multiple comment sets & swap to them as needed.

    If you wanted to make it global then I suppose a small loop would work ok. Inside this loop you could listen out for the type of command is currently active. So in this loop you would have it check the currently selected command or if an item is held & then you set the active comment set based on that.

    I suppose there would be other ways you could do this, such as creating an on cursor enters action for each object & then defining the active comment set in that, but I'm not sure how accurate that would be, plus it would require a lot of work.

    chkCommentSet()
     if not game.UsedItem:isEmpty() then
      game.CurrentCharacter.CurrentCommentSet = CommentSets["comment_set_name"]
     elseif game.ActiveCommand:getName() == "use" then
      game.CurrentCharacter.CurrentCommentSet = CommentSets["comment_set_name"]
     elseif game.ActiveCommand:getName() == "talk" then
      ...
     end
    end
    
    registerEventHandler("mainLoop", "chkCommentSet")
    


    The code above is just a raw example. It's untested so I have no idea if it will work. You need to finish it off & edit the names of things. For instance "use" & "talk" are the names you gave to the buttons containing the commands. "comment_set_name" would be the name of the comment set. Remember that names are case sensitive.

    * hehe: I see ke4 beat me to it! grin

    Imperator

    7278 Posts

  • #4, by RadicaaMonday, 26. January 2015, 19:50 10 years ago
    I had a feeling it could be done. Thanks!

    Newbie

    25 Posts