Repository navigation
EzTrigger
EzTrigger is a system since GodotVectorier beta 1.2 that makes life easier for those who make use of triggers. In simple terms, EzTrigger offers the user a easier language to code triggers in, then automatically converts that to the correct format.
Instead of typing
<Init>
<SetVariable Name="$AI" Value="0"/>
</Init>
<Loop>
<Actions>
<Camera Follow="_$Model"/>
</Actions>
</Loop>
We could simply do
var $AI = 0
loop
cameraFollow _$Model
In our trigger command, simple, readable and easy to understand, no?
Insert this notation in the beggining line, this will create a single loop and you don't need to add loops.
$noLoops
var $AI = 0
cameraFollow _$Model
=
<Init>
<SetVariable Name="$AI" Value="0"/>
</Init>
<Loop>
<Actions>
<Camera Follow="_$Model"/>
</Actions>
</Loop>
Not that life changing of a notation but it is here :)
appendValue <Name> <Value> // Appends a value to a variable
cameraFollow <Model> // Commands the camera to follow said model, use _$Model to reference the model who's triggering said command.
cameraSmoothness <Number> // Sets camera smoothness
cameraStop <1|0> // Sets either the camera should be stopped or not.
cameraZoom <Number> // Sets camera zoom
// Message commands
* message <Text> color <Color> frames <Frames> appear <Style> disappear <Style>
* message <Text> color <Color> frames <Frames>
* message <Text> color <Color>
* message <Text> frames <Frames>
* message <Text>
loss <Model> <Frames> // Triggers a game loss
victory <Model> <Frames> // Triggers a game victory
endgame <Result> <Model> <Frames> // Triggers a game end depending on the <Result>
forceAnimation <AnimName> model <Model> frame <Frame> reversed <0|1> // Forces <AnimName> animation in the specified model.
sound <Name> // Plays a sound
control <On|Off> <Model> // Toggles movement in specified <Model>
setTimer <Frames> // Sets a timer, when that timer ends, all loops with the Timeout event in this command will be triggered.
setVariable <Name> <Value>
pressKey <Up|Down|Left|Right> <Model> // Presses a specified key in <Model>
transform <Id> // Triggers a transform with specified <Id>
wait <Frames> // Waits <Frames> before the next action.
use the event keyword followed by the event name.
Example input: event Enter
Example output: <Enter/> in the output trigger xml's Events block
Format: event <eventName>
use the if keyword followed by the value to be compared, the operator and the value to compare with.
Example input: if ?getModel[Player].worldPositionX > ?getModel[Hunter].worldPositionX
Example output: <Greater Value1="?getModel[Player].worldPositionX" Value2="?getModel[Hunter].worldPositionX"/> in the output trigger xml's Conditions block
You can use the =, < and > operators.
Format: if <value> = <value2>
And that should be everything.