• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] JassHelper Error: String Literal Size Limit Exceeded (GUI)

Status
Not open for further replies.
Level 7
Joined
Mar 16, 2014
Messages
169
All I am attempting to do is change a tooltip in the middle of a match. The tooltip is quite long, so this seems to trigger if I have a very long string. Is there any way around this? I can't save the map because of this error if I have a long string like this.
Here's the line of code for anyone curious.

call BlzSetAbilityExtendedTooltip( 'A00N', ( "Azgalor is a psychopath who gets joy from killing others. After he kills a Hero, Azgalor will be on a psychotic high for " + ( I2S(( 10 + GetUnitUserData(GetEnumUnit()) )) + ( " seconds that causes his HP to be unable to be reduced below 1, boosts his damage by 1.1X, boosts his movement speed by 25, and causes his attack cooldown to be reduced by 0.3 seconds from the base value of 2.2 seconds. The damage boost, movement speed boost + " and attack cooldown boost can stack if Azgalor kills multiple heroes. In addition, when killing a Hero, Azgalor will lifesteal 100% of the damage that killed them." ) ) ), 1 )
 
The damage boost, movement speed boost +

You forgot to terminate the string here, so the compiler interprets the quotation marks after:
Azgalor will lifesteal 100% of the damage that killed them."
as the opening of a new string, treating the remainder of your map script as a string. This leads to the String Literal Size Limit Exceeded error.
 
JASS:
call BlzSetAbilityExtendedTooltip( 'A00N', ( "Azgalor is a psychopath who gets joy from killing others. After he kills a Hero, Azgalor will be on a psychotic high for " + ( I2S(( 10 + GetUnitUserData(GetEnumUnit()) )) + ( " seconds that causes his HP to be unable to be reduced below 1, boosts his damage by 1.1X, boosts his movement speed by 25, and causes his attack cooldown to be reduced by 0.3 seconds from the base value of 2.2 seconds. The damage boost, movement speed boost + " and attack cooldown boost can stack if Azgalor kills multiple heroes. In addition, when killing a Hero, Azgalor will lifesteal 100% of the damage that killed them." ) ) ), 1 )

That looks like a monster of a line, but it can be broken down with the multi-line comment symbol: (By the way, to highlight lines of jass code, use [code=jass][/code] tags)


So, the fixed line would look like this:

JASS:
    call BlzSetAbilityExtendedTooltip( 'A00N', ( "Azgalor is a psychopath who gets joy from killing others. After he kills a Hero, Azgalor will be on a psychotic high for " + I2S(10 + GetUnitUserData(GetEnumUnit()) ) + " seconds that causes his HP to be unable to be reduced below 1, boosts his damage by 1.1X, boosts his movement speed by 25, and causes his attack cooldown to be reduced by 0.3 seconds from the base value of 2.2 seconds. The damage boost, movement speed boost and attack cooldown boost can stack if Azgalor kills multiple heroes. In addition, when killing a Hero, Azgalor will lifesteal 100% of the damage that killed them." ), 1 )

If, in doubt, try to cross-check the number of parentheses, and see if the number of "(" symbols is equal to the number of ")" symbols.
 
Status
Not open for further replies.
Top