The script language of Stranded II allows you to modify the game and create your own interactive maps.
It is based on an event system, which means that scripts are only interpreted by the game if certain events occur.
There are different types of scripts and events.
Types of scriptsGlobal scripts - scripts, that are only executed on certain events. These scripts are not bound to objects. Global scripts that you want to work on any map are to be written into the file "sys\game.inf" in the particular mod's folder. Global scripts that you want to affect only one specific map can be written into the map settings in the editor.
Object-bound scripts - these scripts refer directly to an object, a unit or an info. Consequently, they are then firmly bound to it. Events in the script are only triggered, if they happen to this object (which of course includes global events).
Definition scripts - they can be found in the definition files (in the subfolder "sys" of the mod's directory). They basically behave like object-bound scripts, but except one difference: they do not concern a single object, but all object of the particular type! If you want, for instance, that all health potions heal the player on usage, you should write that into the definition file, since it specifies all objects of the type "health potion", not only one of them.
Types of eventsAs mentioned in the explanation of the different types of scripts, there are global and object-bound events. Global events can be written into any type of script and will lurk there to be triggered whenever the event occurs. In contrast, object-bound events of course make only sense in object-bound or definition scripts, because these only describe interactions with objects.
An example: An exemplary global event is "on:start" - it is exuted when the map has just been loaded and started. This does not have to do with any specific object on the map and is therefore to be categorised as "global". But if you use an object in the game, fulfilling the event "on:use", you have triggered an object-bound event. There is no point in writing a script with such an event into the game.inf or into the global script of a map, because these do not relate to objects in the game that one could use.
Summary• To have global effect, scripts can be written into the "game.inf" or the global script of a map. You can also link them to make them affect certain objects in the editor or write them into the definitions (inf files in the "sys" folder) of specific types of objects.
• Scripts are only executed on the events you specify. Global events are executed everywhere, whereas object-bound events are only executed if the scripts of the particular objects are triggered.
So far about the basic system of the script language of Stranded II. In the next lesson, we will write a "Hello World" program. Jubilate!
• II. Hello World
Stranded I, Stranded II & Stranded III are games by Unreal Software 2003-2023 | Contact | Disclaimer