OK, I did some testing and got it to work. The reason the script crashed is because the LevelController entity is already in low level mode when it calls the SpawnOrder. You were calling NewOrder() which is a high level method and I was calling LowLevel() when it was already in low level mode. This caused that error to show up.
Let me tell you how my level was setup:
I created a model named "test" that has 2 keys, one at 0.0 and the other at 2.0, I assigned this model to a MovingPlatform entity. I assigned the MovingPlatform entity a szEntityName of "movingplatform1".
I created another model named "trig" and assigned it to a Trigger entity. I assigned the Trigger entity a szEntityName of "trigger1".
I created a LevelController entity and added the script name and set SpawnOrder to "Start"
Here is the script that worked for me:
Code: Select all
{
Start[()
{
Console(true);
SetPlatformTargetTime("movingplatform1", 1.0);
self.think = "Wait";
}]
Wait[()
{
if (GetEventState("trigger1") = true)
{
SetPlatformToTargetTime("movingplatform1", 2.0);
}
}]
}