Quote:
Originally Posted by Crono
on zodiac if you go into a dungeon and the person hasn't moved yet you don't see them in their real positions 
|
Going need instructions to replicate it, because I've been unsuccessful.
Also... Plug-n-play Player Movement Interpolation system. Obviously customize isOn() to suit your server's needs.
PHP Code:
//#CLIENTSIDE
function onPlayerEnters() {
if (isOn()) {
checkLevelChange();
onTimeout();
}
}
function isOn() {
return !client.option_disableinterpolation;
}
function onTimeout() {
if (isOn()) {
if (this.oTimerVar == 0) this.oTimeVar = timevar2-.05;
this.frameTime = timevar2-this.oTimeVar;
this.oTimeVar = timevar2;
saveOldPos();
lerpPlayers();
setTimer(0.05);
}
}
function checkLevelChange() {
if (player.level.name != this.oldLevel) {
for (pl : players) {
pl.lerp = 0;
pl.oldX = pl.newX = pl.x;
pl.oldY = pl.newY = pl.y;
}
this.oldLevel = player.level.name;
this.forceupdate = true;
}
}
function saveOldPos() {
for (pl : players) {
if (pl == player) continue;
if (pl.lerp > 0) continue;
temp.update = this.forceupdate;
if (pl.x != pl.oldX) {
pl.oldX = pl.newX;
pl.newX = pl.x;
temp.update = true;
}
if (pl.y != pl.oldY) {
pl.oldY = pl.newY;
pl.newY = pl.y;
temp.update = true;
}
if (temp.update) {
temp.distX = abs(pl.newX-pl.oldX);
temp.distY = abs(pl.newY-pl.oldY);
if ((temp.distX > .25 || temp.distY > .25) && (temp.distX < 2 && temp.distY < 2)) {
pl.doLerp = true;
pl.oldPacketTime = pl.newPacketTime;
pl.newPacketTime = timevar2;
pl.lerpDiv = pl.newPacketTime-pl.oldPacketTime;
pl.lerp = 1;
} else {
pl.doLerp = false;
}
}
}
if (this.forceupdate) this.forceupdate = false;
}
function lerpPlayers() {
for (pl : players) {
if (pl == player) continue;
if (!pl.doLerp) continue;
if (pl.lerp >= -.5) {
pl.lerp -= .5;
pl.x = linearInterpolateValue(pl.oldX, pl.newX, abs(1-pl.lerp));
pl.y = linearInterpolateValue(pl.oldY, pl.newY, abs(1-pl.lerp));
}
}
}
function linearInterpolateValue(temp.ov, temp.nv, temp.l) {
return (temp.ov*(1-temp.l)+temp.nv*temp.l);
}