deactivate specific commands / change image for specific commands on mouse over

  • #1, by loro-gamesMonday, 12. June 2017, 19:57 7 years ago
    Hi guys!

    I have a standard interface (Sam & Max style) where you can cycle your commands by right clicking. 

    • go to, look at, use, speak

    Every command has an active and an inactive image and also a "forbidden"-state. So if you try to "use" a character the command switches automatically to a greyed out version of the "use" command because using a character is not possible (at least in our game smile This is working fine. I added this into the animation frame of the active "use" image:

    if object below cursor is a character
     set cursor "interact forbidden"
    end if

    That is working fine, however if I do the same for the speak command in the other direction:

    if object below cursor is a scene object
     set cursor "speak forbidden"
    end if

    That does not work unfortunately. Is Visionaire treating characters as scene objects as well? Using the same condition as before with adding an else for this did not work either:

    if object below cursor is a character 
     --
     else
     set cursor "speak forbidden"
    end if

    Does anybody know a good way to achieve this?

    greetings,
    tobi

    Newbie

    64 Posts


  • #2, by loro-gamesThursday, 15. June 2017, 13:01 7 years ago
    Nobody has an idea? roll

    Newbie

    64 Posts

  • #3, by afrlmeThursday, 15. June 2017, 13:16 7 years ago
    Sounds like a bug. Yeah a character is technically an object, but they should be linked to the characters table unless you created them as a scene object.

    Imperator

    7278 Posts

  • #4, by sebastianThursday, 15. June 2017, 13:22 7 years ago
    the object check "if"  should only trigger on objects, not characters and the other way around. I did it with the scumm interface but set an active image of a command button. 
    if cursor over scene object or item: 
    show active image for look button. 
    if cursor over character:
    show active image for talk button. 

    This works as expected, so i would assume that there is nothing wrong with these if statements... 

    Does your curser get overwritten otherwise? 


    edit: otherwise as assumable by the name " if current object is scene object" it also triggers "true" when above an item slot or inventory arrow up/down arrow.. which is kinda weird... Hope to see more possibilities with this action part in the future... 

    Thread Captain

    2346 Posts

  • #5, by loro-gamesThursday, 15. June 2017, 13:54 7 years ago
    Sorry guys I did not think this through enough. As far as the "use" command goes I will of course have to add this action to every character for the "use" cursor to go back to normal:

    cursor leaves character area
    if "use" is current command
    set cursor to "use-standard"
    end if

    Otherwise the "use" cursor would not change back after hovering over the first character. This has also caused my confusion regarding the "speak" command. Now the problem is that I would have to enter an action like the one above for every object in the game, so that the speak cursor always goes back to its normal form. I better start doing that now if I want to be finished in 20 years xD

    Thanks for the input guys!

    Newbie

    64 Posts

  • #6, by sebastianThursday, 15. June 2017, 14:00 7 years ago
    you could track your mousemovement with lua and the main loop... there you could always check for e.g. the objects name under the cursor and if it finds keywords in it you edit the cursor.  Or get the objects conditions where you define if a cursor deactivation is possible or not... 

    Thread Captain

    2346 Posts

  • #7, by afrlmeThursday, 15. June 2017, 14:47 7 years ago
    you could track your mousemovement with lua and the main loop... there you could always check for e.g. the objects name under the cursor and if it finds keywords in it you edit the cursor.  Or get the objects conditions where you define if a cursor deactivation is possible or not... 
    no need for a main loop with mouse movement as you can use mouseEvent handler for that. I have to warn you though that mouse movement is very easy to trigger. ny vibrations on your desk from pc, a fan or from you moving about/resting your arm on the desk seems to be able to trigger it, so you will need to create a range on x&y to make it so mouse movement is only triggered if mouse has moved x pixels from last check.

    Imperator

    7278 Posts

  • #8, by loro-gamesThursday, 15. June 2017, 14:59 7 years ago
    Thanks guys, I'll look into it!

    Newbie

    64 Posts

  • #9, by sebastianThursday, 15. June 2017, 15:49 7 years ago
    you could track your mousemovement with lua and the main loop... there you could always check for e.g. the objects name under the cursor and if it finds keywords in it you edit the cursor.  Or get the objects conditions where you define if a cursor deactivation is possible or not... 
    no need for a main loop with mouse movement as you can use mouseEvent handler for that. I have to warn you though that mouse movement is very easy to trigger. ny vibrations on your desk from pc, a fan or from you moving about/resting your arm on the desk seems to be able to trigger it, so you will need to create a range on x&y to make it so mouse movement is only triggered if mouse has moved x pixels from last check.

    ah yes, sorry.... i often get confused about which event or hook function is best here.
    registerEventHandler("mouseEvent", "onMouseEvent", {eEvtMouseMove }) 
    would be suitable

    Thread Captain

    2346 Posts