Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   move is a pain! (https://forums.graalonline.com/forums/showthread.php?t=54023)

VeX_RaT_Boy 07-26-2004 01:27 AM

move is a pain!
 
Yes hello.

I have NO idea why move is being mean to me.
NPC Code:
move this.testx,this.testy,this.dist/this.speed,4+2+8;



When I use that, it looks like it's "warping" to you (yes, it moves to you), instead of a smooth moving. This is serverside.
(this.dist is the real distance, and this.speed is at least 1)

osrs 07-26-2004 03:14 AM

Wrong scripting causes that, i'm not saying your scripting is wrong because i didn't see the whole code, but it always happens with problems on code, not with move. Already happened with me many times.

Goboom 07-26-2004 04:04 AM

NPC Code:

if (created) {
this.textx = x;
this.testy = y;
this.dist = 5;
this.speed = .1;
timeout = 0.05;
}
if (timeout) {
move this.testx,this.testy,this.dist/this.speed,4+2+8;
timeout = 0.05;
}



Seems to work just fine for me.

Dach 07-26-2004 09:04 AM

just use this.dist, that seems to be what I did whenever I used move

Goboom, that's not how it works, exactly. The dx and dy are vector parts, distance variables rather. It's the x distance and y distance the npc needs to move, not it's position. Upon further examination, yours only works because of the typo and the strange numbers you feed it (5 is grabbed out of thin air, you need to have the real distance)

Rick 07-26-2004 09:10 AM

Did you know, that division by decimals increases the value of the number?

Nice speed there ;)

VeX_RaT_Boy 07-26-2004 10:52 PM

EDIT: Alexander is helping me now <3
Close this or so.


All times are GMT +2. The time now is 11:12 PM.

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