Thread: Loading custom player models

Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 113
  1. #1 Loading custom player models 
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    Edit: The unpackConfig error has been fixed, Now it won't need you to replace.

    GTFO THIS TOPIC IF YOU FULFIL ANY OF THESE:
    Code:
    0 Creativity
    Faggot
    Wannabe Rs Leacher
    Flamer
    Leacher
    McDonalds worker
    The Tech Guys worker
    Please don'tpost.
    Purpose: To add custom character model chunks, and maybe finally get some creativity in rsps. This will pack it into the cache, So should you EVER decide you dont like the things, just set customChunks to 0, save compile and run, let it load and replace ur IDK with the original one. You will be able to do this:

    Difficulty: 4/10?
    Assumed Knowledge: Refactoring values, making values static
    Classes Modified: IDK.java
    Refactored/Non-Refactored?: Refactored
    First, Backup your IDK.java and cache(this IS important, miss this and u cud regret it), Then follow these steps:
    Step 1:
    Replace your readValues(Stream stream) method with this
    Code:
        private void readValues(Stream stream) {
            do {
                int i = stream.readUnsignedByte();
                randval1 = i;
                if (i == 0)
                    return;
                if (i == 1)
                    partID = stream.readUnsignedByte();
                else if (i == 2) {
                    int j = stream.readUnsignedByte();
                    randval2 = j;
                    models = new int[j];
                    for (int k = 0; k < j; k++)
                        models[k] = stream.readUnsignedWord();
    
                } else if (i == 3)
                    noInterface = true;
                else if (i >= 40 && i < 50)
                    originalModelColor[i - 40] = stream.readUnsignedWord();
                else if (i >= 50 && i < 60)
                    reassignedModelColor[i - 50] = stream.readUnsignedWord();
                else if (i >= 60 && i < 70)
                    headModels[i - 60] = stream.readUnsignedWord();
                else
                    System.out.println("Error unrecognised config code: " + i);
            } while (true);
        }
    Step 2:
    Declare this:
    Code:
        public void readValues(int i) {
             switch (i) {
                 case 1:
                     models = new int[1];
                     models[0] = 3;
                     headModels[0] = 3;
                     noInterface = false;
                     partID = 0;
                 break;
             }
        }
    Step 3:
    Replace your unpackConfig method with this:
    Code:
        public static void unpackConfig(StreamLoader streamLoader) {
            Stream stream = new Stream(streamLoader.getDataForName("idk.dat"));
    	int olength = stream.readUnsignedWord(); 
            length = olength+customChunks;
            if (cache == null)
                cache = new IDK[length];
            for (int j = 0; j < olength; j++) {
                if (cache[j] == null)
                    cache[j] = new IDK();
                cache[j].readValues(stream);
            }
            for (int j = olength; j < customChunks+olength; j++){
                if (cache[j+olength] == null)
                    cache[j+olength] = new IDK();
                cache[j+0length].readValues(j);
            }
        }
    Step 4:
    Declare these somewhere near the bottom of the class
    Code:
        public int randval1;
        public int randval2;
    Step 5:
    And declare this somewhere easy to remember:
    Code:
    public static int customChunks = 1;
    Step 6:
    Rename these values
    Code:
    Origional - New
    aBoolean662 - noInterface
    anIntArray661 - headModels
    anIntArray660 - reassignedModelColor
    anIntArray659 - originalModelColor
    anIntArray658 - models
    Step 7:
    Make variable 'length' static

    Ok now then, for every new one you add, increase customChunks by 1
    Now a run through

    Lets look back to
    Code:
    public void readValues(int i) {
    In there, you should see the following:
    Code:
                 case 1:
                     models = new int[1];
                     models[0] = 3;
                     headModels[0] = 3;
                     noInterface = false;
                     partID = 0;
                 break;
    That is the basic one, really no recolours etc
    Code:
    models[0] = 3;
    3 is the model id, you can add more but you need to change the length of it (in the line above it)
    Code:
    headModels[0] = 3;
    This is the head model (on the chat interface box for dialogues), This ONLY applies to heads and the center should be at x=y=z=0
    Code:
    partID = 0;
    This is what type the part is.
    Here is a list of them
    Code:
    0 - Male head
    1 - Male jaw
    2 - Male torso
    3 - Male arms
    4 - Male hands
    5 - Male legs
    6 - Male feet
    7 - Female head
    8 - Female jaw
    9 - Female Torso
    10 - Female Arms
    11 - Female hands
    12 - Female legs
    13 - Female feet
    Code:
    noInterface = false;
    If this is set to true, then it will not load on the character design interface.
    If this is set to false, It will show up on the character design interface.
    By default this should be true.
    Now thats that, get creating
    Credits
    99% Me - For making it
    1% Jagex - For giving us this file structure of IDK.dat

    Example:
    Shirtless peoples (Credits to Slay No More seeing as he will cry until he gets credits)
    Code:
    case 0: // MALE
    originalModelColor = new int[4];
    reassignedModelColor = new int[4];
    originalModelColor[0] = 43072;
    reassignedModelColor[0] = 4550;
    originalModelColor[1] = 7056;
    reassignedModelColor[1] = 8741;
    originalModelColor[2] = 22416;
    reassignedModelColor[2] = 4550;
    originalModelColor[3] = 22424;
    reassignedModelColor[3] = 4550;
                     models = new int[1];
                     models[0] = 11390;
    partID = 2;
    noInterface = false;
    break;
    case 1:// FEMALE
    originalModelColor = new int[4];
    reassignedModelColor = new int[4];
    originalModelColor[0] = 43072;
    reassignedModelColor[0] = 4550;
    originalModelColor[1] = 7056;
    reassignedModelColor[1] = 8741;
    originalModelColor[2] = 22416;
    reassignedModelColor[2] = 4550;
    originalModelColor[3] = 22424;
    reassignedModelColor[3] = 4550;
                     models = new int[1];
                     models[0] = 1030;
    partID = 9;
    noInterface = false;
    break;
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member
    DaraX's Avatar
    Join Date
    Apr 2009
    Posts
    1,183
    Thanks given
    18
    Thanks received
    29
    Rep Power
    262
    What does this do exactly?
    Reply With Quote  
     

  4. #3  
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    ... Look over it genius. Its not rocket science
    Reply With Quote  
     

  5. #4  
    Registered Member
    DaraX's Avatar
    Join Date
    Apr 2009
    Posts
    1,183
    Thanks given
    18
    Thanks received
    29
    Rep Power
    262
    Quote Originally Posted by Avatar Realms View Post
    ... Look over it genius. Its not rocket science
    Don't need to be sarcastic, I just looked at it quickly, I thought it was something like replacing weapon models or something.
    Reply With Quote  
     

  6. #5  
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    Ok lol, Its so you can have custom character models EG torso (not like fighter torso or w/e but infact starting clothes)
    This could be used to make people be able to have 6 packs or anything.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Jan 2009
    Posts
    400
    Thanks given
    25
    Thanks received
    18
    Rep Power
    21
    Excuse my language.

    But..


    FUCKING PRO.
    I needed this like 2 months ago.

    Tysssm.

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

  8. #7  
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    @Abbyys
    The reason i made this is because i wanted this aswell, and i asked loads of people if they had it (including yarnova) who said no. Yarnova did help me, so i do give some credits to him for the old ids. hopefully more replies or im gunna remove assuming people leached.
    Reply With Quote  
     

  9. #8  
    Registered Member

    Join Date
    Feb 2009
    Age
    24
    Posts
    2,851
    Thanks given
    90
    Thanks received
    216
    Discord
    View profile
    Rep Power
    675
    I LOVE IT! Thankyou! Now all I need is a decent model xD
    Reply With Quote  
     

  10. #9  
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    lmao i found the models for ghostly torags and a mine cart for boots
    Reply With Quote  
     

  11. #10  
    Donator


    Join Date
    Sep 2007
    Age
    24
    Posts
    2,430
    Thanks given
    127
    Thanks received
    508
    Rep Power
    386
    Post or i remove. Simple as
    Reply With Quote  
     

Page 1 of 12 12311 ... 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
  •