Scenario scripts are basically like a chain of sourcemod commands. The chain begins with the default forwards. e.g. OnScenarioLoaded, OnGameStart and ends when there are no more commands in the chain.
The Run command can run other named scripts, even several at the same time.
"OnGameStart" "Every 10 -> Run Message1 message2"
"Message1" "ChatText *Hello World*"
"message2" "ChatText *Hi*"
"OnGameStart" "Every 10 -> Run Message1 Message2"
"Message1" "ChatText *Hello World*"
"Message2" "ChatText *Hi*"
This will print both these messages every 10 seconds. Notice that we are using '*' instead of speech marks, it works the same way speech marks work in sourcemod commands, this is only because keyvalues are already delimited by speech marks.
...
...
@@ -18,23 +17,26 @@ You can check the commandlist.md file for a list of commands.
Every command in the chain will run with a SINGLE associated entity. The default forwards will start with emp_params as their assosiated entity.
Inputs and Outputs of entities are very useful, you can look at Empires\bin\Empires.FGD for details of inputs and outputs.
"OnGameStart" "After 600 -> Input InputNFWin"
"OnGameStart" "After 600 -> Input InputNFWin"
This works because the starting entity is emp_params and it has an input of InputNFWin. here is a copy of very useful emp_params inputs from Empires.FGD.
Using TargetClassnameAll and TargetNameAll you can target multiple entities which Runs a seperate chain for each one found. In this example the chat message will be spammed for every tank the script found.
...
...
@@ -43,22 +45,23 @@ Using TargetClassnameAll and TargetNameAll you can target multiple entities whic
Deferred Commands are commands like After, Every and onOutput. These commands will be cleared on OnGameEnd and OnMapEnd, so most of the time you don't need to worry about them.
However you can also specify an identifier so that you can cancel these commands at any time.
"OnGameStart" "Run StartMessages -> After 60 -> Run StopMessages"