Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   speedy quick! (https://forums.graalonline.com/forums/showthread.php?t=74776)

theHAWKER 06-21-2007 11:19 PM

speedy quick!
 
Im trying to make the player go faster when hes not using the weapon and then slower when the player is, but i am having a hard time finding the variable >:(

i tryed:
player.speed -= 1;
player.speed = .1;

but none of these work sadly :(

can anyone help me out?

Grey 06-21-2007 11:23 PM

Hmm..there is no specific variable for determining the player's speed. Use a keydown check or timeout and first check player.dir for the direction and then just add to or minus from the player's x and y accordingly to increase/decrease speed.

Chompy 06-21-2007 11:25 PM

Well, as Grey stated there is no speed variable for the default movement.
You could do as Grey said, doing keydown checks etc.. or you have to make your own custom movement system..

killerogue 06-21-2007 11:25 PM

LOL XD.

Wait, wait, wait. I am so sorry. Erm, that's not going to work as player.speed is not a player variable.

Player is a built in TGraalVar and you can't make vars for it I don't think. You have to use a a custom movement system or something that emulates Graal movement that has a set speed variable.

theHAWKER 06-21-2007 11:34 PM

Quote:

Originally Posted by Grey (Post 1320832)
Hmm..there is no specific variable for determining the player's speed. Use a keydown check or timeout and first check player.dir for the direction and then just add to or minus from the player's x and y accordingly to increase/decrease speed.

Quote:

Originally Posted by Chompy (Post 1320835)
Well, as Grey stated there is no speed variable for the default movement.
You could do as Grey said, doing keydown checks etc.. or you have to make your own custom movement system..

Quote:

Originally Posted by killerogue (Post 1320836)
LOL XD.

Wait, wait, wait. I am so sorry. Erm, that's not going to work as player.speed is not a player variable.

Player is a built in TGraalVar and you can't make vars for it I don't think. You have to use a a custom movement system or something that emulates Graal movement that has a set speed variable.

graal legacy dosn't have a movement system yet the staff boots seam to work fine...

Chompy 06-21-2007 11:42 PM

Quote:

Originally Posted by theHAWKER (Post 1320843)
graal legacy dosn't have a movement system yet the staff boots seam to work fine...

Because the staff boots changes player.x and player.y

example:

PHP Code:

...
this.speed 1;
....
  for(
temp.0<= 3++) {
    if (
keydown(i)) {
      
player.+= vecx(i)*this.speed;
      
player.+= vecy(i)*this.speed;
    }
  }
... 

But, since boots doesn't check for walls you can walk through them.. That's where a custom movement system comes in :O

Quote:

Originally Posted by killerogue (Post 1320836)
Player is a built in TGraalVar and you can't make vars for it I don't think.

You can :)

zokemon 06-21-2007 11:55 PM

Player is actually a built-in TServerPlayer (or specifically a TPlayer if you are talking about the client) and with almost all objects, you can give it custom variables. I think that is how GK's mud system work or at least partially, it syncs mud data from the server to the client and stores both on the server side and client side TServerPlayer objects. I'm only concluding this from pure guessing though and my work on GK has no influence on my guess.

Angel_Light 06-23-2007 06:17 AM

Quote:

Originally Posted by Chompy (Post 1320847)
Because the staff boots changes player.x and player.y

example:

PHP Code:

...
this.speed 1;
....
  for(
temp.0<= 3++) {
    if (
keydown(i)) {
      
player.+= vecx(i)*this.speed;
      
player.+= vecy(i)*this.speed;
    }
  }
... 

But, since boots doesn't check for walls you can walk through them.. That's where a custom movement system comes in :O



You can :)

Thats why you involve a if(onwall()) clientside or a if(tiletype() == 22) serverside. :P


All times are GMT +2. The time now is 02:10 AM.

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