Answered Setting text to a hud element without using SetText()?

Racist Dolphin

Veteran
Messages
11
Reaction score
8
Points
783
Right now i'm having a problem using SetText(), in a loop anyways it crashes after 25 - 30 minutes of game time.
The error: BG_Cache_GetIndexInternal - Exceeded '2048' items for type 'string'

Does NewHudElem have a text property I can use?
.text doesn't work.
modify_inline.gif
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
Right now i'm having a problem using SetText(), in a loop anyways it crashes after 25 - 30 minutes of game time.
The error: BG_Cache_GetIndexInternal - Exceeded '2048' items for type 'string'

Does NewHudElem have a text property I can use?
.text doesn't work.
modify_inline.gif
This is caused by a string overflow. You could create a string overflow fix which deletes the strings after an specif amount of strings to prevent the game from crashing.

If you want to display a variable with the HUD-Element, you could use setValue which won't face this issue.

What type of string would you like to display with your HUD-Element?
 

Racist Dolphin

Veteran
Messages
11
Reaction score
8
Points
783
This is caused by a string overflow. You could create a string overflow fix which deletes the strings after an specif amount of strings to prevent the game from crashing.

If you want to display a variable with the HUD-Element, you could use setValue which won't face this issue.

What type of string would you like to display with your HUD-Element?
How would I go about deleting the string?
Which array are strings stored?

I know deleting the hud and re-creating it doesn't work either.

I'm using NewHudElem and have also tried createFontString.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
How would I go about deleting the string?
Which array are strings stored?

I know deleting the hud and re-creating it doesn't work either.

I'm using NewHudElem and have also tried createFontString.
There are a few overflow fixes out there for black ops 2, you could port one to black ops 3. What generally the issue is with the strings is written here: Answered - Help! Me Out with a Overflowfix | CabConModding

What do you want to display with the element?
 

Racist Dolphin

Veteran
Messages
11
Reaction score
8
Points
783
There are a few overflow fixes out there for black ops 2, you could port one to black ops 3. What generally the issue is with the strings is written here: Answered - Help! Me Out with a Overflowfix | CabConModding

What do you want to display with the element?
Well the function ClearAllTextAfterHudElem does exist, but I don't know what parameters it needs. I just tried putting the hud in but still got an error.

**** 1 script error(s):
"clearalltextafterhudelem" with 1 parameters in "scripts/zm/gametypes/_clientids.gsc" at line 110 ****
**** Unresolved external "clearalltextafterhudelem" with 1 parameters in "scripts/zm/gametypes/_clientids.gsc" ****
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
Well the function ClearAllTextAfterHudElem does exist, but I don't know what parameters it needs. I just tried putting the hud in but still got an error.

**** 1 script error(s):
"clearalltextafterhudelem" with 1 parameters in "scripts/zm/gametypes/_clientids.gsc" at line 110 ****
**** Unresolved external "clearalltextafterhudelem" with 1 parameters in "scripts/zm/gametypes/_clientids.gsc" ****
What do you want to display with your HUD-Element?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
I'm creating a stopwatch.
Thank you. In this case it's better to create a hud with setText to defined the string and to create next to this message a hud with setValue to defined the time. With setValue you won't have any string issue.

Code:
void <hud_value_element> SetValue(<value>)
[MANDATORY] <value> The value to set the element to
CATEGORY: UI
CLIENT/SERVER: Server
SUMMARY: Set a value HUD element to a given value.
EXAMPLE: level.reinforcement_hud SetValue( 0 )
 

Racist Dolphin

Veteran
Messages
11
Reaction score
8
Points
783
s better to create a hud with setText to defin
I tried this, but you can't add a colon to it. Creating multiple huds side by side would be extremely difficult and would look sloppy.

Right now I'm thinking i'm probably missing a using and thats why ClearAllTextAfterHud isn't working. Which script do I need to be using?

#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#using scripts\shared\ai\zombie_utility;
#using scripts\shared\hud_util_shared;
#using scripts\shared\rank_shared;

#using scripts\zm\_zm_score;
#using scripts\zm\_zm_utility;
#using scripts\zm\_zm_perks;
#using scripts\zm\_zm_lightning_chain;
#using scripts\zm\_zm_weapons;
#using scripts\zm\_zm_powerups;
#using scripts\zm\_zm_powerup_fire_sale;
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
I tried this, but you can't add a colon to it. Creating multiple huds side by side would be extremely difficult and would look sloppy.

Right now I'm thinking i'm probably missing a using and thats why ClearAllTextAfterHud isn't working. Which script do I need to be using?

#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#using scripts\shared\ai\zombie_utility;
#using scripts\shared\hud_util_shared;
#using scripts\shared\rank_shared;

#using scripts\zm\_zm_score;
#using scripts\zm\_zm_utility;
#using scripts\zm\_zm_perks;
#using scripts\zm\_zm_lightning_chain;
#using scripts\zm\_zm_weapons;
#using scripts\zm\_zm_powerups;
#using scripts\zm\_zm_powerup_fire_sale;
clearAllTextAfterHudElem() is a core function and doesn't require any includes. Maybe they remove the function from black ops 3.
 

JayCoder

Veteran
Staff member
Messages
375
Reaction score
148
Points
903
clearAllTextAfterHudElem() is a core function and doesn't require any includes. Maybe they remove the function from black ops 3.
Its not removed it got changed to what i don't know haven't really looked into it
 

NightwalkerLots

Well-Known Member
Messages
8
Reaction score
0
Points
201
Its not removed it got changed to what i don't know haven't really looked into it
I've been looking at how to recreate this function for the past month. Currently, there is no such thing as a String Overflow Fix for BO3. Not unless someone wants to recreate it at the injector level. I have asked boggy, who runs infinity loader, if he could recreate it. He said, "I can add that". So I guess we'll see.
 

JayCoder

Veteran
Staff member
Messages
375
Reaction score
148
Points
903
I've been looking at how to recreate this function for the past month. Currently, there is no such thing as a String Overflow Fix for BO3. Not unless someone wants to recreate it at the injector level. I have asked boggy, who runs infinity loader, if he could recreate it. He said, "I can add that". So I guess we'll see.
u don't need an inject to make a overflow fix, that dumb to even think that.
 

NightwalkerLots

Well-Known Member
Messages
8
Reaction score
0
Points
201
u don't need an inject to make a overflow fix, that dumb to even think that.
Oh. Then you must have coded one for BO3 in gsc? I'd love for you to share it.

If it's dumb to think that, then I guess agreed bog, and serious are dumb. People I consider way smarter than me. Which they have said it would have to be recreated by the injector itself.
 

Attachments

  • Screenshot_2023-06-16-14-17-22-54_572064f74bd5f9fa804b05334aa4f912.jpg
    Screenshot_2023-06-16-14-17-22-54_572064f74bd5f9fa804b05334aa4f912.jpg
    439.2 KB · Views: 117
Last edited:
Top