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
    136
    Thanks given
    32
    Thanks received
    70
    Rep Power
    100
    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
    All content I release is NOT to be SOLD or offered as a SERVICE. Please respect my wishes, as my releases are free to use. Thank you.


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


  2. #2  
    An Magician


    Join Date
    Sep 2014
    Age
    19
    Posts
    1,566
    Thanks given
    872
    Thanks received
    663
    Rep Power
    1740
    Nice snippet.
    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]

    "There's no such thing as a PI client " - Albert Einstein
    Reply With Quote  
     

  3. #3  
    Registered Member
    Professor Oak's Avatar
    Join Date
    Jun 2016
    Posts
    966
    Thanks given
    596
    Thanks received
    759
    Rep Power
    1703
    I've seen that you've released a bunch of useful stuff lately, thanks for that! Keep it up!
    Reply With Quote  
     

  4. #4  
    Registered Gangster

    Gang sta's Avatar
    Join Date
    Nov 2013
    Posts
    406
    Thanks given
    48
    Thanks received
    162
    Rep Power
    1398
    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
    Age
    21
    Posts
    1,806
    Thanks given
    855
    Thanks received
    344
    Rep Power
    4148
    nice release, good stuff man.
    ***working on something, hmu for deets.**
    Spoiler for Don't fucking click u moron:
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2017
    Posts
    86
    Thanks given
    8
    Thanks received
    19
    Rep Power
    0
    Ive actually tried to me a cheap version of this a while ago, but will use this instead. Thanks D


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

  7. #7  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    136
    Thanks given
    32
    Thanks received
    70
    Rep Power
    100
    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
    All content I release is NOT to be SOLD or offered as a SERVICE. Please respect my wishes, as my releases are free to use. Thank you.


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

  8. #8  
    Registered Member
    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    4,871
    Thanks given
    354
    Thanks received
    863
    Rep Power
    1150
    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
    136
    Thanks given
    32
    Thanks received
    70
    Rep Power
    100
    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

    All content I release is NOT to be SOLD or offered as a SERVICE. Please respect my wishes, as my releases are free to use. Thank you.


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

  11. #10  
    Special Snowflake

    DeathKid's Avatar
    Join Date
    May 2013
    Posts
    283
    Thanks given
    137
    Thanks received
    57
    Rep Power
    192
    Going to use, thanks .
    Click on my signature to rent a max main staker! Cheapest in town!

    [Only registered and activated users can see links. ]
    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)

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
  •