Scripting Introduction: Difference between revisions

From Soldat2 Wiki
Jump to navigation Jump to search
(Created page with "Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under <code>Soldat2/Scripts/</code> and there needs to be a ruleset that specifies that script in the <i>GameScript</i> object in its json - for example, see <code>Soldat2/Rules/Standard/Climb.json</code>. The script can be tested by starting a game that uses that ruleset.")
 
No edit summary
Line 1: Line 1:
Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under <code>Soldat2/Scripts/</code> and there needs to be a ruleset that specifies that script in the <i>GameScript</i> object in its json - for example, see <code>Soldat2/Rules/Standard/Climb.json</code>. The script can be tested by starting a game that uses that ruleset.
Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under <code>Soldat2/Scripts/</code> and there needs to be a ruleset that specifies that script in the <i>GameScript</i> object in its json - for example, see <code>Soldat2/Rules/Standard/Climb.json</code>. The script can be tested by starting a game that uses that ruleset.
= Scripting Resources =
The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the [https://docs.unity3d.com/2020.1/Documentation/Manual/index.html Unity Manual].
There is some [https://soldat2.com/docs/ preliminary documentation] for the Soldat 2 engine, however it is currently rather limited.
Some examples of scripts can be found in your Soldat 2 game directory under the path <code>Soldat2/Scripts/Standard/</code>.

Revision as of 12:20, 16 January 2023

Scripting in Soldat 2 is done in a Unity/C# environment. For a script to be usable in-game, the script file must be placed under Soldat2/Scripts/ and there needs to be a ruleset that specifies that script in the GameScript object in its json - for example, see Soldat2/Rules/Standard/Climb.json. The script can be tested by starting a game that uses that ruleset.

Scripting Resources

The Soldat 2 engine uses Unity, so it may be useful to familiarise yourself with the Unity Manual.

There is some preliminary documentation for the Soldat 2 engine, however it is currently rather limited.

Some examples of scripts can be found in your Soldat 2 game directory under the path Soldat2/Scripts/Standard/.