Content Patcher

Content Patcher

463k Downloads

[Content Patcher] Validator mocks against Warps with location names including dots and Tokens

Xytronix opened this issue ยท 1 comments

commented

Description

The validator keeps mocking when using warps with dots and tokens. An example is:
{ "Action": "EditMap", "Target": "Maps/{{Modid}}_Location2", "AddWarps": [ "25 40 {{Modid}}.Location 13 1", "26 40 {{Modid}}.Location 14 1", "27 40 {{Modid}}.Location 13 1", "28 40 {{Modid}}.Location 14 1" ],

The following error is thrown on smapi.io/json: Each warp must match the exact format recognized by the game's Warp map property (i.e. 'fromX fromY targetMap targetX targetY', like '10 10 Town 0 30'.
See for example code: (https://smapi.io/json/content-patcher/47a6269a9c1a4787a156c8c15c3def40)

commented

Fixed for dots via Pathoschild/SMAPI@7cb6146 and deployed. Thanks for reporting it!

Tokens are trickier, and it's not really possible to validate the format when they're involved (e.g. they could contain multiple fields). Fortunately I think it's pretty uncommon for AddWarps to contain tokens, so we may need to just ignore the validation warning when tokens are involved.