Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-25-2006, 03:41 PM
Kronan Kronan is offline
yo
Kronan's Avatar
Join Date: May 2001
Location: Florida, USA
Posts: 682
Kronan is on a distinguished road
Send a message via ICQ to Kronan Send a message via AIM to Kronan Send a message via Yahoo to Kronan
Quote:
Originally Posted by Stefan
Sorry for deleting some posts but I don't want moderators *****ing at people who are asking for help. I hope someone can help with a link to a code snippet (on graal.net, we also plan a code snippet section on wiki.graal.net) or give hints on how to do a haste script.
I agree with you 100%. It's not good business to ***** at paying customers who are just looking for help.

And for your haste script, do you mean running? If so you can play around with this:
PHP Code:
//#CLIENTSIDE

function onCreated() {
  
this.speed 0.2;
}  
function 
onKeyPressed(code,character) {
  
this.pressed = !this.pressed;
  if (
this.pressed) {
   if (
character == "h") {
      
setTimer(0.05);
      
player.chat "Hasting!";
  }
}
  elseif (
character == "h") {
    
setTimer(0);
    
player.chat "Walking!";
  }
}    
function 
onTimeout() {
  
temp.ar = {player.x+1.5+vecx(player.dir)*1.1,
             
player.y+2+vecy(player.dir)*1.1
            
};
  if (
onwall(temp.ar[0],temp.ar[1])) {
    
setTimer(0.05);
  }
  if (!(
onwall(temp.ar[0],temp.ar[1]))) {
   if (
keydown(0)) playery-=this.speed;
   if (
keydown(1)) playerx-=this.speed;
   if (
keydown(2)) playery+=this.speed;
   if (
keydown(3)) playerx+=this.speed;
   
setTimer(0.05);
  }

It might not be the best, but it serves its purpose. It's a bit buggy so you'll have to work with it. It is activated by pressing "h", and deactivated by pressing "h" once again. I threw this together in like 5 minutes. So don't hate my skill. Problem with this script is, it's not checking around the player for a wall, so you'll have to play with it to make it do that.
__________________

Last edited by Kronan; 01-25-2006 at 05:22 PM..
 

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 07:24 PM.


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