Stranded


Scripting - V. Scripts & Infos
Stranded II has so-called "infos" to give you more influence. Their purposes are specifying certain spots or conditions, that trigger scripts, if fulfilled.

Trigger-Infos

Infos that check conditions and trigger scripts are called "trigger-infos".
If you place them in the editor and click them, you can change various settings and assign them scripts. Apart from global events, they only understand the event "on:trigger". It is the case if the set condition is fulfilled.

• Start Stranded II and create a new empty map in the editor • Select "infos" on the left top • Choose the local trigger (a T with a circle containing a dot) • Click the ground to set a local trigger • Select it and set it as this image shows it:
local trigger settings

• Accept per Ok-Button afterwards. You should now see the local trigger with a green circle that shows the size of the area that is checked:

local trigger

If we now have a look at the settings from above, we can state that the local trigger is set in a way, that will trigger it, if the number of players in its area is greater than 0 - or briefly: If the player is in the area. Plus, we have activated the trigger, so that it can instantly work and check the conditions.
It is recommendable to always keep as few triggers running as possible, since they periodically check their conditions.That can slow the game down. Per script commands they can, however, turned on and off whenever you want.

• Add the following script to the local trigger:
on:trigger {
	msg "The player is near!";
}

• Test the map

If you have done all correctly, the message will turn up again and again as long as you are near enough to the local trigger.
The other trigger-infos allow you to check other kinds of conditions. They yet work the same way.

Infos as positions

Another application for infos in the context of script is to set them at positions around which you want certain things to go on. With script commands, you can easily find out their positions and use them however you want:

• The command "getx" in the command reference
• The command "gety" in the command reference
• The command "getz" in the command reference

For sequence commands (to specify camera movements), you must even use infos directly.

Infos as containers

Since infos are invisible in the game, you can also use them to store stuff inside.
Apart from items and states, you can also save text or scripts in them. The info of the type "text container" is ideal for that. Text-container-infos have the special property that Stranded II ignores their entire script attachment like it would not exist and hence does not execute it.
Many script commands allow you to directly use the ID of an info as the source for a text or a script. That way, it is not necessary to store scripts and texts in external files.

Summary

Infos are versatile. They can check conditions and execute scripts, specify positions or serve as containers for scripts, texts, items and states.
Stranded I, Stranded II & Stranded III are games by Unreal Software 2003-2023 | Contact | Disclaimer