Stopping a mouse button from moving the main character

  • #1, by BenmirathSaturday, 14. June 2014, 05:06 10 years ago
    Hi,
    I'm struggling a bit with an automated feature in the engine whereby any left or right mouse click causes the player character to move to that point. My game uses a command setup where left click activates the current command, and right click cycles to the next command.
    Ideally, I want to have the left click only move the character, and right click not impact the movement at all. For the time being I've made it so that right clicking stops the character, which works to an extent, but makes the character stop if you try and change commands while walking to a destination. The other solution which I may try next would be to wrap the "stop character" action part in a "wait until character has stopped" action part. This would let the player keep moving, but would presumably also alter their course. Is there any other way to achieve what I'm looking for?
    Thanks!

    Newbie

    31 Posts


  • #2, by afrlmeSaturday, 14. June 2014, 14:03 10 years ago
    I was speaking to David about this the other day, as it's something I would like to see too. I don't know if it will get implemented or not mind.

    What you are asking for, could probably be achieved with a couple small lua scripts. I can't think of how off the top of my head though.

    Imperator

    7278 Posts

  • #3, by BenmirathSaturday, 14. June 2014, 14:34 10 years ago
    Hmmm, I guess another feature to look forward to :p
    I tried to use scripting a tiny bit a while back, but couldn't get it working. It seems like the move command precedes when the script itself would be called by registering it to the right click mouse event. My best guess would be to have the script first check the character state if moving. If they are, set the CharacterDestination to a cached value from the last left click, and if they aren't setting the state to 0 or calling an action to stop the character?
    If the movement precedes the character though, that won't be of much help. One thing I didn't try previously though is executing the same script from the right click mouse properties in the engine, which does in fact seem to precede the move command. I'll try that next.
    Thanks,
    -Ben

    Newbie

    31 Posts

  • #4, by afrlmeSaturday, 14. June 2014, 15:13 10 years ago
    I was more thinking along the lines of getting the destination/command/item in the left click, setting a condition to true if one of the available destination commands are set & false on character stop or reach destination. & then using if query in right to check if condition true & if it is then make it carry on with what it was already doing.

    Like I said though: I'm not sure how, yet...

    Imperator

    7278 Posts