• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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

Status
Not open for further replies.
Level 7
Joined
Mar 16, 2014
Messages
152
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 )
 

Antares

Spell Reviewer
Level 22
Joined
Dec 13, 2009
Messages
528
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