Thread: NPC Updating / NPC Bits

Results 1 to 7 of 7
  1. #1 NPC Updating / NPC Bits 
    Registered Member Ron Swanson's Avatar
    Join Date
    May 2015
    Age
    63
    Posts
    13
    Thanks given
    0
    Thanks received
    1
    Rep Power
    15
    Okay boys, where the heck am I going wrong?

    Client Sided NPC Bits:
    Code:
    	private void updateNewNPCs(int i, JagexBuffer stream) {
    		while (stream.bitPosition + 21 < i * 8) {
    			int k = stream.readBits(12);
    			if (k == 4096)
    				break;
    			if (npcArray[k] == null)
    				npcArray[k] = new NPC();
    			NPC npc = npcArray[k];
    			npcIndices[npcCount++] = k;
    			npc.updateCycle = loopCycle;
    			int l = stream.readBits(5);
    			if (l > 15)
    				l -= 32;
    			int i1 = stream.readBits(5);
    			if (i1 > 15)
    				i1 -= 32;
    			int j1 = stream.readBits(1);
    			npc.desc = stream.readBits(12);
    			int k1 = stream.readBits(1);
    			if (k1 == 1)
    				entityIndices[entityCount++] = k;
    			NPCDef def = npc.desc();
    			npc.size = def.aByte68;
    			npc.anInt1504 = def.anInt79;
    			npc.walkSequence = def.anInt67;
    			npc.turn180Sequence = def.anInt58;
    			npc.turnRightSequence = def.anInt83;
    			npc.turnLeftSequence = def.anInt55;
    			npc.standSequence = def.anInt77;
    			npc.runAnimation = def.runAnimIndex;
    			npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
    		}
    		stream.finishBitAccess();
    	}
    Server sided NPC Bits
    Code:
    	public static void addNewNpc(StreamBuffer.OutBuffer out, Player player, Npc npc) {
    		out.writeBits(12, npc.getIndex());
    		Position delta = Misc.delta(player.getPosition(), npc.getPosition());
    		out.writeBits(5, delta.getY());
    		out.writeBits(5, delta.getX());
    		out.writeBits(1, 0);
    		out.writeBits(12, npc.getNpcId());
    		out.writeBit(true);
    	}
    "Never half-ass two things, whole ass one thing".
    Reply With Quote  
     

  2. #2  
    Reverse Engineering

    freeezr's Avatar
    Join Date
    Dec 2011
    Posts
    1,067
    Thanks given
    288
    Thanks received
    444
    Rep Power
    401
    looks somewhat okay. are you sure the delta distances are correct tho?

    Attached image
    Reply With Quote  
     

  3. #3  
    Banned NPC Updating / NPC Bits Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    what issue are you having
    Reply With Quote  
     

  4. #4  
    Registered Member Ron Swanson's Avatar
    Join Date
    May 2015
    Age
    63
    Posts
    13
    Thanks given
    0
    Thanks received
    1
    Rep Power
    15
    Quote Originally Posted by lare96 View Post
    what issue are you having
    NPCs are pretty much spawning everywhere and then disappearing, and they're not the right NPCs

    The client is spitting out T2 Errors, saying mismatch getnpcpos

    Don't know if any of that helps, figure it's to do with NPCBits but cant determine where.
    "Never half-ass two things, whole ass one thing".
    Reply With Quote  
     

  5. #5  
    Registered Member
    hacker's Avatar
    Join Date
    Jun 2013
    Posts
    1,409
    Thanks given
    576
    Thanks received
    580
    Rep Power
    5000
    Quote Originally Posted by Ron Swanson View Post
    NPCs are pretty much spawning everywhere and then disappearing, and they're not the right NPCs

    The client is spitting out T2 Errors, saying mismatch getnpcpos

    Don't know if any of that helps, figure it's to do with NPCBits but cant determine where.
    try switching them to 14
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member Ron Swanson's Avatar
    Join Date
    May 2015
    Age
    63
    Posts
    13
    Thanks given
    0
    Thanks received
    1
    Rep Power
    15
    Quote Originally Posted by Hacker View Post
    try switching them to 14
    I've tried 12, 14 and even 16 because the client supports 634 NPCs

    I'm really not sure what the issue is, or where the heck I'm going wrong :/
    "Never half-ass two things, whole ass one thing".
    Reply With Quote  
     

  7. #7  
    Banned NPC Updating / NPC Bits Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by Ron Swanson View Post
    NPCs are pretty much spawning everywhere and then disappearing, and they're not the right NPCs

    The client is spitting out T2 Errors, saying mismatch getnpcpos

    Don't know if any of that helps, figure it's to do with NPCBits but cant determine where.
    you sure it's not another part of the updating protocol not being followed correctly
    Reply With Quote  
     


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. Replies: 795
    Last Post: 03-24-2013, 08:45 PM
  2. NPC following/ NPC on NPC?
    By TrollCount++ in forum Requests
    Replies: 3
    Last Post: 08-24-2009, 03:28 PM
  3. NPC update masks fixed
    By Palidino in forum RS 503+ Client & Server
    Replies: 110
    Last Post: 09-07-2008, 07:47 PM
  4. ALL NPC Update Masks
    By Sean in forum RS 503+ Client & Server
    Replies: 16
    Last Post: 08-07-2008, 12:25 AM
  5. Npc Update Masks
    By Evolution X in forum RS2 Client
    Replies: 8
    Last Post: 04-09-2008, 12:27 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
  •