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 1 Guest are viewing this topic.
16,152 views
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.
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);
}

Before you posted this, I removed the if statement above it while also changing what you said, now it works great!
 Edit: I'll try this nonetheless.
Edit2: That fix didn't work. What I mentioned did.
Last Edit: June 26, 2014, 10:22:12 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
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.
That's because I wrote self instead of players[k]. I don't follow what you are saying fixed it but try changing
Code Snippet
Plaintext
self.leftstring = leftstring;
to
Code Snippet
Plaintext
players[k].leftstring = leftstring;
first.
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.
That's because I wrote self instead of players[k]. I don't follow what you are saying fixed it but try changing
Code Snippet
Plaintext
self.leftstring = leftstring;
to
Code Snippet
Plaintext
players[k].leftstring = leftstring;
first.

What I meant that I fixed it as when you said

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.

I did exactly that while also removing the line

Code Snippet
Plaintext
if(isDefined(self.lookingattrig) && self.lookingattrig == trig) return; //no need to keep calling the thread

After I did that the hintstring properly updates when still in the trigger.



Other than that, the fix you suggested in the last post also worked. (It dissappears for like a tenth of a second but I don't mind that)
Last Edit: June 26, 2014, 10:35:54 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.
Alright, thanks. Wiki updated to v1.3.
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, thanks. Wiki updated to v1.3.

You forgot the isLookingAtEnt(ent) function in the source code. xD
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.
You forgot the isLookingAtEnt(ent) function in the source code. xD
Oops, wiki updated.
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.
A little video showing off the fix on my test triggers as of v1.3. :)

www.youtube.com/watch?v=rkKigfjeaAs
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.
Awesome!
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.
Bug Report: Having a thing for the USE key like "&&1" causes the hintstring not to update until you walk away from the trigger than towards 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.
Bug Report: Having a thing for the USE key like "&&1" causes the hintstring not to update until you walk away from the trigger than towards it.
Maybe because I only check the left side of the string. Please write the full hintstring you are using and what you are changing it to.
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.
Maybe because I only check the left side of the string. Please write the full hintstring you are using and what you are changing it to.

Pretty much the same thing in the video, Just randomly added in a "Press &&1"

Code Snippet
Plaintext
trig _setHintString("[Hintstring A] Press &&1 This is hintstring number: " + level.hintstringtest + "!");

Fixed using the info you gave me.

Added
Code Snippet
Plaintext
players[k].rightstring = rightstring;
under
Code Snippet
Plaintext
players[k].leftstring = leftstring;

and replaced

Code Snippet
Plaintext
while(isDefined(trig) && isDefined(self.leftstring) && self.leftstring == leftstring && (self islookingatent(trig) && (distance(self.origin, trig.origin) < 75) || self isTouching(trig)))

with

Code Snippet
Plaintext
while(isDefined(trig) && isDefined(self.leftstring) && self.leftstring == leftstring && isDefined(self.rightstring) && self.rightstring == rightstring && (self islookingatent(trig) && (distance(self.origin, trig.origin) < 75) || self isTouching(trig)))
Last Edit: June 27, 2014, 12:33:35 am 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.
Looks good, fixed and updated to 1.4.
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.
Also small question. Does use up any limits? Not sure hud.menu counts as towards the hud limit.
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.
Also small question. Does use up any limits? Not sure hud.menu counts as towards the hud limit.
None whatsoever.
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 1 day ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
I am currently trying to implement this feature but the link to: http://ugx-mods.com/downloads/tutorials/trem_hintstrings.iwd doesn't work anymore.

I know the source is on the wiki but you commented this in the script:
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name     : trem_hintstrings.gsc
//|||| Info     : Fixes hintstrings that don't update.
//|||| Site     : www.ugx-mods.com
//|||| Author       : [UGX] treminaor
//|||| Notes        : v1.3
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

I checked it and I think you only forgot to change the version number from 1.3 to 1.4?
Last Edit: May 15, 2018, 06:50:20 pm by gympie6

 
Loading ...