Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-29-2011, 08:51 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
For staff boots you will never need to know this.. instead use something more along the lines of:

PHP Code:
for ( i=0i<4i++ ) {
  if ( 
keydown(i) ) {
    
player.+= vecx(i) * this.speed;
    
player.+= vecy(i) * this.speed;
  }

Vec X/Y would give you -1,0,1 depending on direction. I am not completly sure how to explain it to you but I understand how it works. If im not mistaken its for finding vectors?

This greatly reduces your script length and makes it easier to modify.
Reply With Quote
  #2  
Old 05-13-2011, 10:14 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by scriptless View Post
Vec X/Y would give you -1,0,1 depending on direction. I am not completly sure how to explain it to you but I understand how it works. If im not mistaken its for finding vectors?
Common question, posted a thread about it: http://forums.graalonline.com/forums...47#post1649547
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:06 AM.


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