fanadventures.net

Header
English
 
Forum overview > Item fail action?
  • Item fail action?

    by Radicaa · Monday, 26. January 2015, 19:00 h ~ 5 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.
    Radicaa
  • by ke4 · Monday, 26. January 2015, 19:42 h ~ 5 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.
    ke4
  • by afrlme · Monday, 26. January 2015, 19:46 h ~ 5 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")

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11


    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
    afrlme
  • by Radicaa · Monday, 26. January 2015, 19:50 h ~ 5 years ago
    I had a feeling it could be done. Thanks!
    Radicaa
  • New post