Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom Movement Issue (https://forums.graalonline.com/forums/showthread.php?t=134266327)

Gunderak 04-26-2012 09:13 AM

Custom Movement Issue
 
Just wondering, I have made my own custom movement script but the odd thing is, when you touch warps it simply walks over them and doesn't warp you to the new level.
And by warps I mean like level warps eg from outside to an inside level.
If I use up, down, left or right keys it works, but I want it to work on WASD.

Tricxta 04-26-2012 09:42 AM

Perhaps you should post your code?

Crow 04-26-2012 10:08 AM

I believe that's an issue with default events being invoked or not. I bet your onPlayerTouchsMe() events are not working either, are they? You should use keydown() and stick with the default keys. Let players choose what they use to move around.

ffcmike 04-26-2012 10:23 AM

I don't believe holding a key is required to traverse a warp link, or possibly to invoke onPlayerTouchsMe() as well.

Is this movement definitely relative to the players body coordinates and dimensions?
It would have to be a box of {player.x + 0.5, player.y + 1, 2, 2} to work correctly.

Gunderak 04-26-2012 12:22 PM

Modified my code a little bit and it now works.
Thanks anyway.

Tricxta 04-26-2012 12:22 PM

Quote:

Originally Posted by Crow (Post 1693052)
I believe that's an issue with default events being invoked or not. I bet your onPlayerTouchsMe() events are not working either, are they? You should use keydown() and stick with the default keys. Let players choose what they use to move around.

Yer I've found when making my own custom movement this approach seems to work every time.

Hezzy002 04-26-2012 01:10 PM

Disabledefmovement still allows you to traverse links, freeze player doesn't. He was probably using freezeplayer for some reason.

Devil_Lord2 04-26-2012 01:48 PM

Quote:

Originally Posted by ffcmike (Post 1693053)
I don't believe holding a key is required to traverse a warp link, or possibly to invoke onPlayerTouchsMe() as well.

Is this movement definitely relative to the players body coordinates and dimensions?
It would have to be a box of {player.x + 0.5, player.y + 1, 2, 2} to work correctly.

And I believe you are correct about the warps. I know I have a level that the player is falling off a cliff and there was a warp link at the bottom... I was going to have them teleport once they were at the correct spot.. but they seem to warp via the link without them manually moving. Maybe the links just aren't done properly..

Gunderak 04-26-2012 04:31 PM

I was not usin freeze player. I called disabledefmovement();
Why would anyone use freezeplayer in these circumstances :P

Hezzy002 04-26-2012 04:48 PM

I dunno, you're kind of dumb..

xXziroXx 04-26-2012 04:52 PM

Quote:

Originally Posted by Gunderak (Post 1693063)
Modified my code a little bit and it now works.
Thanks anyway.

Thanks for letting us know what you did to fix it!

Gunderak 04-27-2012 08:03 AM

Quote:

Originally Posted by Hezzy002 (Post 1693072)
I dunno, you're kind of dumb..

May I ask why you are always such a prick to everyone?
And the fix was just by using this.
function onKeyPressed(code, key){
instead of
function GraalControl.onKeyDown(code, key){


All times are GMT +2. The time now is 11:39 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.