Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 09:54:51 am
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.
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: RamboBadass on June 26, 2014, 03:45:22 pm
sweet ... tobad it wasn't fig out before undead town lol
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 06:37:48 pm
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.
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: RamboBadass on June 26, 2014, 07:00:43 pm
^ mine? Lol
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 07:30:43 pm
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.
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 08:49:40 pm
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)
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 08:57:09 pm
Alright the wiki is completely updated with a new method that doesn't use hintstrings at all. It should actually work this time :)
Title: Re: [Wiki] How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 09:15:56 pm
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 09:16:52 pm
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 09:21:15 pm
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
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 09:26:19 pm
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 10:01:27 pm
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 10:06:41 pm
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 10:16:47 pm
Try replacing two functions in the trem_hintstring.gsc with these:
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.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 10:25:32 pm
That's because I wrote self instead of players[k]. I don't follow what you are saying fixed it but try changing to first.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 10:33:08 pm
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
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)
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: treminaor on June 26, 2014, 10:39:22 pm
Alright, thanks. Wiki updated to v1.3.
Title: Re: [Wiki] (Updated) How to fix hintstrings that don't update.
Post by: ProGamerzFTW on June 26, 2014, 10:59:00 pm