Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2012, 09:13 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 04-26-2012, 09:42 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Perhaps you should post your code?
Reply With Quote
  #3  
Old 04-26-2012, 10:08 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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.
Reply With Quote
  #4  
Old 04-26-2012, 12:22 PM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Quote:
Originally Posted by Crow View Post
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.
Reply With Quote
  #5  
Old 04-26-2012, 10:23 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
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.
Reply With Quote
  #6  
Old 04-26-2012, 01:48 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by ffcmike View Post
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..
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #7  
Old 04-26-2012, 12:22 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Modified my code a little bit and it now works.
Thanks anyway.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #8  
Old 04-26-2012, 04:52 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Gunderak View Post
Modified my code a little bit and it now works.
Thanks anyway.
Thanks for letting us know what you did to fix it!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 04-26-2012, 01:10 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Disabledefmovement still allows you to traverse links, freeze player doesn't. He was probably using freezeplayer for some reason.
Reply With Quote
  #10  
Old 04-26-2012, 04:31 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I was not usin freeze player. I called disabledefmovement();
Why would anyone use freezeplayer in these circumstances :P
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #11  
Old 04-26-2012, 04:48 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
I dunno, you're kind of dumb..
Reply With Quote
  #12  
Old 04-27-2012, 08:03 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Quote:
Originally Posted by Hezzy002 View Post
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){
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:50 AM.


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