Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Graal V4 Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=143)
-   -   Request: moving NPCs serverside (https://forums.graalonline.com/forums/showthread.php?t=62133)

jake13jake 11-07-2005 08:29 PM

Request: moving NPCs serverside
 
I know you can move NPCs with the current move function, but it's very limited. Just a simple request:
move with parameters for radius and acceleration, for angular movement and accelerated movement. Would be really useful.

Yen 11-07-2005 09:08 PM

Or even better, fix the move command. :o

I'm not very sure what the problem is, but it seems to randomly do strange things.
For example, one time I had a script do move(-10,0,1,0);
The NPC's y decreased, and it took about 3 seconds to complete the movement.

Skyld 11-07-2005 09:17 PM

A bit of math will allow you to move by angle directions.

This might work. Not sure, though, as I have not checked it.
NPC Code:
this.var = (angle / 360) * (pi * 2);
move(cos(this.var) * speed, -sin(this.var) * speed, 0.5, 0);


You should put some kind of check in as to whether the angle is < 0 or > 360, though.

jake13jake 11-08-2005 01:16 AM

Quote:

Originally Posted by Skyld
A bit of math will allow you to move by angle directions.

This might work. Not sure, though, as I have not checked it.
NPC Code:
this.var = (angle / 360) * (pi * 2);
move(cos(this.var) * speed, -sin(this.var) * speed, 0.5, 0);


You should put some kind of check in as to whether the angle is < 0 or > 360, though.

actually, i use radians for angle measure. I think most math people do. I know what you mean for angular movement. I meant rotational movement... like going in circles. i don't know what would cover all of the properties of rotational movement though.


All times are GMT +2. The time now is 10:53 PM.

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