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

Racist Dolphin

Insane-Known Member
Messages
11
Reaction score
8
Points
358
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
4,873
Reaction score
2,882
Points
1,053
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

Insane-Known Member
Messages
11
Reaction score
8
Points
358
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
4,873
Reaction score
2,882
Points
1,053
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

Insane-Known Member
Messages
11
Reaction score
8
Points
358
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
4,873
Reaction score
2,882
Points
1,053
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
4,873
Reaction score
2,882
Points
1,053
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

Insane-Known Member
Messages
11
Reaction score
8
Points
358
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
4,873
Reaction score
2,882
Points
1,053
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.
 

Racist Dolphin

Insane-Known Member
Messages
11
Reaction score
8
Points
358
clearAllTextAfterHudElem() is a core function and doesn't require any includes. Maybe they remove the function from black ops 3.
Well is there a way to clear the strings that I'm creating? They must be stored somewhere.
 

JayCoder

Veteran
Staff member
Messages
351
Reaction score
150
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
 
Top