Thread: [PI] Icons not showing up in ::yell

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [PI] Icons not showing up in ::yell 
    Novice Developer
    Solnes's Avatar
    Join Date
    Jul 2017
    Posts
    89
    Thanks given
    12
    Thanks received
    3
    Rep Power
    36
    Hello Rune-Server. Got a question for someone. So when ever someone does the ::yell command on my server the MODICON doesn't show up. I have had myself and 2 other developers have a look into it and they cant seem to find what's wrong. If someone can help me out with a link or anything for me to try it would be greatly appreciated.

    Attached image

    This is my code for ::yell. I have tried a number of different things but nothing seems to work.

    Code:
    if (playerCommand.startsWith("yell") || playerCommand.startsWith("Yell") || playerCommand.startsWith("YELL") || playerCommand.startsWith("yel")) {
    			for (int j = 0; j < PlayerHandler.players.length; j++) {
    				if (PlayerHandler.players[j] != null) {
    					Client c2 = (Client) PlayerHandler.players[j];
    
    					if (!Connection.isMuted(c2)) {
    					if (c2.npcKills < 0) {
    							c2.sendMessage("You need atleast 0 NPC Kills before you can yell");
    							return;
    						 }
    
    						if (c.playerName.equalsIgnoreCase("Destiny") && c.playerRights == 3) {
    							 c2.sendMessage("<img=2>"+"<shad=800000000>[Owner & Dev]"+ Misc.optimizeText(c.playerName) +"<img=2>"+":<shad=800000000>"  + Misc.optimizeText(playerCommand.substring(5)) +"");
    						} else if (c.playerName.equalsIgnoreCase("Hatedxf") && c.playerRights == 2) {
    							c2.sendMessage("<img=1>"+"<shad=800000000>[Head Admin]" + Misc.optimizeText(c.playerName) + "<img=1>"+":<shad=800000000> " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerName.equalsIgnoreCase("Kamikaze") && c.playerRights == 3) {
    							c2.sendMessage("<shad=800000000><img=12>[Developer]<img=12>" + Misc.optimizeText(c.playerName) + ":<shad=800000000> " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 10) {
    							c2.sendMessage("<shad=99999999>[TrustedDicer] " + Misc.optimizeText(c.playerName) + "<shad=6352853>: " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 7) {
    							c2.sendMessage("<shad=52984>[Helper] " + Misc.optimizeText(c.playerName) + "<shad=6352853>: " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 8) {
    							c2.sendMessage("<shad=16014601>[Youtuber] " + Misc.optimizeText(c.playerName) + "<shad=6352853>: " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 9) {
    							c2.sendMessage("<shad=16014601>[Media manager] " + Misc.optimizeText(c.playerName) + "<shad=6352853>: " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 2) {
    							c2.sendMessage("<shad=800000000>[Administrator]</col>" + Misc.optimizeText(c.playerName) + "<shad=6352853>: " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						} else if (c.playerRights == 1) {
    							c2.sendMessage("<shad=800000000><img=0>[Moderator]</col>" + Misc.optimizeText(c.playerName) + ":<shad=800000000> " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						//Players
    						} else if (c.npcKills >= 0 && c.playerRights == 0) {
    							c2.sendMessage("<shad=950555>[" + c.npcKills + " NPC kills]</shad>" + Misc.optimizeText(c.playerName) + ": " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						
    							//Donator yell
    						} else if (c.playerRights == 4) {
    							c2.sendMessage("<shad=95057><img=3>$" + c.totalDonatorPoints + "["+ c.customYellTag +"]<img=3></shad>" + Misc.optimizeText(c.playerName) + ": " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						
    							//Super Donator yell
    						} else if (c.playerRights == 5) {
    							c2.sendMessage("<shad=616678><img=4>$" + c.totalDonatorPoints + "["+ c.customYellTag +"]<img=4></shad>" + Misc.optimizeText(c.playerName) + ": " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						
    							//Sponsor yell
    						} else if (c.playerRights == 6) {
    							c2.sendMessage("<shad=16014><img=5>$" + c.totalDonatorPoints + "["+ c.customYellTag +"]<img=5></shad>" + Misc.optimizeText(c.playerName) + ": " + Misc.optimizeText(playerCommand.substring(5)) + "");
    						
    						}
    					} else if (c2.isInJail()) {
    						c2.sendMessage("<shad=15692059>Please inform a staff member!");
    						return;
    					}
    
    				}
    			}
    		}
    	}
    And yes I know my yell command could be done better.
    Last edited by Solnes; 05-04-2018 at 04:21 PM.
    Thanks for reading
    King Regards,
    Solnes

    Owner & Developer of
    Attached image
    Reply With Quote  
     

  2. #2  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Your sendMessage method probably has images removed before it's sent, so regular players can't send crowns through their yell. I haven't used PI or even coded a rsps in awhile though, so without looking I couldn't tell you for certain

    EDIT: Assuming this is right, you'd probably be looking to remove something like this:
    Code:
    str = str.replaceAll("<img=\\d+>", "");
    this would however make it so players could type something like this "::yell how's it going?<img=1>" and have a crown shown within the yell, so I recommend instead of removing it, you change it. If you prefer this route, and need some assistance let me know.

    Discord: Apollo#2722
    Reply With Quote  
     

  3. #3  
    Novice Developer
    Solnes's Avatar
    Join Date
    Jul 2017
    Posts
    89
    Thanks given
    12
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by Apollo View Post
    Your sendMessage method probably has images removed before it's sent, so regular players can't send crowns through their yell. I haven't used PI or even coded a rsps in awhile though, so without looking I couldn't tell you for certain

    EDIT: Assuming this is right, you'd probably be looking to remove something like this:
    Code:
    str = str.replaceAll("<img=\\d+>", "");
    this would however make it so players could type something like this "::yell how's it going?<img=1>" and have a crown shown within the yell, so I recommend instead of removing it, you change it. If you prefer this route, and need some assistance let me know.
    Thank you I will check this out and see if something works.

    EDIT: okay so theres nothing remotely close to the code you sent me anywhere and when someone types "<" it completely blanks what they type then when they press "Enter" the "<" shows up.

    Attached image
    Last edited by Solnes; 05-05-2018 at 07:26 AM.
    Thanks for reading
    King Regards,
    Solnes

    Owner & Developer of
    Attached image
    Reply With Quote  
     

  4. #4  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    It's probably your client then, do you have
    Code:
    startImage = "img=";
    in TextDrawingArea.java?

    Discord: Apollo#2722
    Reply With Quote  
     

  5. #5  
    Novice Developer
    Solnes's Avatar
    Join Date
    Jul 2017
    Posts
    89
    Thanks given
    12
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by Apollo View Post
    It's probably your client then, do you have
    Code:
    startImage = "img=";
    in TextDrawingArea.java?
    no I don't actually. But my buddy is working on his own server aswell and he doesn't have the "startImage = "img="; in his TextDrawingArea.java and his icons work perfectly fine.
    Thanks for reading
    King Regards,
    Solnes

    Owner & Developer of
    Attached image
    Reply With Quote  
     

  6. #6  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    did you download your source/client from rune-server? if so could you send the link? it might be easier if I looked around instead of guessing where the issue could be

    Discord: Apollo#2722
    Reply With Quote  
     

  7. #7  
    Novice Developer
    Solnes's Avatar
    Join Date
    Jul 2017
    Posts
    89
    Thanks given
    12
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by Apollo View Post
    did you download your source/client from rune-server? if so could you send the link? it might be easier if I looked around instead of guessing where the issue could be
    I got mine from the original developer from it but I do believe the less updated version is on here somewhere. I will check and send you a PM.

    EDIT: I will have to re upload the older version. Give me a little bit. But the original project is called Platinum-PS. But ive changed it about 80% of the way.
    Last edited by Solnes; 05-05-2018 at 08:22 PM.
    Thanks for reading
    King Regards,
    Solnes

    Owner & Developer of
    Attached image
    Reply With Quote  
     

  8. #8  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    it's also possible that the sprites were renamed at some point since it appears the default crowns were replaced, and only part of the code was changed to replace them. in the client I'm looking at the crown admin crown is named "MODICONS 2.PNG" is that the same for yours? I point this out because in client.java there's this section of code in the client I'm looking at:
    Code:
    		for(int i = 0; i <= 6; i++){
    			modIcons[i] = new Sprite("Player/MODICONS "+i+"");
    		}
    		for(int i = 0; i <= 6; i++){
    			chatImages[i] = new Sprite("Player/MODICONS "+i+"");
    		}
    and in my TextDrawingArea.java there's (you said you don't have the "startImage" variable, so yours may look different)
    Code:
    if (effectString.startsWith(startImage)) {
                                try {
                                    int imageId = Integer.valueOf(effectString.substring(4));
                                    Sprite icon = chatImages[imageId];
                                    int iconModY = icon.maxHeight;//maxHeight
    this tells me if the sprites names were changed, and only the path for modicons was changed and chatimages wasn't, you'd probably be facing the issue you currently are.

    After looking through what you sent me, it appears the above was correct.

    Client.java replace:
    Code:
    chatImages[i] = new Sprite("Player/icon "+i+"");
    with
    Code:
    chatImages[i] = new Sprite("Player/MODICONS "+i+"");
    That enables the crowns

    Discord: Apollo#2722
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Novice Developer
    Solnes's Avatar
    Join Date
    Jul 2017
    Posts
    89
    Thanks given
    12
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by Apollo View Post
    it's also possible that the sprites were renamed at some point since it appears the default crowns were replaced, and only part of the code was changed to replace them. in the client I'm looking at the crown admin crown is named "MODICONS 2.PNG" is that the same for yours? I point this out because in client.java there's this section of code in the client I'm looking at:
    Code:
    		for(int i = 0; i <= 6; i++){
    			modIcons[i] = new Sprite("Player/MODICONS "+i+"");
    		}
    		for(int i = 0; i <= 6; i++){
    			chatImages[i] = new Sprite("Player/MODICONS "+i+"");
    		}
    and in my TextDrawingArea.java there's (you said you don't have the "startImage" variable, so yours may look different)
    Code:
    if (effectString.startsWith(startImage)) {
                                try {
                                    int imageId = Integer.valueOf(effectString.substring(4));
                                    Sprite icon = chatImages[imageId];
                                    int iconModY = icon.maxHeight;//maxHeight
    this tells me if the sprites names were changed, and only the path for modicons was changed and chatimages wasn't, you'd probably be facing the issue you currently are.

    After looking through what you sent me, it appears the above was correct.

    Client.java replace:
    Code:
    chatImages[i] = new Sprite("Player/icon "+i+"");
    with
    Code:
    chatImages[i] = new Sprite("Player/MODICONS "+i+"");
    That enables the crowns
    That worked perfectly. Thank you. But only think is the offset of the images is a bit off or I made the images to large.
    Attached image
    Thanks for reading
    King Regards,
    Solnes

    Owner & Developer of
    Attached image
    Reply With Quote  
     

  11. #10  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Quote Originally Posted by Solnes View Post
    That worked perfectly. Thank you. But only think is the offset of the images is a bit off or I made the images to large.
    Attached image
    Pictures that work for me are 13x13 or smaller. If you made them too big, resize them. Let me know if that's the case, because if it's not there may be an issue with the positioning somewhere

    EDIT: If the above doesn't work, I'll need a more recent copy of RSFont.java, since the version you sent me seems to work fine, so I'm guessing at some point it was changed incorrectly

    Discord: Apollo#2722
    Reply With Quote  
     

Page 1 of 2 12 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. Replies: 4
    Last Post: 06-23-2014, 09:55 AM
  2. [PI] Level Not Showing Up?
    By Special Victims in forum Help
    Replies: 21
    Last Post: 02-25-2012, 03:40 AM
  3. Replies: 7
    Last Post: 02-24-2012, 10:32 PM
  4. Admin icon not showing up?
    By buck in forum Help
    Replies: 2
    Last Post: 08-14-2009, 03:29 AM
  5. custom mod icons not showing up [non]
    By mige5 in forum Help
    Replies: 2
    Last Post: 07-28-2009, 09:10 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
  •