The reason why you are getting an error is probably because you aren't including the plot's support script. Whenever you create a plot resource a support script is created (and maintained) by the toolset. The support script has the base name as the plot but with a "plt_" prefix and simply contains constants for the plot's GUID and each of the plot's flags.
If you don't include this support script then you have to use the literal value for the plot (either it's name or GUID) and the literal value for it's flags. If you do include it then you can use constants for these values which can make your script a little easier to read.
There error you are seeing is a little bit misleading: it has nothing to do with
var_constants_h. What it is actually telling you is that the compiler has recursively searched all of the include files for this script and couldn't find the
CUTSCENE1_BEENDET constant anywhere so it doesn't know what literal value to replace it with.
Unfortunately, while the syntax of you if statements is correct, I'm afraid the logic appears to be all wrong.
The first condition checks to see
bEventHandled is still
false. Since this is only set to
true by the Click event it will remain
false for all other
placeable events. This means that as soon as the door spawns the plot flag would be set which is not what you want.
The second condition checks a different plot ("TEST" vs. "haupthandlung") so unless the value is being modified elsewhere that condition will always evaluate to
false and will never run which again is not what you want.
The final thing I wanted to say is that cutscenes are not run in line. That means that although we use the
PlayCutscene function to tell the game to play a cutscene "immediately" it doesn't actually do that. The script is allowed to finish and then the client switches game mode to "cutscene mode" (triggering its own event to fire and event script to run) and then the cutscene plays. This is why, for example, we tend to use the other parameters in the
PlayCutscene function or use cutscene's
End Script to call another script.
Modifié par Sunjammer, 29 décembre 2011 - 01:26 .