Raised This Month: $51 Target: $400
 12% 

[L4D2] Hintpanel doesn't draw the text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 06-27-2011 , 15:31   [L4D2] Hintpanel doesn't draw the text
Reply With Quote #1

Hi guys.

Just trying to write some sort of training-plugin and noticed something odd. I'm using the hinttext-command to display a clock and right from the first appearance of the hintpanel it doesn't show up the text. So you just see the background which keeps changing it's length because of the varying text, but no text at all. I have to press ESC and get into an options-menupanel and then back in the game and only after that it works, although this might change the hinttext-color to gold instead of white.

Anyone got a clue on this?



Thx in advance!
Dr. Greg House is offline
BrianGriffin
Senior Member
Join Date: Oct 2008
Old 06-28-2011 , 00:00   Re: [L4D2] Hintpanel doesn't draw the text
Reply With Quote #2

Is your hint starting with a "["? I know that menus starting with a [ aren't displayed on L4D2.

https://bugs.alliedmods.net/show_bug.cgi?id=4883
BrianGriffin is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 06-28-2011 , 10:31   Re: [L4D2] Hintpanel doesn't draw the text
Reply With Quote #3

Nope.
It doesn't even show up correctly when I only use "TEST" as the hintmessage.
Code:
PrintHintTextToAll("%s", "TEST");
Updated MM and SM to the latest developement branch now, no difference.

Some more Code:

Code:
public Action:Timer_UpdateTimeInfo(Handle:timer)
{
    UpdateTimeInfo();
    
    return Plugin_Continue;
}

public UpdateTimeInfo()
{
    deltaT=GetEngineTime()-starttime;
    
    //FormatTimeInfo(deltaT, timeinfo, sizeof(timeinfo));
    
    PrintHintTextToAll("%s", "TEST");
}



new String:deltaTString[20];
new pointcharpos;

public FormatTimeInfo(Float:deltaT, String:result[], bufferlength)
{
    FormatTime(result, bufferlength, "%M:%S", RoundToFloor(deltaT));
    FloatToString(deltaT, deltaTString, sizeof(deltaTString));
    
    pointcharpos=FindCharInString(deltaTString, '.');
    
    result[5]=':';
    result[6]=deltaTString[pointcharpos+1];
    result[7]=deltaTString[pointcharpos+2];
    result[8]='\0';
}
As I said, I have to press ESC first and go into an optionsmenu, after that it shows the string over the hintbackground as well. This is not client-related since my friend experienced the same problem when he joined the server running this plugin.

However if I set the interval to 10.0 seconds, this works right from the beginning. Interesting is, that this can't be a "hintupdate"-issue, because hint created by the first tick isn't be drawn correctly as well.
I'm trying to find the threshold-interval now, already tested 0.1, 0.2 (none of them worked), and 10.0 (worked).

Last edited by Dr. Greg House; 06-28-2011 at 11:07.
Dr. Greg House is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-28-2011 , 10:54   Re: [L4D2] Hintpanel doesn't draw the text
Reply With Quote #4

Whatever you're doing, it should be
PrintHintTextToAll("%s", TEST); where test is either a convar, a value, float, or something else.

and not PrintHintTextToAll("%s", "TEST");

And if it's only a message:
PrintHintTextToAll("message");

Last edited by Visual77; 06-28-2011 at 10:58.
Visual77 is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 06-28-2011 , 10:58   Re: [L4D2] Hintpanel doesn't draw the text
Reply With Quote #5

Since I just wanted to print "TEST" and not the value of a variable, the code is fine, regardless of it is a good style of coding. Anyway, this isn't affecting the bugs behavior.

EDIT:
So far I can say that any interval below 2.0 seconds doesn't work.

Initialization of the timer:
Code:
timeinfoTimer=CreateTimer(2.0, Timer_UpdateTimeInfo, _, TIMER_REPEAT);

Would be nice to hear a sm-developer's opinion about this.

Last edited by Dr. Greg House; 06-28-2011 at 16:20.
Dr. Greg House is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode