Thread: Names Above Ground Items

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 32
  1. #21  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Deku View Post
    Well yeah... just change anInt1559 type to long instead of int and edit the type size from 2 to 8
    Didn't think I'd have to include it but oh well

    Example (Packet44 - sendGroundItem)
    Code:
    if (j == 44) {
    	int k2 = stream.readLEUShortA();
    	long j5 = stream.readLong();//stream.readUShort();
    Code:
    new SendCoordinates(g.getLocation(), base).execute(client);
    StreamBuffer.OutBuffer out = StreamBuffer.newOutBuffer(12);//was 6
    out.writeHeader(client.getEncryptor(), 44);
    out.writeShort(g.getItem().getId(), StreamBuffer.ValueType.A, StreamBuffer.ByteOrder.LITTLE);//2
    out.writeLong(g.getItem().getAmount());//was writeShort 2 // now long 8
    out.writeByte(0);//2
    client.send(out.getBuffer());
    Code:
    public static final int[] PACKET_SIZES = {
    		0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 	//0-9
    		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 	//10-19
    		0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 	//20-29
    		0, 0, 0, 0, -2, 4, 3, 0, 0, 0, 	//30-39
    		0, 0, 0, 0, 11, 0, 0, 6, 0, 0, 	//40-49 	//Edited: 11 was 5 - sendGroundItem

    "Well yeah... just change anInt1559 type to long instead of int and edit the type size from 2 to 8"
    It was never an int, it was a short. With that being said, changing the amount into a long is an overkill. An item's amount can never exceed max integer, you should've set it as an integer instead of a long. It's nothing major but just pointing out.
    Attached image
    Reply With Quote  
     

  2. Thankful users:


  3. #22  
    The One & Only


    Join Date
    Oct 2013
    Posts
    2,572
    Thanks given
    422
    Thanks received
    1,620
    Rep Power
    5000
    Thanks man, appreciate it
    Attached image
    Spoiler for More Signatures:

    Attached image
    Credits to Niceman, Vippy and Dami for the awesome signatures
    Attached image
    Attached image


    Reply With Quote  
     

  4. #23  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    Did you do this for OS-Veldhar? Surprisingly similar without the fading and transparency.
    Reply With Quote  
     

  5. #24  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    151
    Thanks given
    37
    Thanks received
    123
    Rep Power
    165
    Quote Originally Posted by Kris View Post
    "Well yeah... just change anInt1559 type to long instead of int and edit the type size from 2 to 8"
    It was never an int, it was a short. With that being said, changing the amount into a long is an overkill. An item's amount can never exceed max integer, you should've set it as an integer instead of a long. It's nothing major but just pointing out.
    Yeah, little miss-type my bad it was like 3am when I quickly posted the reply knowing some people might need it, was just giving an example of what needed to be done

    Quote Originally Posted by Adam A View Post
    Did you do this for OS-Veldhar? Surprisingly similar without the fading and transparency.
    No, I did not 'rip' or base this off of any other releases aside from OSBuddy :\ (have not done this for anyone either)
    wut
    Reply With Quote  
     

  6. #25  
    Inferno Founder

    Jin_'s Avatar
    Join Date
    May 2017
    Posts
    1,852
    Thanks given
    16
    Thanks received
    333
    Rep Power
    400
    Quote Originally Posted by Deku View Post
    Pretty simple, but haven't seen it released (add a toggle if ya want)



    Code:
    	private void render_ground_item_names() {
    		for (int x = 0; x < 104; x++) {
    			for (int y = 0; y < 104; y++) {
    				Deque node = groundItems[plane][x][y];
    				int offset = 12;
    				if (node != null) {
    					for (Item item = (Item) node.getFirst(); item != null; item = (Item) node.getNext()) {
    						ItemDefinition itemDef = ItemDefinition.lookup(item.ID);
    						get_raster_position((x << 7) + 64, 64, (y << 7) + 64);
    						newSmallFont.drawCenteredString(itemDef.name + (item.anInt1559 > 1 ? " (" + item.anInt1559 + ")" : ""), scene_draw_x, scene_draw_y - offset, 0xffffff, 1);
    						offset += 12;
    					}
    				}
    			}
    		}
    	}
    For reference,
    Code:
    	private void get_raster_position(int raster_x, int height, int raster_y) {//calcEntityScreenPos
    		if (raster_x < 128 || raster_y < 128 || raster_x > 13056 || raster_y > 13056) {
    			scene_draw_x = -1;
    			scene_draw_y = -1;
    			return;
    		}
    		int tile_bounds = method42(plane, raster_y, raster_x) - height;
    		raster_x -= absoluteX;
    		tile_bounds -= anchor;
    		raster_y -= absoluteY;
    		int sine_y = Model.SINE[yCameraCurve];
    		int cosine_y = Model.COSINE[yCameraCurve];
    		int sine_x = Model.SINE[xCameraCurve];
    		int cosine_x = Model.COSINE[xCameraCurve];
    		int pos = raster_y * sine_x + raster_x * cosine_x >> 16;
    		raster_y = raster_y * cosine_x - raster_x * sine_x >> 16;
    		raster_x = pos;
    		pos = tile_bounds * cosine_y - raster_y * sine_y >> 16;
    		raster_y = tile_bounds * sine_y + raster_y * cosine_y >> 16;
    		tile_bounds = pos;
    		if (raster_y >= 50) {
    			scene_draw_x = Rasterizer.textureInt1 + (raster_x << SceneGraph.viewDistance) / raster_y;
    			scene_draw_y = Rasterizer.textureInt2 + (tile_bounds << SceneGraph.viewDistance) / raster_y;
    		} else {
    			scene_draw_x = -1;
    			scene_draw_y = -1;
    		}
    	}
    And call
    Code:
    render_ground_item_names()
    below(*meant above)
    Code:
    draw3dScreen();
    Can add a rarity color and value onto the string if ya want, but this is just basic
    Great 1 : )
    Reply With Quote  
     

  7. #26  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    Quote Originally Posted by Deku View Post
    Yeah, little miss-type my bad it was like 3am when I quickly posted the reply knowing some people might need it, was just giving an example of what needed to be done



    No, I did not 'rip' or base this off of any other releases aside from OSBuddy :\ (have not done this for anyone either)
    Code:
    	private void displayGroundItems() {
    		/**
    		 * Loop thru all tiles in region
    		 */
    		for (int x = 0; x < 104; x++) {
    			for (int y = 0; y < 104; y++) {
    				NodeList class19 = groundArray[plane][x][y];
    				int count = 0;
    				if (class19 != null) {
    					for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
    						/**
    						 * loops thru all the ground tiles , then all the
    						 * 'items' (if the tile has an item on it) res tis self
    						 * explanatory
    						 */
    						ItemDefinition itemDef = ItemDefinition.forID(item.ID);
    Just saying, they are similar.
    Reply With Quote  
     

  8. #27  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    151
    Thanks given
    37
    Thanks received
    123
    Rep Power
    165
    Quote Originally Posted by Adam A View Post
    Code:
    	private void displayGroundItems() {
    		/**
    		 * Loop thru all tiles in region
    		 */
    		for (int x = 0; x < 104; x++) {
    			for (int y = 0; y < 104; y++) {
    				NodeList class19 = groundArray[plane][x][y];
    				int count = 0;
    				if (class19 != null) {
    					for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
    						/**
    						 * loops thru all the ground tiles , then all the
    						 * 'items' (if the tile has an item on it) res tis self
    						 * explanatory
    						 */
    						ItemDefinition itemDef = ItemDefinition.forID(item.ID);
    Just saying, they are similar.
    It's similar but that doesn't mean much, only things similar is what SHOULD be similar
    Code:
    				for (int k33 = byte1; k33 != byte2; k33 += byte3) {
    					for (int l33 = byte4; l33 != byte5; l33 += byte6) {
    						int i34 = k33 + i17;
    						int j34 = l33 + j21;
    						for (int k34 = 0; k34 < 4; k34++)
    							if (i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
    								groundItems[k34][k33][l33] = groundItems[k34][i34][j34];
    							else
    								groundItems[k34][k33][l33] = null;
    					}
    				}

    Code:
    			if (opcode == PacketConstants.DELETE_GROUND_ITEM) {
    				localX = incoming.readNegUByte();
    				localY = incoming.readUByteS();
    				for (int x = localX; x < localX + 8; x++) {
    					for (int y = localY; y < localY + 8; y++)
    						if (groundItems[plane][x][y] != null) {
    							groundItems[plane][x][y] = null;
    							spawnGroundItem(x, y);
    						}
    				}
    Code:
    		for (int x = 0; x < 104; x++) {
    			for (int y = 0; y < 104; y++) {
    				Deque node = groundItems[plane][x][y];
    				if (node != null) {
    					int relative_to_player_x = (x * 4 + 2) - localPlayer.x / 32;
    					int relative_to_player_y = (y * 4 + 2) - localPlayer.y / 32;
    					markMinimap(mapDotItem, relative_to_player_x, relative_to_player_y);
    				}
    			}
    		}
    Code:
    				Deque class19 = groundItems[plane][x][y];
    				if (class19 != null) {
    
    					for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
    						ItemDefinition itemDef = ItemDefinition.lookup(item.ID);
    						if (itemSelected == 1) {
    							menu_option(("Use " + selectedItemName + " -> <col=ff9040>" + itemDef.name), 511, item.ID, x, y);
    						} else if (spellSelected == 1) {
    wut
    Reply With Quote  
     

  9. #28  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    19
    Posts
    1,183
    Thanks given
    590
    Thanks received
    261
    Rep Power
    164
    Quote Originally Posted by Adam A View Post
    Code:
    	private void displayGroundItems() {
    		/**
    		 * Loop thru all tiles in region
    		 */
    		for (int x = 0; x < 104; x++) {
    			for (int y = 0; y < 104; y++) {
    				NodeList class19 = groundArray[plane][x][y];
    				int count = 0;
    				if (class19 != null) {
    					for (Item item = (Item) class19.getFirst(); item != null; item = (Item) class19.getNext()) {
    						/**
    						 * loops thru all the ground tiles , then all the
    						 * 'items' (if the tile has an item on it) res tis self
    						 * explanatory
    						 */
    						ItemDefinition itemDef = ItemDefinition.forID(item.ID);
    Just saying, they are similar.
    thats my code and notes haha
    Reply With Quote  
     

  10. #29  
    Donator


    Join Date
    Mar 2015
    Posts
    730
    Thanks given
    121
    Thanks received
    190
    Rep Power
    292
    What class would I put this in? I'm a noob. Thanks for the release, will use if I get help.
    Attached image
    Reply With Quote  
     

  11. #30  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    19
    Posts
    1,183
    Thanks given
    590
    Thanks received
    261
    Rep Power
    164
    Quote Originally Posted by Vernal View Post
    What class would I put this in? I'm a noob. Thanks for the release, will use if I get help.
    Depends on your naming but client lol
    Reply With Quote  
     

Page 3 of 4 FirstFirst 1234 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. Item's name on ground
    By JacobiYounger in forum Help
    Replies: 4
    Last Post: 05-26-2016, 07:48 PM
  2. Replies: 11
    Last Post: 12-02-2015, 11:28 PM
  3. Replies: 8
    Last Post: 02-28-2009, 10:50 PM
  4. 100% Perfect picking up ground items! + Video
    By Pkitten in forum Tutorials
    Replies: 177
    Last Post: 09-26-2008, 10:32 PM
  5. Replies: 1
    Last Post: 10-23-2007, 12:40 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
  •