Thread: Names Above Ground Items

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1 Names Above Ground Items 
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    151
    Thanks given
    37
    Thanks received
    117
    Rep Power
    162
    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
    wut
    Reply With Quote  
     


  2. #2  
    \_(ツ)_/


    Join Date
    Sep 2014
    Age
    22
    Posts
    2,532
    Thanks given
    1,491
    Thanks received
    1,499
    Rep Power
    5000
    Nice snippet.

    Dawntained - Autumn '19

    Reply With Quote  
     

  3. #3  
    Rune-Server Affiliate

    Join Date
    Oct 2010
    Posts
    2,848
    Thanks given
    1,192
    Thanks received
    1,590
    Rep Power
    5000
    I've seen that you've released a bunch of useful stuff lately, thanks for that! Keep it up!
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Extreme Donator

    Gang's Avatar
    Join Date
    Nov 2013
    Posts
    743
    Thanks given
    179
    Thanks received
    448
    Rep Power
    5000
    Thx, gonna use it.

    "You have given out too much Reputation in the last 24 hours, try again later."
    Reply With Quote  
     

  5. #5  
    Best Rat Donor

    Australisch's Avatar
    Join Date
    Nov 2015
    Posts
    2,033
    Thanks given
    952
    Thanks received
    445
    Rep Power
    4414
    nice release, good stuff man.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2017
    Posts
    303
    Thanks given
    34
    Thanks received
    60
    Rep Power
    65
    Ive actually tried to me a cheap version of this a while ago, but will use this instead. Thanks D
    Reply With Quote  
     

  7. #7  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    151
    Thanks given
    37
    Thanks received
    117
    Rep Power
    162
    Quote Originally Posted by VenomRS View Post
    Ive actually tried to me a cheap version of this a while ago, but will use this instead. Thanks D
    Thanks
    wut
    Reply With Quote  
     

  8. #8  
    Registered Member
    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    5,219
    Thanks given
    516
    Thanks received
    1,086
    Rep Power
    1666
    u need to update the packet otherwise larger item amounts wont showup correctly.
    ...
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    151
    Thanks given
    37
    Thanks received
    117
    Rep Power
    162
    Quote Originally Posted by mige5 View Post
    u need to update the packet otherwise larger item amounts wont showup correctly.
    Well yeah... just change anInt1559 type to long instead of short 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

    wut
    Reply With Quote  
     

  11. #10  
    Special Snowflake

    DeathKid's Avatar
    Join Date
    May 2013
    Posts
    388
    Thanks given
    191
    Thanks received
    96
    Rep Power
    383
    Going to use, thanks .
    "Always remember that you are unique. Just like everyone else" - My Mom
    Reply With Quote  
     

Page 1 of 4 123 ... 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
  •