UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Wiki] (Updated) How to fix hintstrings that don't update.

HOTPINNED
broken avatar :(
Created 10 years ago
by treminaor
0 Members and 2 Guests are viewing this topic.
16,182 views
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Wiki Link: http://ugx-mods.com/wiki/index.php?title=Hintstrings_not_updating

I believe this is currently the best fix because it actually resolves the engine limit without using any extra HUD elements or other engine resources.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Hmm unless it doesn't apply to this, I tested this by having a trigger with a hintstring with a number that goes up everytime i press the USE key, and it disappears when it gets near 48.
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 11 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
Signature
maps:
Undead Town
http://ugx-mods.com/forum/index.php?topic=2294.0 (Release)
Origins 1922
http://ugx-mods.com/forum/index.php?topic=2659.0
[WIP] mapping 39%, weapons 85%, scripts 65%
[/url]
×
RamboBadass's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
RamboBadass's Contact & Social LinksAsk merambobadassRamboDaGreat
sweet ... tobad it wasn't fig out before undead town lol
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Hmm unless it doesn't apply to this, I tested this by having a trigger with a hintstring with a number that goes up everytime i press the USE key, and it disappears when it gets near 48.
I just did the same test and ran into the limit. However I do not think this is a valid test as you are not giving the script a chance to reset the hintstring to " " after every change, which bypasses the script entirely. I doubt any script is going to need to change the hintstring 48 times while the player is standing there staring at it. I'm going to apply this fix to a community map that I remember had a hintstring issue and see if it's fixed.

I was running into the hintstring limit on my testmap and after adding this fix I no longer had the issue or saw the error - so if that was just some coincidence then I do have another idea that doesn't involve HUD elems that I will try.
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 11 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
×
RamboBadass's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
RamboBadass's Contact & Social LinksAsk merambobadassRamboDaGreat
^ mine? Lol
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I just tested it on Undead Town and it seemed to work. First I did a test where I did not implement the script and played the map to see when the hintstrings would break. Once I turned the power on, using the UGX Jukebox worked but the hintstring never changed from "Press &&1 to use the Jukebox [Cost: 10]". It should change to "Currently playing a song.".

Once I added the fix to his ugx_jukebox.gsc, power_switches.gsc, buy_powerup.gsc, and _zombiemode_perks.gsc and played the map again the exact same way, the Jukebox trigger worked. Then I noticed the PaP machine trigger wasn't updating when the power turned on so I added it to that too, and then it worked. I did not find any more broken hintstrings on the map after that. So I think the key to this fix working is to make sure you apply it to as many triggers on the map as possible, because that brings the total count of hintstrings down.

Regardless I don't like that this is not a confirmed 100% fix so I'm going to make some major changes to the way it works and release an update.

Please try adding the current fix to more triggers on your map and tell me if you still can't tell if it's working.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Did another test having 3 triggers labeled A, B, and C 128 units apart. When their sums once again hits near 48, they dissappear when they change again after hintstring A, B, and C, hit 15, totalling 45. (the other 3 is my windows and the one wall weapon with the fix unapplied)
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Alright the wiki is completely updated with a new method that doesn't use hintstrings at all. It should actually work this time :)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Alright the wiki is completely updated with a new method that doesn't use hintstrings at all. It should actually work this time :)

Works. Found a bug, when a "hintstring" change happens while in the trigger, it flickers between the new and the previous hintstring until you walk away and back to it.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Made a small update to the script to make sure the trig is still defined in the setHintString_show() thread and a check to keep the same thread from being started repeatedly on the same trig. These issues did not affect the functionality of the script but they improve efficiency and eliminate some script errors for those of you in developer_script mode.

Works. Found a bug, when a "hintstring" change happens while in the trigger, it flickers between the new and the previous hintstring until you walk away and back to it.
I'll look into it. Try 1.2, that might fix it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Made a small update to the script to make sure the trig is still defined in the setHintString_show() thread and a check to keep the same thread from being started repeatedly on the same trig. These issues did not affect the functionality of the script but they improve efficiency and eliminate some script errors for those of you in developer_script mode.
I'll look into it. Try 1.2, that might fix it.

1.2 fixed the flickering, but a slightly similar, but minor issue, the hintstring won't update until you walk away and come back. :P
Last Edit: June 26, 2014, 09:21:35 pm by ProGamerzFTW
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
1.2 fixed the flickering, but a slightly similar, but minor issue, the hintstring won't update until you walk away and come back. :P
Alright I'll look into that after lunch. It's because the thread doesn't end until you walk away, so I need to kill it when a new hintstring is passed to the function.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Ah, I jus tnoticed that I had forgot to change "self endon("new_thread");" to "trig endon("new_thread");" in the sethintString_show() function. Try making that change and see if it fixes that issue.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Changed it. Went up to a hintstring and changed it, it didn't update, and it actually didn't go away until I went up into a different hintstring.
Last Edit: June 26, 2014, 10:17:32 pm by ProGamerzFTW
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 8 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Changed it. Went up to a hintstring and changed it, it didn't update, and it actually didn't go away until I went up into a different hintstring.
Try replacing two functions in the trem_hintstring.gsc with these:
Code Snippet
Plaintext
setHintString_fixed_thread(string)
{
self notify("new_thread");
self endon("new_thread");
if(!isDefined(string)) return;
tokens = strTok(string, " ");
end = false;
leftstring = "";
rightstring = "";
for(i=0;i<tokens.size;i++)
{
if(tokens[i] == "&&1" || tokens[i] == "F" || tokens[i] == "[{+activate}]" || tokens[i] == "[Use]") //use key will be added by the menufile
{
tokens[i] = "";
end = true;
}
if(end) rightstring = rightstring + tokens[i] + " ";
else leftstring = leftstring + tokens[i] + " ";
}
players = getPlayers();
while(isDefined(self))
{
for(k=0;k<players.size;k++)
if(players[k] islookingatent(self) && (distance(players[k].origin, self.origin) < 75) || players[k] isTouching(self))
{
self.leftstring = leftstring;
players[k] thread setHintString_show(self, leftstring, rightstring);
}
wait 0.1;
}
}
setHintString_show(trig, leftstring, rightstring)
{
if(isDefined(self.lookingattrig) && self.lookingattrig == trig) return; //no need to keep calling the thread if we're still standing at the same trig
while(isDefined(trig) && leftstring == self.leftstring && (self islookingatent(trig) && (distance(self.origin, trig.origin) < 75) || self isTouching(trig)))
{
self.lookingattrig = trig;
self setClientDvar("trem_hintstring_left", string(leftstring));
self setClientDvar("trem_hintstring_right", string(rightstring));
self setClientDvar("trem_hintstring_vis", 1);
wait 0.1;
}
self.lookingattrig = undefined;
self setClientDvar("trem_hintstring_left", " ");
self setClientDvar("trem_hintstring_right", " ");
self setClientDvar("trem_hintstring_vis", 0);
}

 
Loading ...