Bug: Add escape sequence support to postcompiler
Describe the bug
When I put text into quotes in the parameter of an output, the text inside the quotes is deleted when run in-game.
To Reproduce
.
Issue Map
.
Expected Behavior
When I put text into quotes in the parameter of an output in hammer, the text should be run in-game as I wrote it.
Operating System
No response
This works for me? Are you using the unstable branch?
test_io.zip
the escape sequences are properly encoded into the BSP file as well :P
Turns out this is a bug with postcompiler. Not sure if it's just an issue with the ancient one we ship, or if it's been fixed at this point. Postcompiler is stripping out any escape sequences when saving the entity lump. So \\ turns to \ and \" to "
I'll update the issue title accordingly
This is more a srctools thing, I'll just make it export escaped values since that should never happen otherwise. Or could I condition it on an entity lump version, I think I saw you bumped that?
It is a srctools thing, but i marked it as a postcompiler thing, as that's what most end users know it as :P
You could condition it on the entity lump version. Strata now considers v0 as no escape sequences, and v1 as having escape sequence support. Note: I also dropped comment and unquoted string support from v1, but i have never seen anyone actually use those in a BSP before luckily...
Also, thanks for spotting this issue! It's super awesome!
Actually I'll do it unconditionally, since it shouldn't appear unless VBSP supports it in the first place. Or added by a custom postcompiler transform, but that's a problem for the author of those.
I do watch the Strata repos in case something comes up that's my fault, or I know something that might be useful.
Sounds reasonable. Straight from VBSP, a non-Strata vanilla map should pretty much never have a backslash. The v0 format does allow them, but idk if it would ever come up.
Supporting both syntaxes does suck! Especially when it needs to be handled differently in different places.
I just saw the commit to fix this! That was super quick, thank you!
I'll leave this issue open until I finally finish updating our post compiler. I started on it last week, but I'm out of town atm. Should hopefully be done soon.
Forgot to close this, but we did update our postcompiler a while back