"initialize" in server-side entity definition scripts doesn't run
Partner Rank:
3
Partner Team Reporting:
Everbloom Studios
Verification builds:
1.14.0.50
Summary:
In server entity definition files, the "description">"scripts">"initialize" array does not run its events/molang expressions, unlike their client side counterparts. This renders us unable to pre-define variables used in server animations, and at some points throws content errors saying variables are undefined.
Impact:
This makes some of our content throw content errors, which lately fails certification.
Repro Steps:
- Create and join the provided world.
- Crouch.
The player is configured to count up a `variable.sneak_count` variable every time the player crouches to do something at 10 crouches.
Observed Results:
When first crouching, a content error appears, saying
[Molang][error] - Error: accessing a variable that doesn't exist: variable.sneak_count
This is due to an expression that does this when entering the crouching state:
variable.sneak_count = variable.sneak_count + 1;
In the player definition file, however, there is a
{"scripts": {"initialize": ["variable.sneak_count = 0;"] }}
which should initialize the sneak_count variable to 0, but this does not run.
Expected Results:
No content error should appear, as the initialize block should run its events.
Screenshots/Videos attached: Yes/No
No
Regression Builds:
None