Thread: OSRS Overlay & Underlay support

Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 43
  1. #21  
    Registered Member
    Join Date
    Aug 2016
    Posts
    81
    Thanks given
    5
    Thanks received
    24
    Rep Power
    56
    Quote Originally Posted by Zion View Post
    yh, more people need to see this aha.
    errors on vencillio client:

    Attached image
    Attached image
    Attached image
    Reply With Quote  
     

  2. #22  
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    Quote Originally Posted by manures View Post
    errors on vencillio client:

    Attached image
    Attached image
    Attached image
    oh damn
    Reply With Quote  
     

  3. #23  
    Registered Member
    Join Date
    Aug 2016
    Posts
    81
    Thanks given
    5
    Thanks received
    24
    Rep Power
    56
    Quote Originally Posted by Zion View Post
    oh damn
    fix?
    Reply With Quote  
     

  4. #24  
    Registered Member

    Join Date
    Nov 2014
    Posts
    120
    Thanks given
    1
    Thanks received
    32
    Rep Power
    80
    if you use this and want snow on the ground:

    Code:
    import java.nio.ByteBuffer;
    
    public class FloorDefinition {
    
        public static FloorDefinition[] overlays;
        public static FloorDefinition[] underlays;
    
        public int texture;
        public int rgb;
        public boolean occlude;
        public int anotherRgb;
    
        public int hue;
        public int saturation;
        public int lumiance;
    
        public int anotherHue;
        public int anotherSaturation;
        public int anotherLuminance;
    
        public int blendHue;
        public int blendHueMultiplier;
        public int hsl16;
        
        private FloorDefinition() {
        	texture = -1;
        	occlude = true;
        }
    
        public static void unpackConfig(StreamLoader streamLoader) {
            ByteBuffer buffer = ByteBuffer.wrap(streamLoader.getDataForName("flo.dat"));
            int underlayAmount = buffer.getShort();
            System.out.println("Underlay Floors Loaded: "+underlayAmount);
            underlays = new FloorDefinition[underlayAmount];
            for (int i = 0; i < underlayAmount; i++) {
                if (underlays[i] == null) {
                    underlays[i] = new FloorDefinition();
                }
                underlays[i].readValuesUnderlay(buffer);
                underlays[i].generateHsl(true);
            }
            int overlayAmount = buffer.getShort();
            System.out.println("Overlay Floors Loaded: "+overlayAmount);
            overlays = new FloorDefinition[overlayAmount];
            for (int i = 0; i < overlayAmount; i++) {
                if (overlays[i] == null) {
                    overlays[i] = new FloorDefinition();
                }
                overlays[i].readValuesOverlay(buffer);
                overlays[i].generateHsl(false);
            }
        }
    
        private void generateHsl(boolean underlay) {
            if (anotherRgb != -1) {
                rgbToHsl(anotherRgb);
                anotherHue = hue;
                anotherSaturation = saturation;
                anotherLuminance = lumiance;
            }
    		boolean snow = true;
    		int color = underlay && snow ? 0xFFFFFF : rgb;
            rgbToHsl(color);
        }
    
        private void readValuesUnderlay(ByteBuffer buffer) {
            for (;;) {
                int opcode = buffer.get();
                if (opcode == 0) {
                    break;
                } else if (opcode == 1) {
                    rgb = ((buffer.get() & 0xff) << 16) + ((buffer.get() & 0xff) << 8) + (buffer.get() & 0xff);
                } else {
                    System.out.println("Error unrecognised underlay code: " + opcode);
                }
            }
        }
    
        private void readValuesOverlay(ByteBuffer buffer) {
            for (;;) {
                int opcode = buffer.get();
                if (opcode == 0) {
                    break;
                } else if (opcode == 1) {
                    rgb = ((buffer.get() & 0xff) << 16) + ((buffer.get() & 0xff) << 8) + (buffer.get() & 0xff);
                } else if (opcode == 2) {
                    texture = buffer.get() & 0xff;
                } else if (opcode == 5) {
                    occlude = false;
                } else if (opcode == 7) {
                    anotherRgb = ((buffer.get() & 0xff) << 16) + ((buffer.get() & 0xff) << 8) + (buffer.get() & 0xff);
                } else {
                    System.out.println("Error unrecognised overlay code: " + opcode);
                }
            }
        }
    
        private void rgbToHsl(int rgb) {
            double r = (rgb >> 16 & 0xff) / 256.0;
            double g = (rgb >> 8 & 0xff) / 256.0;
            double b = (rgb & 0xff) / 256.0;
            double min = r;
            if (g < min) {
                min = g;
            }
            if (b < min) {
                min = b;
            }
            double max = r;
            if (g > max) {
                max = g;
            }
            if (b > max) {
                max = b;
            }
            double h = 0.0;
            double s = 0.0;
            double l = (min + max) / 2.0;
            if (min != max) {
                if (l < 0.5) {
                    s = (max - min) / (max + min);
                }
                if (l >= 0.5) {
                    s = (max - min) / (2.0 - max - min);
                }
                if (r == max) {
                    h = (g - b) / (max - min);
                } else if (g == max) {
                    h = 2.0 + (b - r) / (max - min);
                } else if (b == max) {
                    h = 4.0 + (r - g) / (max - min);
                }
            }
            h /= 6.0;
            hue = (int) (h * 256.0);
            saturation = (int) (s * 256.0);
            lumiance = (int) (l * 256.0);
            if (saturation < 0) {
                saturation = 0;
            } else if (saturation > 255) {
                saturation = 255;
            }
            if (lumiance < 0) {
                lumiance = 0;
            } else if (lumiance > 255) {
                lumiance = 255;
            }
            if (l > 0.5) {
                blendHueMultiplier = (int) ((1.0 - l) * s * 512.0);
            } else {
                blendHueMultiplier = (int) (l * s * 512.0);
            }
            if (blendHueMultiplier < 1) {
                blendHueMultiplier = 1;
            }
            blendHue = (int) (h * blendHueMultiplier);
            hsl16 = hsl24to16(hue, saturation, lumiance);
        }
    
        private final static int hsl24to16(int h, int s, int l) {
            if (l > 179) {
                s /= 2;
            }
            if (l > 192) {
                s /= 2;
            }
            if (l > 217) {
                s /= 2;
            }
            if (l > 243) {
                s /= 2;
            }
            return (h / 4 << 10) + (s / 32 << 7) + l / 2;
        }
    }
    Reply With Quote  
     

  5. #25  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    I got this loading the floor for my kraken and zulrah map flawlessly, which I'd like to thank you a lot for.
    However then I go to Cerberus and the entire floor is black, any idea mate?
    Also I'm not 100% sure what anInt399 translates to.
    Ignore the objects, I haven't gotten around to fixing them just yet.

    Before after for kraken:
    Attached image

    Cerberus:
    Attached image

    Also worth noting areas like varrock, edgeville floor loads fine.

    @Zion
    Reply With Quote  
     

  6. #26  
    Registered Member

    Join Date
    Nov 2014
    Posts
    120
    Thanks given
    1
    Thanks received
    32
    Rep Power
    80
    Quote Originally Posted by Stevenhax View Post
    I got this loading the floor for my kraken and zulrah map flawlessly, which I'd like to thank you a lot for.
    However then I go to Cerberus and the entire floor is black, any idea mate?
    Also I'm not 100% sure what anInt399 translates to.
    Ignore the objects, I haven't gotten around to fixing them just yet.

    Before after for kraken:
    Attached image

    Cerberus:
    Attached image

    Also worth noting areas like varrock, edgeville floor loads fine.

    @Zion
    Um, hard to say. Would you be able to hastiebin your ObjectManager class?
    Reply With Quote  
     

  7. #27  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Quote Originally Posted by Eternal View Post
    Um, hard to say. Would you be able to hastiebin your ObjectManager class?
    Quote Originally Posted by Camille View Post
    It's not an objectmanager issue. He probably just has to repack index1
    Added all models in index1 didn't make a difference.
    http://pastebin.com/XXkN2b8d
    that's the ObjectManager
    Reply With Quote  
     

  8. #28  
    Registered Member

    Join Date
    Nov 2014
    Posts
    120
    Thanks given
    1
    Thanks received
    32
    Rep Power
    80
    Quote Originally Posted by Stevenhax View Post
    Added all models in index1 didn't make a difference.
    http://pastebin.com/XXkN2b8d
    that's the ObjectManager
    Was it fine before adding this snippet?
    and if not, i can send you my class.
    Reply With Quote  
     

  9. #29  
    Registered Member

    Join Date
    Nov 2014
    Posts
    120
    Thanks given
    1
    Thanks received
    32
    Rep Power
    80
    alright.
    Reply With Quote  
     

  10. #30  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Quote Originally Posted by Eternal View Post
    Was it fine before adding this snippet?
    and if not, i can send you my class.
    Past week I've messed with the maps and objects alot, now I'm wondering if you have a clue why the following happens.
    This was my cerberus map after packing the correct object models.
    Attached image

    As you can see the lava on the left side of the map is missing which is the first problem I'm unsure about what could cause it.
    Secondly, when I reloaded the client later without changing any code my map.
    Attached image
    Any idea how come the floor objects aren't all loading?

    Finally I'm wondering if you could give me any hints on how I would go about getting to know which map uses which flo index
    since I've been trying to load both my old flo and the osrs flo.

    I know I'm asking a lot of questions and I completely understand if you can't be bothered with explaining it all, but help with any of these would be extremely appreciated.
    Reply With Quote  
     

Page 3 of 5 FirstFirst 12345 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. OSRS Dumper script
    By The Reverse in forum Snippets
    Replies: 18
    Last Post: 07-09-2016, 01:29 PM
  2. OSRS Dumper Tool
    By Poesy700 in forum Selling
    Replies: 22
    Last Post: 05-30-2016, 08:44 PM
  3. OSRS Dumper reupload
    By Belthazar in forum Downloads
    Replies: 19
    Last Post: 02-09-2016, 11:55 PM
  4. OSRS Dumper
    By Secrets in forum Buying
    Replies: 3
    Last Post: 02-27-2015, 08:31 PM
  5. adding 717 Overlay/Underlay flo
    By Richard1992 in forum Tutorials
    Replies: 187
    Last Post: 04-01-2014, 01:15 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •