Results 1 to 9 of 9

Thread: Localized string not precached.

  1. #1
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts

    Localized string not precached.

    Hey, I was making a hud elem and then got this error:
    PHP Code:
    localized string "RANK_RANK" not precached: (file 'maps/mp/gametypes/_tdm.gsc'line 579)
     
    self.hud.label = &"RANK_RANK"
    It is supposed to read from localized string file, but it doesn't seem to work, I have been using that method already, but now it doesn't work anymore, the file is like this:

    rank.str
    PHP Code:
    REFERENCE           RANK
    LANG_ENGLISH        
    "Rank:"

    ENDMARKER 
    Ofc I am not going to precache it, because it will otherwise read it as a string.
    If somebody can help, I will appreciate that

    -EvoloZz

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Why don't you use Precache the "Rank: " and use it as label and use the Value with SetValue(rank)

  3. #3
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts
    Of course I could use that, but I want to fix that one also

  4. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    And what if u rename ur str file to RANK? Maybe its case-sensitive

  5. #5
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Ni3ls View Post
    And what if u rename ur str file to RANK? Maybe its case-sensitive
    It's not case sensitive.

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by EvoloZz View Post
    Hey, I was making a hud elem and then got this error:
    PHP Code:
    localized string "RANK_RANK" not precached: (file 'maps/mp/gametypes/_tdm.gsc'line 579)
     
    self.hud.label = &"RANK_RANK"
    It is supposed to read from localized string file, but it doesn't seem to work, I have been using that method already, but now it doesn't work anymore, the file is like this:

    rank.str
    PHP Code:
    REFERENCE           RANK
    LANG_ENGLISH        
    "Rank:"

    ENDMARKER 
    Ofc I am not going to precache it, because it will otherwise read it as a string.
    If somebody can help, I will appreciate that

    -EvoloZz
    what do you mean you are not going to precache it because it will read it as a string? It is a string. No two ways about it.

    It's very simple - either you precache it, like the game is telling you to do. Or, you will have to put up with the error.

  7. #7
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts
    Yeah but if I precache it, the hud will show this ingame: RANK_RANK, and that's not what I want, I want it to read it from the string file.

  8. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Rename it to something NOT the filename. (like RANK_RANKLABEL)

  9. #9
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by EvoloZz View Post
    Yeah but if I precache it, the hud will show this ingame: RANK_RANK, and that's not what I want, I want it to read it from the string file.
    the eXtreme+ mod has been doing it that way for years without any problems:

    extreme/_ex_varcache.gsc

    Code:
    [[level.ex_PrecacheString]](&"RANK_RANK");
    extreme/_ex_ranksystem.gsc:

    Code:
    	if(level.ex_rankhud == 2)
    	{
    		rankstring = self getRankstring(self.pers["rank"]);
    
    		if(!isDefined(self.ex_rankhud1))
    		{
    			self.ex_rankhud1 = newClientHudElem(self);
    			self.ex_rankhud1.horzAlign = "fullscreen";
    			self.ex_rankhud1.vertAlign = "fullscreen";
    			self.ex_rankhud1.alignX = "left";
    			self.ex_rankhud1.alignY = "middle";
    			self.ex_rankhud1.x = 10;
    			self.ex_rankhud1.y = 474;
    			self.ex_rankhud1.alpha = 1;
    			self.ex_rankhud1.fontScale = 0.8;
    			self.ex_rankhud1.label = &"RANK_RANK";
    		}
    
    		if(isDefined(self.ex_rankhud1)) self.ex_rankhud1 setText(rankstring);
    	}
    localizedstrings/rank.str:

    Code:
    REFERENCE			RANK
    LANG_ENGLISH		"RANK: "
    It works fine.

    BTW- I wrote the ranksystem for the eXtreme+ mod back in 2006. I have never had any problems precaching a label and getting it to show correctly. As long as you do everything right, it should show correctly. The only thing I can see that is different about your label is that there isn't a space after the colon, but I suspect that wouldn't make a difference anyway.
    Last edited by Tally; 25th March 2013 at 20:12.

  10. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (26th March 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •