Show method101?
|
Tried to add tweening to my server..
oh god where did i go wrong
Show method101?
[SPOIL] public void method101(Entity entity) {
if (Configuration.interpolateAnimations) {
entity.aBoolean1541 = false;
if (entity.anInt1517 != -1) {
if (entity.anInt1517 > Animation.anims.length)
entity.anInt1517 = 0;
Animation animation = Animation.anims[entity.anInt1517];
entity.anInt1519++;
if (entity.anInt1518 < animation.anInt352
&& entity.anInt1519 > animation
.method258(entity.anInt1518)) {
entity.anInt1519 = 1;// this is the frame delay. 0 is what
// it's
// normally at. higher number = faster
// animations.
entity.anInt1518++;
entity.nextIdleAnimationFrame++;
}
entity.nextIdleAnimationFrame = entity.anInt1518 + 1;
if (entity.nextIdleAnimationFrame >= animation.anInt352) {
if (entity.nextIdleAnimationFrame >= animation.anInt352)
entity.nextIdleAnimationFrame = 0;
}
if (entity.anInt1518 >= animation.anInt352) {
entity.anInt1519 = 1;
entity.anInt1518 = 0;
}
}
if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
if (entity.anInt1521 < 0)
entity.anInt1521 = 0;
Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
&& entity.anInt1522 > animation_1
.method258(entity.anInt1521); entity.anInt1521++)
entity.anInt1522 -= animation_1.method258(entity.anInt1521);
if (entity.anInt1521 >= animation_1.anInt352
&& (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
entity.anInt1520 = -1;
entity.nextGraphicsAnimationFrame = entity.anInt1521 + 1;
if (entity.nextGraphicsAnimationFrame >= animation_1.anInt352) {
if (entity.nextGraphicsAnimationFrame < 0
|| entity.nextGraphicsAnimationFrame >= animation_1.anInt352)
entity.nextGraphicsAnimationFrame = entity.anInt1521;// this
// work?entity.anInt1520
// =
// -1;
}
}
if (entity.anim != -1 && entity.anInt1529 <= 1) {
Animation animation_2 = Animation.anims[entity.anim];
if (animation_2.anInt363 == 1 && entity.anInt1542 > 0
&& entity.anInt1547 <= loopCycle
&& entity.anInt1548 < loopCycle) {
entity.anInt1529 = 1;
return;
}
}
if (entity.anim != -1 && entity.anInt1529 == 0) {
Animation animation_3 = Animation.anims[entity.anim];
for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
&& entity.anInt1528 > animation_3
.method258(entity.anInt1527); entity.anInt1527++)
entity.anInt1528 -= animation_3.method258(entity.anInt1527);
if (entity.anInt1527 >= animation_3.anInt352) {
entity.anInt1527 -= animation_3.anInt356;
entity.anInt1530++;
if (entity.anInt1530 >= animation_3.anInt362)
entity.anim = -1;
if (entity.anInt1527 < 0
|| entity.anInt1527 >= animation_3.anInt352)
entity.anim = -1;
}
entity.nextAnimationFrame = entity.anInt1527 + 1;
if (entity.nextAnimationFrame >= animation_3.anInt352) {
if (entity.anInt1530 >= animation_3.anInt362)
entity.nextAnimationFrame = entity.anInt1527 + 1;
if (entity.nextAnimationFrame < 0
|| entity.nextAnimationFrame >= animation_3.anInt352)
entity.nextAnimationFrame = entity.anInt1527;
}
entity.aBoolean1541 = animation_3.aBoolean358;
}
} else {
entity.aBoolean1541 = false;
if (entity.anInt1517 > Animation.anims.length)
entity.anInt1517 = -1;
if (entity.anInt1517 != -1) {
Animation animation = Animation.anims[entity.anInt1517];
entity.anInt1519++;
if (animation != null) {
if (entity.anInt1518 < animation.anInt352
&& entity.anInt1519 > animation
.method258(entity.anInt1518)) {
// entity.anInt1519 = 1;
entity.anInt1519 = 0;
entity.anInt1518++;
}
if (entity.anInt1518 >= animation.anInt352) {
entity.anInt1519 = 0;
entity.anInt1518 = 0;
}
}
}
if (entity.anInt1520 != -1 && loopCycle >= entity.anInt1523) {
if (entity.anInt1521 < 0)
entity.anInt1521 = 0;
Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
if (animation_1 != null) {
for (entity.anInt1522++; entity.anInt1521 < animation_1.anInt352
&& entity.anInt1522 > animation_1
.method258(entity.anInt1521); entity.anInt1521++)
entity.anInt1522 -= animation_1
.method258(entity.anInt1521);
if (entity.anInt1521 >= animation_1.anInt352
&& (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
entity.anInt1520 = -1;
}
}
if (entity.anim != -1 && entity.anInt1529 <= 1) {
Animation animation_2 = Animation.anims[entity.anim];
if (animation_2 != null && animation_2.anInt363 == 1
&& entity.anInt1542 > 0
&& entity.anInt1547 <= loopCycle
&& entity.anInt1548 < loopCycle) {
entity.anInt1529 = 1;
return;
}
}
if (entity.anim != -1 && entity.anInt1529 == 0) {
Animation animation_3 = Animation.anims[entity.anim];
for (entity.anInt1528++; entity.anInt1527 < animation_3.anInt352
&& entity.anInt1528 > animation_3
.method258(entity.anInt1527); entity.anInt1527++)
entity.anInt1528 -= animation_3.method258(entity.anInt1527);
if (entity.anInt1527 >= animation_3.anInt352) {
entity.anInt1527 -= animation_3.anInt356;
entity.anInt1530++;
if (entity.anInt1530 >= animation_3.anInt362)
entity.anim = -1;
if (entity.anInt1527 < 0
|| entity.anInt1527 >= animation_3.anInt352)
entity.anim = -1;
}
entity.aBoolean1541 = animation_3.aBoolean358;
}
}
if (entity.anInt1529 > 0)
entity.anInt1529--;
}[/SPOIL]
this is where i start running into issues.. this is from my method452 in the player class, here's my method164 from my entitydef without touching anything
[SPOIL] public Model method164(int j, int k, int ai[]) { //dis one
if (childrenIDs != null) {
EntityDef entityDef = method161();
if (entityDef == null)
return null;
else
return entityDef.method164(j, k, ai);
}
Model model = (Model) mruNodes.insertFromCache(interfaceType);
if (model == null) {
boolean flag = false;
for (int i1 = 0; i1 < anIntArray94.length; i1++)
if (!Model.method463(anIntArray94[i1]))
flag = true;
if (flag)
return null;
Model aclass30_sub2_sub4_sub6s[] = new Model[anIntArray94.length];
for (int j1 = 0; j1 < anIntArray94.length; j1++)
aclass30_sub2_sub4_sub6s[j1] = Model
.method462(anIntArray94[j1]);
if (aclass30_sub2_sub4_sub6s.length == 1)
model = aclass30_sub2_sub4_sub6s[0];
else
model = new Model(aclass30_sub2_sub4_sub6s.length,
aclass30_sub2_sub4_sub6s);
if (originalColors != null) {
for (int k1 = 0; k1 < originalColors.length; k1++)
model.method476(originalColors[k1], newColors[k1]);
}
model.method469();
model.method479(64 + anInt85, 850 + anInt92, -30, -50, -30, true);
mruNodes.removeFromCache(model, interfaceType);
}
Model model_1 = Model.aModel_1621;
model_1.method464(model, Class36.method532(k) & Class36.method532(j));
if (k != -1 && j != -1)
model_1.method471(ai, j, k);
else if (k != -1)
model_1.method470(k);
if (anInt91 != 128 || anInt86 != 128)
model_1.method478(anInt91, anInt91, anInt86);
model_1.method466();
model_1.anIntArrayArray1658 = null;
model_1.anIntArrayArray1657 = null;
if (aByte68 == 1)
model_1.aBoolean1659 = true;
return model_1;
}
private void readValues(Stream stream) {
do {
int opcode = stream.readUnsignedByte();
if(opcode == 0)
return;
if(opcode == 1) {
int j = stream.readUnsignedByte();
anIntArray94 = new int[j];
for(int j1 = 0; j1 < j; j1++)
anIntArray94[j1] = stream.readUnsignedWord();
} else if(opcode == 2)
name = stream.readString();
else if(opcode == 3)
description = stream.readString();
else if(opcode == 12)
aByte68 = stream.readSignedByte();
else if(opcode == 13)
standAnim = stream.readUnsignedWord();
else if(opcode == 14)
walkAnim = stream.readUnsignedWord();
else if(opcode == 17) {
walkAnim = stream.readUnsignedWord();
anInt58 = stream.readUnsignedWord();
anInt83 = stream.readUnsignedWord();
anInt55 = stream.readUnsignedWord();
} else if(opcode >= 30 && opcode < 40) {
if(actions == null)
actions = new String[5];
actions[opcode - 30] = stream.readString();
if(actions[opcode - 30].equalsIgnoreCase("hidden"))
actions[opcode - 30] = null;
} else if(opcode == 40) {
int k = stream.readUnsignedByte();
originalColors = new int[k];
newColors = new int[k];
for(int k1 = 0; k1 < k; k1++) {
originalColors[k1] = stream.readUnsignedWord();
newColors[k1] = stream.readUnsignedWord();
}
} else if(opcode == 60) {
int l = stream.readUnsignedByte();
anIntArray73 = new int[l];
for(int l1 = 0; l1 < l; l1++)
anIntArray73[l1] = stream.readUnsignedWord();
} else if(opcode == 93)
aBoolean87 = false;
else if(opcode == 95)
combatLevel = stream.readUnsignedWord();
else if(opcode == 97)
anInt91 = stream.readUnsignedWord();
else if(opcode == 98)
anInt86 = stream.readUnsignedWord();
else if(opcode == 99)
aBoolean93 = true;
else if(opcode == 100)
anInt85 = stream.readSignedByte();
else if(opcode == 101)
anInt92 = stream.readSignedByte();
else if(opcode == 102)
anInt75 = stream.readSignedByte();
else if(opcode == 103)
anInt79 = stream.readSignedByte();
else if(opcode == 106) {
anInt57 = stream.readUnsignedWord();
if(anInt57 == 65535)
anInt57 = -1;
anInt59 = stream.readUnsignedWord();
if(anInt59 == 65535)
anInt59 = -1;
int i1 = stream.readUnsignedByte();
childrenIDs = new int[i1 + 1];
for(int i2 = 0; i2 <= i1; i2++) {
childrenIDs[i2] = stream.readUnsignedWord();
if(childrenIDs[i2] == 65535)
childrenIDs[i2] = -1;
}
} else if(opcode == 107)
aBoolean84 = false;
} while(true);
}[/SPOIL]
Maybe that has something to do with the animations being faster then they are suppose to be try setting it to 0.Code:entity.anInt1519 = 1;// this is the frame delay. 0 is what // it's // normally at. higher number = faster // animations.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |