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 06-21-2007, 11:19 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Cool 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?
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 06-21-2007, 11:23 PM
Grey Grey is offline
Classic Developer
Grey's Avatar
Join Date: Mar 2007
Location: Wales, UK
Posts: 134
Grey will become famous soon enough
Send a message via AIM to Grey
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.
Reply With Quote
  #3  
Old 06-21-2007, 11:25 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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..
__________________
Reply With Quote
  #4  
Old 06-21-2007, 11:25 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #5  
Old 06-21-2007, 11:34 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by Grey View Post
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 View Post
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 View Post
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...
__________________
**FLIP OUT**
Reply With Quote
  #6  
Old 06-21-2007, 11:42 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by theHAWKER View Post
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 View Post
Player is a built in TGraalVar and you can't make vars for it I don't think.
You can
__________________
Reply With Quote
  #7  
Old 06-23-2007, 06:17 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Chompy View Post
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
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 06-21-2007, 11:55 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
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.
__________________
Do it with a DON!
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 01:00 PM.


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