Difference between revisions of "Scripting"

From Serious Sam's Bogus Detour
Jump to: navigation, search
(Created page with "Scripts in Serious Sam's Bogus Detour are written in [http://www.angelcode.com/angelscript/ Angelscript]. For a reference overview of the scripting language, check out [http:/...")
 
m (Workflow)
 
(5 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
=== Behaviors ===
 
=== Behaviors ===
 
Behaviors are the brains of units. Each unit can have a behavior, which allows them to have logic such as movement or interaction. For example, this could be a Pickup, Breakable, CompositeActorBehavior, Player, etc. See also [[Creating a Behavior]].
 
Behaviors are the brains of units. Each unit can have a behavior, which allows them to have logic such as movement or interaction. For example, this could be a Pickup, Breakable, CompositeActorBehavior, Player, etc. See also [[Creating a Behavior]].
 +
 +
== Workflow ==
 +
 +
By far the best way to work is by having the editor open together with an IDE. After [[Creating a scenario|creating a scenario]], make a test level in your scenario and add your gamemode/worldscript/units to it. Then, after writing some code in your IDE, simply Alt+Tab to the editor and hit Ctrl+T to open the game.
 +
 +
[[File:ScriptingWorkflow.png|900px]]
  
 
== IDE ==
 
== IDE ==
There is currently not a lot of good IDEs available that autocomplete Angelscript, sadly. Therefore, we recommend you use an advanced text editor such as Sublime Text or Notepad++. For Sublime Text, there is a pretty good [https://github.com/wronex/sublime-angelscript syntax highlighter for Angelscript] that you can install.
+
Unfortunately there are currently no full IDEs available for autocompletion with AngelScript. Here's what's currently available in terms of syntax highlighting and basic autocompletion:
 +
 
 +
* [https://code.visualstudio.com/ Visual Studio Code] (free) extension: [https://marketplace.visualstudio.com/items?itemName=renesackers.angelscript Angelscript for VS Code]
 +
* [https://www.sublimetext.com/ Sublime Text] (evaluation period) extension: [https://github.com/wronex/sublime-angelscript syntax highlighter for Angelscript]
  
 
== API reference ==
 
== API reference ==
 
You can find the API reference for the engine [http://ssbd.a000ff.com/docs/engine/ here], and the API reference for the base resources [http://ssbd.a000ff.com/docs/scripts/ here].
 
You can find the API reference for the engine [http://ssbd.a000ff.com/docs/engine/ here], and the API reference for the base resources [http://ssbd.a000ff.com/docs/scripts/ here].

Latest revision as of 12:22, 27 June 2017

Scripts in Serious Sam's Bogus Detour are written in Angelscript. For a reference overview of the scripting language, check out "The script language" on the Angelscript website.

Script types

Game modes

Gamemodes define rules about what should happen on the global level. A gamemode is for example campaign, survival, deathmatch, team deathmatch, etc. See also Creating a GameMode.

World scripts

Worldscripts are the in-editor visual scripting elements. Scripts have properties that can be set in the editor, they can target each other or other units, and they are only visible within the editor. In the game, only their functionality remains. Examples of worldscripts include SpawnUnit, AreaTrigger, LevelStart, LevelExit, Variable, ChangeVariables, etc. See also Creating a WorldScript.

Behaviors

Behaviors are the brains of units. Each unit can have a behavior, which allows them to have logic such as movement or interaction. For example, this could be a Pickup, Breakable, CompositeActorBehavior, Player, etc. See also Creating a Behavior.

Workflow

By far the best way to work is by having the editor open together with an IDE. After creating a scenario, make a test level in your scenario and add your gamemode/worldscript/units to it. Then, after writing some code in your IDE, simply Alt+Tab to the editor and hit Ctrl+T to open the game.

ScriptingWorkflow.png

IDE

Unfortunately there are currently no full IDEs available for autocompletion with AngelScript. Here's what's currently available in terms of syntax highlighting and basic autocompletion:

API reference

You can find the API reference for the engine here, and the API reference for the base resources here.