Thread: Prioritized player drawing

Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36
  1. #31  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Oh this is a cool idea nice work mr oak.


    Reply With Quote  
     

  2. #32  
    Community Veteran

    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    5,528
    Thanks given
    573
    Thanks received
    1,410
    Rep Power
    2114
    Quote Originally Posted by Professor Oak View Post
    Yes exactly... That's the main point of this?
    Since the one which you're fighting is rendered first, it works just fine.
    It makes it so that other players cannot be "annoying" and walk into the player you're fighting and make you click on them instead.
    Attached image



    Just added it for npcs aswell. It will draw the one you're interacting with on top.

    Attached image


    Attached image

    Attached image

    edit: When modifying npc priority drawing, for proper menu drawing modify the calls for buildNpcMenu/buildPlayerMenu.
    Whats the purpose of the boolean in showNpc?
    Code:
    private void showOtherNpcs(){
    	   for(int index = 0; index < this.npcCount; index++) {
    		   NPC npc = this.npcArray[this.npcIndices[index]];
    		   if(myPlayer.interactingEntity != -1 && myPlayer.interactingEntity < 32768){
    			   if(npc.index == myPlayer.interactingEntity){
    				   continue;
    			   }
    		   }
    		   showNpc(npc, index, true);
    	   }
       }
       
       private boolean prioritizedNpc(NPC npc) {
    	   if(myPlayer.interactingEntity != -1 && myPlayer.interactingEntity < 32768){
    		   if(npc.index == myPlayer.interactingEntity){
    			   return true;
    		   }
    	   }
    	   return false;
       }
       
       private void showPrioritizedNpcs(){
    	   for(int index = 0; index < this.npcCount; index++) {
    		   NPC npc = this.npcArray[this.npcIndices[index]];
    		   if(prioritizedNpc(npc)){
    			   showNpc(npc, index, true);
    		   }
    	   }
       }
       
       private boolean showNpc(NPC npc, int index, boolean flag) {
    	   if (npc == null || !npc.isVisible() && npc.desc.aBoolean93 == flag) {
    			return false;
    		}
    	   int l = npc.x >> 7;
           int i1 = npc.y >> 7;
           if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104) {
        	   return false;
           }
           if(npc.anInt1540 == 1 && (npc.x & 127) == 64 && (npc.y & 127) == 64) {
               if(this.anIntArrayArray929[l][i1] == this.anInt1265) {
                  return false;
               }
    
               this.anIntArrayArray929[l][i1] = this.anInt1265;
            }
    
           int k = 536870912 + (index << 14);
           
            if(!npc.desc.aBoolean84) {
               k -= Integer.MIN_VALUE;
            }
    
            this.worldController.method285(this.plane, npc.anInt1552, this.method42(this.plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
            return true;
       }
    Number of page #1 releases with most views & posts: (Updated: 2023)
    RS2 server section: 1
    RS2 client section: 2
    Reply With Quote  
     

  3. #33  
    Banned

    Join Date
    Jul 2018
    Posts
    121
    Thanks given
    82
    Thanks received
    55
    Rep Power
    0
    Quote Originally Posted by Professor Oak View Post
    Thanks guys!
    Hey sorry for the semi Grave dig but i added this but it seems to be making all my other Players go invisible but if i stand on top of said player i can see the options

    it was copy and paste no naming was required

    Attached image
    Attached image
    Reply With Quote  
     

  4. #34  
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    Quote Originally Posted by Zac View Post
    Hey sorry for the semi Grave dig but i added this but it seems to be making all my other Players go invisible but if i stand on top of said player i can see the options

    it was copy and paste no naming was required

    Attached image
    Attached image
    Unlucky you cannot get this snippet working Christian
    Reply With Quote  
     

  5. #35  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by mige5 View Post
    Whats the purpose of the boolean in showNpc?
    Code:
    private void showOtherNpcs(){
    	   for(int index = 0; index < this.npcCount; index++) {
    		   NPC npc = this.npcArray[this.npcIndices[index]];
    		   if(myPlayer.interactingEntity != -1 && myPlayer.interactingEntity < 32768){
    			   if(npc.index == myPlayer.interactingEntity){
    				   continue;
    			   }
    		   }
    		   showNpc(npc, index, true);
    	   }
       }
       
       private boolean prioritizedNpc(NPC npc) {
    	   if(myPlayer.interactingEntity != -1 && myPlayer.interactingEntity < 32768){
    		   if(npc.index == myPlayer.interactingEntity){
    			   return true;
    		   }
    	   }
    	   return false;
       }
       
       private void showPrioritizedNpcs(){
    	   for(int index = 0; index < this.npcCount; index++) {
    		   NPC npc = this.npcArray[this.npcIndices[index]];
    		   if(prioritizedNpc(npc)){
    			   showNpc(npc, index, true);
    		   }
    	   }
       }
       
       private boolean showNpc(NPC npc, int index, boolean flag) {
    	   if (npc == null || !npc.isVisible() && npc.desc.aBoolean93 == flag) {
    			return false;
    		}
    	   int l = npc.x >> 7;
           int i1 = npc.y >> 7;
           if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104) {
        	   return false;
           }
           if(npc.anInt1540 == 1 && (npc.x & 127) == 64 && (npc.y & 127) == 64) {
               if(this.anIntArrayArray929[l][i1] == this.anInt1265) {
                  return false;
               }
    
               this.anIntArrayArray929[l][i1] = this.anInt1265;
            }
    
           int k = 536870912 + (index << 14);
           
            if(!npc.desc.aBoolean84) {
               k -= Integer.MIN_VALUE;
            }
    
            this.worldController.method285(this.plane, npc.anInt1552, this.method42(this.plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
            return true;
       }
    render priority, pretty much what this snippet is for. So for npcs just set that to true in defs and it'll be rendered on top of other players and npcs.

    Quote Originally Posted by Zac View Post
    Hey sorry for the semi Grave dig but i added this but it seems to be making all my other Players go invisible but if i stand on top of said player i can see the options

    it was copy and paste no naming was required
    well that seems like a problem on your end cause it works fine for me
    [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
    Reply With Quote  
     

  6. #36  
    Community Veteran

    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    5,528
    Thanks given
    573
    Thanks received
    1,410
    Rep Power
    2114
    Quote Originally Posted by Professor Oak View Post
    render priority, pretty much what this snippet is for. So for npcs just set that to true in defs and it'll be rendered on top of other players and npcs.
    Cant I just use this check instead of setting a value in the def? (or is this boolean already for that purpose: aBoolean93)
    Code:
       private boolean prioritizedNpc(NPC npc) {
    	   if(myPlayer.interactingEntity != -1 && myPlayer.interactingEntity < 32768){
    		   if(npc.index == myPlayer.interactingEntity){
    			   return true;
    		   }
    	   }
    	   return false;
       }
    Number of page #1 releases with most views & posts: (Updated: 2023)
    RS2 server section: 1
    RS2 client section: 2
    Reply With Quote  
     

Page 4 of 4 FirstFirst ... 234

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. Drawing player minimap dot
    By blood rush20 in forum Help
    Replies: 2
    Last Post: 07-16-2013, 02:42 AM
  2. Drawing Player Head
    By Ey Cuzzo in forum Help
    Replies: 2
    Last Post: 01-06-2013, 09:49 PM
  3. Drawing player model.
    By Creedance in forum Requests
    Replies: 1
    Last Post: 08-11-2009, 11:40 PM
  4. Packet 101 - Draw your player model on interface
    By veer in forum RS 503+ Client & Server
    Replies: 0
    Last Post: 09-01-2008, 08:11 PM
  5. Packet 64 - Draw Player model onto widget/interface [508]
    By veer in forum RS 503+ Client & Server
    Replies: 1
    Last Post: 09-01-2008, 08:02 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •