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
    130
    Thanks given
    31
    Thanks received
    68
    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  
    hi m8s


    Join Date
    Sep 2014
    Age
    19
    Posts
    1,456
    Thanks given
    802
    Thanks received
    616
    Rep Power
    1493
    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
    910
    Thanks given
    539
    Thanks received
    714
    Rep Power
    1472
    I've seen that you've released a bunch of useful stuff lately, thanks for that! Keep it up!
    Quote Originally Posted by Avicci View Post
    regicide completed?
    Quote Originally Posted by Andys1814 View Post
    not that one no, i didnt want to give myself cancer
    Quote Originally Posted by Leon. View Post
    been prescribed 3 doses of rep to get rid of this chest infection
    Reply With Quote  
     

  4. #4  
    La liberté guidant le peuple.

    Gangsta.'s Avatar
    Join Date
    Nov 2013
    Posts
    374
    Thanks given
    37
    Thanks received
    145
    Rep Power
    1087
    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,740
    Thanks given
    814
    Thanks received
    315
    Rep Power
    3694
    nice release, good stuff man.
    Spoiler for Don't fucking click u moron:
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2017
    Posts
    63
    Thanks given
    4
    Thanks received
    13
    Rep Power
    12
    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. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    Registered Member
    Deku's Avatar
    Join Date
    May 2016
    Posts
    130
    Thanks given
    31
    Thanks received
    68
    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,855
    Thanks given
    354
    Thanks received
    851
    Rep Power
    1148
    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
    130
    Thanks given
    31
    Thanks received
    68
    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
    183
    Thanks given
    70
    Thanks received
    37
    Rep Power
    55
    Going to use, thanks .
    [Only registered and activated users can see links. ]

    Spoiler for Thanks Jake <3:


    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
  •