PDA

View Full Version : move() bug?


contiga
09-20-2006, 05:05 PM
What I'm doing:
triggerAction( this.x + 1, this.y + 1, "serverside", "returnData", "bomy");

Which works when doing it before I use the move() command.

After using the move() command, to move my "bomypet", on Graal2001 Dev, it doesn't trigger at correct place anymore. Anyone knows why? The triggeraction is done clientside, the move() part serverside.

The move() part is in a joined class, not the one the triggeraction is being sent to, maybe the this.x and this.y aren't updating correctly? Who knows.. maybe you!

ZeroTrack
09-20-2006, 08:19 PM
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.

KuJi
09-20-2006, 09:03 PM
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.

Move() still works and isn't outdated. ( or at least I use it? )

Also.. x + 1, and y + 1..

try x, y or x + 0.5, y + 0.5

And make sure its setshaped on the clientside I think.

ZeroTrack
09-20-2006, 09:14 PM
I haven't used move() in a longg time

KuJi
09-20-2006, 09:16 PM
I haven't used move() in a longg time

Changing X/Y directly.. hachi told me ( and I am pretty sure I witnessed) it makes the walk.wav sound play

Angel_Light
09-24-2006, 07:47 PM
*cough* Outdated function *cough*

It's not outdated, :\ one of my favorite scripts use the move();


//#CLIENTSIDE
function onCreated() {
onTimeOut();
}

function onTimeOut() {
r = random(0,5);
rr = random(0,5);
rx = random(-3,3);
ry = random(-3,3);
playlooped("walk.wav");
setcharani("walk",NULL);
move(rx,ry,r,4+8+16);
sleep(r);
stopsound("walk.wav");
setcharani("idle",NULL);
setTimer(rr);
}


^^ :cool: :noob:

contiga
09-25-2006, 03:50 PM
This doesn't fix my bug.. :(

Yen
09-25-2006, 03:53 PM
move()'s movement is handled on the clientside.
When the move() time runs out, it updates the position on the serverside.

You'll have to trigger the server .05 or .1 seconds after it finishes moving, or schedule an event in the serverside to be called when it finishes moving.

Jackel9
09-25-2006, 04:04 PM
server lag

Twinny
09-25-2006, 04:07 PM
if (movementfinished) {

not sure what that is in GS2...or if it is actually real x_x. Saw it used in a script but I can't say whether it worked or not.

contiga
09-25-2006, 05:19 PM
move()'s movement is handled on the clientside.
When the move() time runs out, it updates the position on the serverside.

You'll have to trigger the server .05 or .1 seconds after it finishes moving, or schedule an event in the serverside to be called when it finishes moving.

1. Wouldn't that cause lag?
2. I'm using move() serverside, and double clicking action is clientside.

I tried this:
Serverside (when movement was done);
this.attr[ 20] = this.x;
this.attr[ 21] = this.y;
Clientside;
triggerAction( this.attr[ 20] + 1, this.attr[ 21] + 1,.....

But it did not work.

ApothiX
09-25-2006, 05:52 PM
*cough* Outdated function *cough* just use the this.x+(movement)*speed or whatever and update the timing so its smoother.
Uhh, don't know what you're smoking, but updating the position of an NPC Serverside in a timeout or for loop would lag. Which is why the move() function is used in the first place.

Your little x+(movement)*speed is what is outdated. That is how it was done before the NPC Server was introduced.

ZeroTrack
09-30-2006, 04:34 AM
Well I was told a long time ago to stop using it cause
A. It was buggy as heck
B. It was going to be outdated

So from that point on I just wrote all custom movement, this was going back to like Enigma when it was only me a Warcaptain making things on there.