Originally Posted by
durky
bump
You packed both seq and spot anim? Don't know why it would matter but i had this issue before what you also need to do is use what I include below and replace your readvalues, good luck.
https://hastebin.com/mazenozeke.cs
Read values from my client loading 160 data (contained inside the full class above this)
Seq.dat
Code:
private void decode(Buffer stream) {
int opcode;
while ((opcode = stream.readUnsignedByte()) != 0) {
if (opcode == 1) {
frameCount = stream.readUShort();
primaryFrames = new int[frameCount];
secondaryFrames = new int[frameCount];
durations = new int[frameCount];
for (int i = 0; i < frameCount; i++) {
primaryFrames[i] = stream.readInt();
secondaryFrames[i] = -1;
}
for (int i = 0; i < frameCount; i++) {
durations[i] = stream.readUnsignedByte();
}
} else if (opcode == 2) {
loopOffset = stream.readUShort();
} else if (opcode == 3) {
int length = stream.readUnsignedByte();
interleaveOrder = new int[length + 1];
for (int i = 0; i < length; i++) {
interleaveOrder[i] = stream.readUnsignedByte();
}
interleaveOrder[length] = 9999999;
} else if (opcode == 4) {
stretches = true;
} else if (opcode == 5) {
forcedPriority = stream.readUnsignedByte();
} else if (opcode == 6) {
rightHand = stream.readUShort();
} else if (opcode == 7) {
leftHand = stream.readUShort();
} else if (opcode == 8) {
maximumLoops = stream.readUnsignedByte();
} else if (opcode == 9) {
animatingPrecedence = stream.readUnsignedByte();
} else if (opcode == 10) {
priority = stream.readUnsignedByte();
} else if (opcode == 11) {
replayMode = stream.readUnsignedByte();
} else if (opcode == 12) {
stream.readInt();
} else {
System.out.println("Error unrecognised seq config code: " + opcode);
}
}
spotanim.dat
Code:
public void decode(Buffer buffer) {
while (true) {
int opcode = buffer.readUnsignedByte();
if (opcode == 0) {
return;
} else if (opcode == 1) {
modelId = buffer.readUShort();
} else if (opcode == 2) {
animationId = buffer.readUShort();
if (Animation.animations != null) {
animationSequence = Animation.animations[animationId];
}
} else if (opcode == 4) {
resizeXY = buffer.readUShort();
} else if (opcode == 5) {
resizeZ = buffer.readUShort();
} else if (opcode == 6) {
rotation = buffer.readUShort();
} else if (opcode == 7) {
modelBrightness = buffer.readUShort();
} else if (opcode == 8) {
modelShadow = buffer.readUShort();
} else if (opcode == 40) {
int length = buffer.readUnsignedByte();
for (int i = 0; i < length; i++) {
originalModelColours[i] = buffer.readUShort();
modifiedModelColours[i] = buffer.readUShort();
}
} else {
System.out.println("Error unrecognised spotanim config code: "
+ opcode);
}
}
}