When I mean use the mouse to move I mean like, say you had a character who just kept walking and moved wherever you put the mouse. I was wondering how this would be done. I tried just using a simple MoveCharacter command but the game just loads and loads and loads...
BTW: I'm using 2.61
Shouldn't this work by putting this line into the repeatedly_execute function:
// update the player position NON-BLOCKING
MoveCharacter ( EGO, mouse.x, mouse.y );
Basically just make sure you are calling the move-function non-blocking! I never tried this, there may be problems with this.
That's what I tried, but the game just loads, even when I don't put in a blocking function. Maybe I have something in my room script that prevents me from doing this.
Hmm, what do you mean with "loads"?
Try the following method:
int delay = 0;
function repeatedly_execute() {
if (delay > 0) delay --;
else
{
MoveCharacter ( EGO, GetViewportX() + mouse.x, GetViewportY() + mouse.y );
delay = 50;
}
}
I think someone tried that before and he didn't like the result it produced. A little we can do about it, though.
Maybe MoveCharacterStraight will produce better results, since it doesn't use A*, so calling it 40 times a second won't be as "unfriendly" to the engine.
Wow! Thanks for the feedback! I'll try that code scorpiorus.
That code got it Scorpiorus. I just had to change the delay to 10 so that my character was more responsive. Anyways, thanks for all the help!