20 Commits

Author SHA1 Message Date
Celtic Minstrel
0c42cdc038
Enable translation mark validation by the schema (#5800)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.

A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)

Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.

An optionally-translatable string could also be defined as a union of t_string and some other type.
2021-06-14 23:59:52 -04:00
Celtic Minstrel
d5b8d96118
Schema: Add lua_goal support (#5833)
Also add an else to the goal validation cases, which will produce an error in the event of an invalid name value
2021-06-05 23:20:20 -04:00
mattsc
fe316aec3a Add new AI aspect retreat_enemy_weight 2021-02-26 13:57:13 -08:00
mattsc
efe5a4d497 Add new AI aspect retreat_factor 2021-02-25 20:25:16 -08:00
mattsc
cf3be040ca Schema validation: add missing AI aspect 2018-12-03 18:19:44 -08:00
mattsc
dca3fe71bb Schema validation: add new AI keys 2018-12-03 18:19:37 -08:00
mattsc
f53e3b9565 Schema validation: remove attack_depth aspect
It's been removed from the AI.
2018-11-16 06:45:40 -08:00
Celtic Minstrel
52c4dc0e3d Add a validator subclass specialized for validating WML schemas against the WML schema schema 2018-11-03 17:09:25 -04:00
Celtic Minstrel
4674e97eb6 Schema: Add a macro for links (and make use of it) 2018-10-23 22:49:53 -04:00
Celtic Minstrel
d70fee5afc Schema: Fix issue with matching [modify_ai] for attacks aspect 2018-10-23 22:49:32 -04:00
Celtic Minstrel
67c6de0a4e Schema: Accept variable substitution in most aspect values 2018-10-23 22:39:53 -04:00
Celtic Minstrel
9b9fdf2c52 Schema: Simplify the simple non-scalar aspect definitions 2018-10-23 22:39:52 -04:00
Celtic Minstrel
151a1fb66c Schema: Forgot id key in [leader_goal] 2018-10-23 22:39:51 -04:00
Celtic Minstrel
17b1127175 Schema: Fixup [goal] definition 2018-10-23 22:39:48 -04:00
Celtic Minstrel
9a966a46f5 Schema: Support omitting the final index in [modify_ai] paths
Also mark the subtags in [modify_ai] as required
2018-10-23 22:39:47 -04:00
Celtic Minstrel
da7fcaa5e1 Schema: Definition of [modify_ai] tag
Also reorder some things in [aspect] for better matching
2018-10-23 22:37:42 -04:00
Celtic Minstrel
644ff73c92 Schema: Add feature to [switch] to allow a [case] to match the absence of the key
Use this to support the default [goal] name
2018-10-23 22:37:38 -04:00
Celtic Minstrel
6d4b789e5b Schema: Use the new globbing feature to improve [aspect] definition
Also fix [engine] switch
2018-10-23 22:37:37 -04:00
Celtic Minstrel
c2716728e5 A few more missing pieces to the AI schema 2018-10-23 22:37:36 -04:00
Celtic Minstrel
faa8decdc8 WIP Schema for the AI WML
Pretty much all working, except for the [aspect] tag
Also, [modify_ai] is not yet specified (needs new schema features)
2018-10-23 22:37:33 -04:00