• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spaces in Strings.

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
When working with the war3map.wts file or GUI triggers (which is basically the same) you have to use the enter key. When directly working with JASS strings the enter key, \r\n and also \r and \n alone work fine.
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
When working with the war3map.wts file or GUI triggers (which is basically the same) you have to use the enter key. When directly working with JASS strings the enter key, \r\n and also \r and \n alone work fine.

Im pretty sure pressing enter simply saves said variable.
Could you explain more about \n?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Im pretty sure pressing enter simply saves said variable.
Depends. There are multi-line and single-line GUI string fields.
Could you explain more about \n?
Uhm it's an escape sequence.
GUI operated strings are most often saved in the war3map.wts file, the trigger string file. However the escape sequences are not parsed correctly but as normal separate characters. You still can edit the .wts file directly though.

If you specify a string directly in JASS there is no saving in the .wts file by default and those escape sequences work.
 
Status
Not open for further replies.
Top