Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-27-2002, 08:41 AM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by BocoC
Try something like this:
NPC Code:

if (created) timeout=0.05;
if (timeout) {
if ((abs(this.px-playerx)>0.6)||(abs(this.py-playery)>0.6)) {
playerx=this.px;
playery=this.py;
}
this.px=playerx;
this.py=playery;
timeout=0.05;
}


That should work. Since a player moves a max of 0.6 tiles every 0.5 seconds (level 3 shield), it checks if a player goes faster. You can modify upon it if you want.
[Kaimetsu]

Nope, won't work. Wanna know why? Because on a speed-hacked computer, timeouts run faster than normal too. You might get 40 timeouts per second, so even if you were running at the normal distance-per-timeout, you'd still be going fast.

[/Kaimetsu]
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 08:51 AM.


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