Thread: Custom model loading on 508 client fixed version (same for all versions)

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 58
  1. #1 Custom model loading on 508 client fixed version (same for all versions) 
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Put the old version not working down to my carelessness in writing it, i forgot to set the model array to null so it never bothered loading lol =\.

    Anyway;

    To find the model class you need to use windows grep and search;

    Code:
    - 1] == -1 &&
    Right, so you may get a few classes but you can find the model loading yourself, so anyway, here is the 508 class;

    Class1_Sub4.

    Right, the model loading in new RuneScape client's dosn't use 2 method's for 1 type of model like 317, it loads either new header or old.

    So, the actual model method is;

    Code:
    public Class1_Sub4(byte[] is) {
    	if (is[is.length - 1] == -1 && is[is.length - 2] == -1)
    	    method108(is);
    	else
    	    method126(is);
        }
    This is a refactored version;

    Code:
    public Model(byte[] modelBytes) {
    	if (modelBytes[modelBytes.length - 1] == -1 && modelBytes[modelBytes.length - 2] == -1)
    	    loadNewFormat(modelBytes);
    	else
    	    loadOldFormat(modelBytes);
        }
    Now, let's make the loader.

    Make a new class called "ModelLoader.java";

    Add this into it;

    Code:
    import java.io.*;
    import java.util.*;
    
    public class ModelLoader {
    
    	public static List<Integer> models = null;
    
    	public ModelLoader()
    	{
    		loadArray();
    	}
    
    	public static byte[] loadNewModel(int i) throws IOException
    	{
    		DataInputStream dis = new DataInputStream(new FileInputStream("./models/"+i+".dat"));
    		byte[] buffer = new byte[(int) new File("./models/"+i+".dat").length()];
    		dis.readFully(buffer);
    		dis.close();
    		return buffer;
    	}
    
    	public void loadArray()
    	{
    		models = new ArrayList<Integer>();
    		File[] m = new File("./models").listFiles();
    		for (File model : m)
    			if(model.getName().contains(".dat"))
    				models.add(Integer.parseInt(model.getName().substring(0, model.getName().indexOf(".dat"))));
    	}
    
    }
    Now, in your model class find this;

    Code:
    public static Class1_Sub4 method115(Class21 class21, int i, int i_160_) {
    	byte[] is = class21.method338(i_160_, 0, i);
    	if (is == null)
    	    return null;
    	return new Class1_Sub4(is);
        }
    You would change it to something like this;

    Code:
    public static Class1_Sub4 method115(Class21 class21, int i, int i_160_) {
    	try {
    		if(ModelLoader.models == null)
    			new ModelLoader();
    		for (int modelStored : ModelLoader.models)
    			if(modelStored == i)
    				return new Class1_Sub4(ModelLoader.loadNewModel(modelStored));
    		byte[] is = class21.method338(i_160_, 0, i);
    		if (is == null)
    			return null;
    		return new Class1_Sub4(is);
    	} catch(Exception e) {
    		e.printStackTrace();
    	}
    	return null;
    }
    Now, make a new folder called models, add in old Rs model's or whatever, then in the ModelLoader class add more of these in loadArray();

    You can let the loadArrays read the file and do it itself, but if it dosn't work for any reason you can add new models via that method using;

    models.add(YOURIDHERE);

    Another way would to be replace your "loadArray" method with this;

    Then compile and run and you will load the model's you chose.

    If you want to load old characters i posted a list in RSClient 317 section in config of every model.

    Remember, don't gzip the models.

    Here's a picture of what you can do, this is a custom model released in rs 317 client section;



    And here is dragon claws;





    By loading custom model's you have the same problems as in 317 where parts disapear, but you can load old RuneScape model's perfect, or new ones .


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Donator
    Sonico's Avatar
    Join Date
    May 2008
    Posts
    1,175
    Thanks given
    93
    Thanks received
    65
    Rep Power
    349
    Nice done Zee
    Reply With Quote  
     

  3. #3  
    Koâk
    Guest
    Awesome! Trying out now!

    EDIT: woot it's true
    [Only registered and activated users can see links. ]
    Can you believe it?
    Reply With Quote  
     

  4. #4  
    Apocalyptism
    Harry's Avatar
    Join Date
    Apr 2007
    Posts
    3,783
    Thanks given
    594
    Thanks received
    1,833
    Rep Power
    2934
    yeaaaaa awesome
    ~ Harry
    Please bear this in mind when hearing the word 'soon' from a software programmer.

    As coding software generally takes thousands of years, software programmers have developed a natural adaptation to this in the form of an altered perception of the flow of time.

    Due to this, the word 'soon' when uttered by a programmer should be taken to mean 'a very, very long time from now' in the terminology used by common human specimens who have not developed such an adaptation.
    knowledge can be taught, but passion cannot.
    It's better to create something that others criticise than to create nothing and criticise others.
    Reply With Quote  
     

  5. #5  
    That universal language.
    'Ramon's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    3,026
    Thanks given
    116
    Thanks received
    86
    Rep Power
    3165
    Oh me godddd GJJJJ!!!!!1


    Reply With Quote  
     

  6. #6  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,759
    Thanks given
    221
    Thanks received
    816
    Rep Power
    2113
    omfgomfgomfg zee if i was gay i would kiss u luv tytyty ty

    ---------- Post added at 01:30 PM ---------- Previous post was at 01:29 PM ----------

    btw sticky this
    Reply With Quote  
     

  7. #7  
    Donator

    iZAjz's Avatar
    Join Date
    Mar 2007
    Age
    26
    Posts
    3,675
    Thanks given
    105
    Thanks received
    47
    Rep Power
    1882
    Finnaly

    Thanks for this rep+
    Reply With Quote  
     

  8. #8  
    Apocalyptism
    Harry's Avatar
    Join Date
    Apr 2007
    Posts
    3,783
    Thanks given
    594
    Thanks received
    1,833
    Rep Power
    2934
    hmm still isnt working for me for some reason
    ~ Harry
    Please bear this in mind when hearing the word 'soon' from a software programmer.

    As coding software generally takes thousands of years, software programmers have developed a natural adaptation to this in the form of an altered perception of the flow of time.

    Due to this, the word 'soon' when uttered by a programmer should be taken to mean 'a very, very long time from now' in the terminology used by common human specimens who have not developed such an adaptation.
    knowledge can be taught, but passion cannot.
    It's better to create something that others criticise than to create nothing and criticise others.
    Reply With Quote  
     

  9. #9  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,759
    Thanks given
    221
    Thanks received
    816
    Rep Power
    2113
    nice but i dont understand what i add under loadArray();
    Reply With Quote  
     

  10. #10  
    Gohan.
    Guest
    Ok, i have added all my models in my models folder and added all of this in my classes.
    Now how do i load them?
    Reply With Quote  
     

Page 1 of 6 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •