A recent update in the Lua extension makes it consider all fields that are defined as table entries annotated with @type to be readonly (providing a somewhat misleading warning saying that they don't exist). Defining them as @field annotations on the class makes it tread them normally.
This affects ScriptActorProperties and ScriptPlayerProperties.
The Lua extension would report missing/uninitialized fields on actor creation because it thought they were required. This makes them all optional, except for OwnerInit, which is special.
Issues:
- The generated API file caused a ton of diagnostics warnings.
- Perhaps due to EmmyLua moving forward since this was created, we were missing out on some features.
Changes:
- Disabled diagnostics about missing return values for functions.
- Added add operator definitions because by default CPos+CVec would be assumed to return a number and assignments would cause warnings about type mismatches.
- Added explicit @enum annotations. This also fixed warnings in the generated API file about missing types.
- Changed default type of properties from an empty table to nil. This fixed warnings in the generated API file about type mismatch.
- Renamed local variable "required" -> "requiredTraits" for readability.
- Disabled duplicate function/property name warnings
- Updated trait docs URL.