Jump to content
  • 0
Sign in to follow this  
A Duck Tale

Custom models not loading

Question

So as the title suggest my custom models are not loading. I'm fair sure it has to do with either the model being broken/corrupt(although you can open it up in a model editor just fine), that the model loader is outdated(which i have no idea where to even begin upgrading it) or something else that I haven't considered/known of.

Callisto example:

What it looks like currently in game: [url]http://imgur.com/LJSZaos[/url]

EntityDef.java code:
[CODE]
case 9000:
entityDef.actions = new String[5];
entityDef.actions[1] = "Attack";
entityDef.anIntArray94 = new int[1];
entityDef.anIntArray94[0] = 13245; //ID of .dat File
entityDef.anInt77 = 4919; //STAND ANIM
entityDef.anInt67 = 4923; //WALK ANIM
entityDef.combatLevel = 470;
entityDef.name = "Callisto";
entityDef.description = "I wouldn't want to eat his Porridge.".getBytes();
break;[/CODE]

Code in client.java(client sided):
[CODE]
drawLoadingText(60, "Connecting to update server");
onDemandFetcher = new OnDemandFetcher();
onDemandFetcher.start(streamLoader_6, this);
Model.method459(onDemandFetcher.getModelCount(), onDemandFetcher);
preloadModels(); //THIS LINE
//models();
drawLoadingText(80, "Unpacking media");
[/CODE]

and :
[CODE]
public void preloadModels() {
File file = new File("./cache/Raw/");
File[] fileArray = file.listFiles();
for(int y = 0; y < fileArray.length; y++) {
String s = fileArray[y].getName();
byte[] buffer = ReadFile("./cache/Raw/"+s);
Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
System.out.println("Loaded model " + y);
}
}
[/CODE]
The console output prints out that its loaded Callisto's file...

code in Model.method460:

[CODE]

public static void method460(byte abyte0[], int j)
{ //Items
//boolean newFormat = abyte0[abyte0.length - 1] == -1 && abyte0[abyte0.length - 2] == -1;
if(abyte0 == null)
{
Class21 class21 = aClass21Array1661[j] = new Class21();
class21.anInt369 = 0;
class21.anInt370 = 0;
class21.anInt371 = 0;
return;
}
Stream stream = new Stream(abyte0);
stream.currentOffset = abyte0.length - 18;//(!newFormat ? 18 : 23);
Class21 class21_1 = aClass21Array1661[j] = new Class21();
class21_1.aByteArray368 = abyte0;
class21_1.anInt369 = stream.readUnsignedWord();
class21_1.anInt370 = stream.readUnsignedWord();
class21_1.anInt371 = stream.readUnsignedByte();
int k = stream.readUnsignedByte();
int l = stream.readUnsignedByte();
int i1 = stream.readUnsignedByte();
int j1 = stream.readUnsignedByte();
int k1 = stream.readUnsignedByte();
//if (newFormat) {
// int ignore = stream.readUnsignedByte();
// }
int l1 = stream.readUnsignedWord();
int i2 = stream.readUnsignedWord();
int j2 = stream.readUnsignedWord();
int k2 = stream.readUnsignedWord();

// if (newFormat) {
// int ignore = stream.readUnsignedByte();
// }
int l2 = 0;
class21_1.anInt372 = l2;
l2 += class21_1.anInt369;
class21_1.anInt378 = l2;
l2 += class21_1.anInt370;
class21_1.anInt381 = l2;
if(l == 255)
l2 += class21_1.anInt370;
else
class21_1.anInt381 = -l - 1;
class21_1.anInt383 = l2;
if(j1 == 1)
l2 += class21_1.anInt370;
else
class21_1.anInt383 = -1;
class21_1.anInt380 = l2;
if(k == 1)
l2 += class21_1.anInt370;
else
class21_1.anInt380 = -1;
class21_1.anInt376 = l2;
if(k1 == 1)
l2 += class21_1.anInt369;
else
class21_1.anInt376 = -1;
class21_1.anInt382 = l2;
if(i1 == 1)
l2 += class21_1.anInt370;
else
class21_1.anInt382 = -1;
class21_1.anInt377 = l2;
l2 += k2;
class21_1.anInt379 = l2;
l2 += class21_1.anInt370 * 2;
class21_1.anInt384 = l2;
l2 += class21_1.anInt371 * 6;
class21_1.anInt373 = l2;
l2 += l1;
class21_1.anInt374 = l2;
l2 += i2;
class21_1.anInt375 = l2;
l2 += j2;
}
[/CODE]

I've checked with other client source files and it seems to look pretty much the same. So Im not sure what to do or where to go to come up with my solution as of now. Any links to threads,advice or suggestions would be greatly appreciated. Edited by A Duck Tale

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Have you re-loaded the models in cache/raw did you add the models there? When it's not displaying it means that it can't read the model.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Fuzen Seth']Have you re-loaded the models in cache/raw did you add the models there? When it's not displaying it means that it can't read the model.[/QUOTE]

Alright, thanks, so it is to do with it not being able to read the model. I haven't 're-loaded' the models in Raw file yet,but ill look into it. cheers :) Edited by A Duck Tale

Share this post


Link to post
Share on other sites
  • 0
Thanks a lot mate, looks useful im sure someone will help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×