ldtk
ldtk copied to clipboard
Multiline default values lose newline character and replace with spaces
Newline characters don't seem to be possible in a default multiline field. They will be replaced with spaces in the JSON and ain't no one gonna change their mind. This seems to only affect the default text placed in the field. I was trying to allow a default script to be attached so the level designers only have to override common use cases if they pop up, but this causes every default script to be shown on a single line. I've posted an example below, but it happens to any default field, those spaces should be newline characters.
"identifier": "touch",
"__type": "String",
"uid": 160,
"type": "F_Text",
"isArray": false,
"canBeNull": true,
"arrayMinLength": null,
"arrayMaxLength": null,
"editorDisplayMode": "Hidden",
"editorDisplayPos": "Above",
"editorAlwaysShow": false,
"editorCutLongValues": true,
"editorTextSuffix": null,
"editorTextPrefix": null,
"useForSmartColor": false,
"min": null,
"max": null,
"regex": null,
"acceptFileTypes": null,
"defaultOverride": {
"id": "V_String",
"params": [
"+keys,item,.item +keys,quantity,.quantity +give,.item,.quantity +console,You picked up <{item}> x{quantity} +destroy +set,flag"
]
},
"textLanguageMode": null,
"symmetricalRef": false,
"autoChainRef": true,
"allowOutOfLevelRef": true,
"allowedRefs": "OnlySame",
"allowedRefTags": [],
"tilesetUid": null
},