Diablo-Style-Controls Question

  • #1, by CrossWednesday, 11. March 2015, 13:53 5 years ago
    Is there a way to have the character constantly follow the cursor while holding down left mouse, similar to the Diablo-games? I only find an Option to have him follow the cursor by either leftclicking or releasing the mousebutton.
    Since there is also no action like "follow cursor" i can't quite figure out how to do that.
    Thanks for any help

    Newbie

    92 Posts


  • #2, by afrlmeWednesday, 11. March 2015, 14:30 5 years ago
    Theoretical solution...

    1. create a called by other action.
    2. add these action parts.

    execute a script > (see block below)
    1
    2

    local spos = game.ScrollPosition
    local cpos = getCursorPos()
    game.CurrentCharacter.Destination = { x = spos.x + cpos.x, y = spos.y + cpos.y }
    1
    2
    3
    4

    pause for 50ms
    jump to action part #1
    1
    2
    3


    3. call this action in the mouse hold button action of the mouse properties tab.

    4. quit this action in the mouse button release action of the mouse properties tab. Also add a stop character action part to stop the character from walking.

    It should work, but as I said, it's purely theoretical.

    Imperator

    6805 Posts

  • #3, by CrossWednesday, 11. March 2015, 16:13 5 years ago
    It works absolutely fine. Thank you so much smile

    Newbie

    92 Posts

  • #4, by afrlmeWednesday, 11. March 2015, 16:15 5 years ago
    No problem. wink

    Imperator

    6805 Posts

Write post