Graal Forums

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

CaptainSkittles 05-31-2005 05:27 AM

Player Movement Manipulation
 
Alright, I'm a newb scripter just learning my way around, and I want to know which commands I can use to move a player, not an NPC. The regular "move" won't work, as it only applies to npcs. The general idea of my practice script is to move a player in a random direction when he hits the up key.

I know it would start off as...

if (keydown(up)) {

}

Basically, just what commands are available for player movement manipulation? (something pertaining to x,y I'm sure. o.o)

Evil_Trunks 05-31-2005 06:07 AM

playerx = value;
playery = value;

you modify the player coordinates directly

you want to do this in a timeout loop, your code is not correct since keydown is not an event, but a condition

keydown(up) is incorrect, you want to use a number 0 through 3, each number represents a direction

0 up
1 right
2 down
3 left

Kaimetsu 05-31-2005 06:53 AM

You will most likely want to use the onwall2 function.

CaTigus 06-02-2005 07:50 PM

Quote:

Originally Posted by Evil_Trunks
playerx = value;
playery = value;

you modify the player coordinates directly

you want to do this in a timeout loop, your code is not correct since keydown is not an event, but a condition

keydown(up) is incorrect, you want to use a number 0 through 3, each number represents a direction

0 up
1 right
2 down
3 left



Err.....0 is up, 1 is left, 2 is down, and 3 is right.


All times are GMT +2. The time now is 04:55 AM.

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