Commit 62419dd7 authored by Mikleo's avatar Mikleo

added docs

parent be1228ca
Pipeline #9386 passed with stages
in 14 seconds
......@@ -9,7 +9,7 @@
#include <updater>
#define PluginVersion "0.98"
#define PluginVersion "0.99"
float pVersion;
// note linearmap field is unstable
......
......@@ -6,19 +6,19 @@
"BE_Tickets" "402.000000"
"Scripts"
{
"OnScenarioLoaded" "Run Introduction Introduction2 "
"OnScenarioLoaded" "Run Introduction Introduction2"
"Introduction" "After 60 -> ChatText *Gen. Strickland:TXTCLR_DF Listen up, the artifact in the ruins will provide us an enormous technological advantage in the war to come* *Gen. Mendez:TXTCLR_DF Intel has detected an artifact in the south east ruins with enormous strategic value* **"
"Introduction2" "After 65 -> ChatText *Gen. Strickland:TXTCLR_DF Our objective is clear, defend the artifact at any cost.* *Gen. Mendez:TXTCLR_DF Our objective is clear, destroy the artifact at any cost.* **"
"OnGameStart" "TargetName artifact -> Run ObjectiveTimer Warning DestroyTrigger AirStrikeExec1 AirStrikeExec2 SmartIdeas AirStrikeExec3"
"ObjectiveTimer" "TextTimer 1200 *Defend The Artifact\TIME_LEFT $[m_iHealth]HP* *Destroy The Artifact\TIME_LEFT $[m_iHealth]HP* -> TargetName params -> Input InputNFWin 0 EndActivator"
"DestroyTrigger" "OnOutput OnBreak -> TargetName params -> Input InputImpWin 0 EndActivator"
"ObjectiveTimer" "TextTimer 1200 *Defend The Artifact\TIME_LEFT $[m_iHealth]HP* *Destroy The Artifact\TIME_LEFT $[m_iHealth]HP* -> TargetParams -> Input InputNFWin 0 EndActivator"
"DestroyTrigger" "OnOutput OnBreak -> TargetParams -> Input InputImpWin 0 EndActivator"
"Warning" "After 400 -> ChatText *Gen. Strickland:TXTCLR_DF Intel has revealed that the enemy are planning airstrikes on key buildings at our location. Don't take any defences for granted!* *Gen. Mendez:TXTCLR_DF Be alert, We have allied bombers in the area which will deliver precision airstrikes on enemy targets* **"
"AirStrikeExec1" "After 600 -> TargetClassname emp_building_radar 2-> Run AircraftEffect -> SetHealth 0 -> After 2 -> Run AirStrikeNotice1 -> After 10 -> Input Kill"
"AirStrikeNotice1" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Our radar has just been taken out by a precision airstrike!* *Gen. Mendez:TXTCLR_DF Great news! A precision allied airstrike has just taken out the enemy radar! *"
"AirStrikeExec2" "After 900 -> TargetClassname emp_building_vehiclefactory 2 -> Run AircraftEffect -> SetHealth 0 -> After 2 -> Run AirStrikeNotice2 -> After 10 -> Input Kill"
"AirStrikeNotice2" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Our vehicle factory has just been taken out by a precision airstrike!* *Gen. Mendez:TXTCLR_DF Great news! A precision allied airstrike has just taken out the enemy vehicle factory! *"
"SmartIdeas" "After 1000 -> ChatText ** *Gen. Mendez:TXTCLR_DF Listen up maggot, anyone else with 'smart' suggestions about airstriking the artifact will be reassigned to the bioweapon research division.* **"
"AirStrikeExec3" "After 1050 -> Run AirStrikeWarning3 -> After 50 -> TargetName params -> Run AircraftDownEffect -> Input SetNFTickets 1 -> After 2 -> Run AirStrikeNotice3"
"AirStrikeExec3" "After 1050 -> Run AirStrikeWarning3 -> After 50 -> TargetParams -> Run AircraftDownEffect -> Input SetNFTickets 1 -> After 2 -> Run AirStrikeNotice3"
"AirStrikeWarning3" "ChatText *Gen. Strickland:TXTCLR_DF We have a mole, intel has revealed that someone has just leaked our flight plans. Be prepared to run out of reinforcements soon.* *Gen. Mendez:TXTCLR_DF We have just recieved intel on enemy reinforcement flight plans, dispatching fighters. *"
"AirStrikeNotice3" "ChatText *Gen. Strickland:TXTCLR_DF Oh no! Enemy Fighters have shot down our remaining reinforcements. You're on your own now!* *Gen. Mendez:TXTCLR_DF Our Fighters have just shot down enemy reinforcements. Use this to your advantage, strike now! *"
"AircraftEffect" "EmitSound *ambient/explosions/explode_2.wav*"
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.98"
"Latest" "0.99"
}
}
......
##Fowards
OnScenarioLoaded
OnGameStart
OnGameEnd
##Commands
O: denotes optional argument.
Run [ScriptName] ...[O:ScriptName]
After [Delay] [O:Identifier]
Every [Frequency] [O:Identifier]
TargetName [name] [O:Team]
TargetNameAll [name] [O:Team]
TargetClassname [classname] [O:Team]
TargetClassnameAll [classname] [O:Team]
TargetParams
Input [InputName] [O:InputValue]
OnOutput [OutputName] [O:Identifier] [O: "TargetActivator"]
ChatText [NFText] [O:BEText] [O:SpecText]
HudText [NFText] [O:BEText] [O:XPos] [O:YPos]
TextTimer [TimeLeft] [NFText] [O:BEText]
EmitSound [SoundName] - More arguments in future
FilterTeam [Team]
SetHealth [Health]
Cancel [Identifier] ...[O:Identifier]
RunIf [value] [condition] [value] [scriptname] [O:"ELSE"] [O:scriptname]
#Scenario Scripting
##Basics
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*"
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.
You can check the commandlist.md file for a list of commands.
## Entity Management
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"
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.
// Inputs
InputNFWin(void), InputImpWin(void),
SetNFTickets(integer), SetBETickets(integer),
ModifyNFTickets(integer), ModifyBETickets(integer),
SetNFResources(float),SetBEResources(float)
ModifyNFResources(float), ModifyBEResources(float)
"OnGameStart" "Run HookDeath"
"HookDeath" "TargetName Destructable -> OnOutput OnBreak -> TargetParams -> Input SetNFTickets 0"
You can use TargetName to change the associated entity of the next command. . Note here that OnBreak is only an output of a dynamic prop.
"OnGameStart" "After 100 -> DestroyAllTanks"
"DestroyAllTanks" "TargetClassnameAll emp_vehicle -> Input Kill -> ChatText *I killed a tank*"
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.
## Deferred commands
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"
"StartMessages" "Every 10 HelloWorldIdentifier -> ChatText *Hello World*"
"StopMessages" "Cancel HelloWorldIdentifier"
This will repeat the message until after 60 seconds when it will stop.
It is important to note that while this command is totally valid:
"DoSomething" "After 5 -> Run DoSomething"
This command (or any chain that only uses non-deferred statements) will cause the script to break. Don't do this:
"DoSomethingStupid" "Input Kill -> Run DoSomethingStupid"
##Error checking
You don't want to have to test the scenario to see if there are obvious errors in the scripts.
Pay attention to chat when you load a scenario, it will say if it has found errors and you can look at the console for details.
This will catch
- Incorrect/Unknown commands(e.g. Aftre Rum)
- Run commands that reference scripts that dont exist
- A few other minor issues.
However it will not catch problems with your command arguments.
##Variables (advanced)
You can inject entity properties into strings on most commands. These properties are not the scenario properties but entity properties.
You can see the assosiated entprops in entdata.txt. some common examples
$[m_iTeamNum]
$[m_iHealth]
$[m_iName]
... many more
"OnGameStart" "TargetName artifact -> ChatText *My name is $[m_iName], my health is $[m_iHealth]*"
It will check If the property exists, if it doesent, it wont replace the text.
Another example:
"OnGameStart" "TargetNameAll resbox -> OnOutput OnBreak _ TargetActivator -> RunIf $[m_iTeam] == 2 NFKilled ELSE BEKilled"
"NFKilled" "ChatText *NF killed resbox and gets 1000 resources* -> TargetParams -> Input ModifyNFResources 1000"
"BEKilled" "ChatText *BE killed resbox and gets 1000 resources* -> TargetParams -> Input ModifyBEResources 1000"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment