Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: dvar not working after reopening menu

  1. #11
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Quote Originally Posted by IzNoGoD View Post
    any results?
    Quote Originally Posted by Ni3ls View Post
    Maybe a dumb question, but i dont understand where I should place them?
    And the dvar for the images does work, which is
    Code:
    self setClientCvar("dvar_perk_1",value);
    Dont really understand where to place them. Inside the if's?

  2. #12
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    After you hit the perk button, press shift+0, find something similar to "Response: "+response+"/nWarn: "+warn" and paste here what the game printed. Maybe you can put another iprintln before the "if" to make sure the script is runs.
    Oh, and comment or delete these two lines:
    PHP Code:
    wait 0.5;
    self setClientCvar("perk_warn",""); 
    I think there is no man in the world who can read the warn message in half second.

  3. #13
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    When I open the menu for the first time and select perk1, I see the warn message inside the menu and as iprintln
    Code:
    WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Select perk1: 1 , Selected: 1"
    Then I select perk1 again, so it must deselect. I see the warning in the menu again and as iprintln.
    Code:
    WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Deselect perk1: 0 , Selected: 0"
    I close the menu and reopen it. I select perk1 again, but no warn message inside the menu is showed. Only iprintln
    Code:
    WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Select perk1: 1 , Selected: 1"
    I click on perk1 again to deselect it. Again no warn message inside the menu, but the iprintln is working correctly
    Code:
    WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Deselect perk1: 0 , Selected: 0"
    Tested with developer 1

  4. #14
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    LOL this is painful to watch. Everyone knows you get those localized string errors, and you just ignore them. You should be beyond the noob stage by now Nils. You've been modding long enough.

  5. #15
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by Tally View Post
    LOL this is painful to watch. Everyone knows you get those localized string errors, and you just ignore them. You should be beyond the noob stage by now Nils. You've been modding long enough.
    Hes using them to identify the iprintlns and tell us which ones happened. He's not complaining about the warnings, he's using them for debuggin puproses
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #16
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    Hes using them to identify the iprintlns and tell us which ones happened. He's not complaining about the warnings, he's using them for debuggin puproses
    Why is he including the warning at all? How does that help anyone to identify the problem for him?

    And do you notice, he says the iprintln is working, and then he includes - not the iprintln but the fucking warning again!

  7. #17
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Is this code still there:

    Code:
    			self setClientCvar("perk_warn",warn); 
    			wait 0.5;
    			self setClientCvar("perk_warn","");
    Are you waiting a frame, then clearing the warning message to ""? Perhaps that is why it isn't working - if you clear the message, it wont be there, will it?

    If the above code is not relevant, you need to post your most up-to-date code. No one can help with outdated code.

  8. #18
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Code:
    handleperk(response)
    {
    	self setClientCvar("perk_warn","");
    	//showdvars of perks ["0" is for locked perk, "1" is for unlocked perk, "2" is for unlocked + selected perk]
    	warn="";
    	if(response == "perk1")
    	{
    		if(self.rank <0)
    		{	
    			warn=level.rankwarn[int(self.lang)];
    		}
    
    		else if(self.perkselect == 0 && self.perk1 == 0)
    		{
    			self.perk1=1;
    			self.perkselect =1;
    			self setClientCvar("dvar_perk_1","2");
    			warn="Select perk1: "+self.perk1+ " , Selected: "+self.perkselect;
    		}
    		else if(self.perk1 == 1)
    		{
    			self.perk1=0;
    			self.perkselect =0;
    			self setClientCvar("dvar_perk_1","1");
    			warn="Deselect perk1: "+self.perk1+ " , Selected: "+self.perkselect;
    		}
    
    		else if(self.perkselect == 1)
    		{
    			warn="Deselect first , Selected: "+self.perkselect;
    		}
    			iprintln("Response: "+response+"\nWarn: "+warn);
    
    			self setClientCvar("perk_warn",warn); 
    	}
    }
    Called from
    Code:
    		else if(menu == "perkmenu")
    		{
    		
    			self setupperk(); // loads the menu
    			self handleperk(response);
    		}
    Here is the complete perkmenu.menu

    To load it, use /language "1"

    http://pastebin.com/4gtg42gf

  9. #19
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Can somebody try it and see if they can fix the error?

  10. #20
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    You have over 220 itemdef's in your menu. I guess it just bugs out..
    You should handle your language stuff in a different way, by using only ONE menu and use localized strings.
    Try remove these and see if it works.

    Also you set the client-var on top of your script and also at the bottom (in the same frame) maybe this is also a thing..
    You can remove the first setClientCvar() then.

    And: you dont need to hide your itemdefs on close
    Last edited by serthy; 25th August 2015 at 21:11.

  11. The Following User Says Thank You to serthy For This Useful Post:

    Ni3ls (26th August 2015)

Posting Permissions

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