Does anyone know how the movehandler .dll works?

Author Topic: Does anyone know how the movehandler .dll works?  (Read 1418 times)

it begins
I have no clue how to use this .dll, all I know is that it's supposed to let the server get movement input from clients without needing a client addon.
I don't see any readme files in it anywhere nor any meaningful comments in the source files.

EDIT: also it seems to cause a crash when I use the admin orb
« Last Edit: August 29, 2017, 10:09:07 AM by Super Suit 12 »

You need to define the function onPlayerProcessTick()

The first parameter that it's called with is the player object, and the next one is the inputs (could be wrong about the second one, I don't use it)

Return 0 makes them stop moving completely.
Returning a blank returns to whatever they were doing.
Return 0 if you are not making them do anything. (Probably want to do this most of the time)

Example:
function onPlayerProcessTick(%this, %input)
{
    talk(%this.client.name @ "'s tick" SPC %input);
    return 0;
}


There is a similar function onGetAIMove for bots.

Ah... It seems to be counting up, so I'm guessing no. I'm returning 0 and I can move, so I must be misunderstanding what you're saying with the return thing.
« Last Edit: August 29, 2017, 01:24:26 PM by Super Suit 12 »

Pretty sure the onAIMove one is the one to be careful with how you return it.

onGetAIMove:

return "" to use the normal behavior (supporting setMoveDestination, setAimObject, etc)
return "0" to do nothing
return an input string like the second argument to onPlayerProcessTick to have the bot do that