-
Notifications
You must be signed in to change notification settings - Fork 9
Tumbleweed_extensions
Extensions are used to define the default action for the right-click. You can add extensions to characters, hotspots, objects and inventory items. To add an extension, e.g. chose an object in the room editor and take a look at the description (not the name). In the sample room, we have an object, called Cup. In addition to the name we have an angle bracket and the letter p:
Cup>p
The bracket acts as a separator for the extension, the letter tells the script, which default action to use. By default, the template knows about the following extensions:
-
n
: nothing / default -
g
: give to -
p
: pick up -
u
: use -
o
: open -
l
: look at -
s
: push -
c
: close -
t
: talk to -
y
: pull -
v
: variable extension -
e
: exit
If you like to customize or add these extensions, take a look at the function CheckDefaultAction.
You don't have to add an extension for every object and hotspot. The template also adds some default actions on it's own. The default action for Characters is "talk to", for Hotspots and Objects, it's look at. Inventory items are handled a little differently, the right-click always causes "look at", no matter what. If you left-click an item, it's usually "use with". But if you have added the extension "u", the action will be simply "use". Clicking the verb button "use" and the item afterwards would cause the same action. But it could seem a little bit unpredictable, whether an item can used by a verb button or not. With this shortcut you can make things a little bit easier. You can see this behavior in the sample room, when opening the letter. Otherwise you would have needed something else to interact with it. But with the use-extension, it is getting opened by a single left-click. The exit extension is covered in the following chapter.
See also:
Verbs.CheckDefaultAction
void Verbs.RemoveExtension();
Used to remove the extension from a location (Hotspots, Objects etc.), so it doesn't get displayed in the status bar.
void Verbs.AddExtension(char extension);
Used to add a default extension in case the location doesn't have one.
char Verbs.Extension();
Returns the first extension of a location.
char Verbs.ExtensionEx(int index, String name);
Returns the n-th extension of the given string. This is currently used for exit extensions.
void Verbs.OpenCloseExtension(int door_id);
Used in combination with the door scripts. This function returns a close extension, if the door with the given id is open and vice versa.
void Verbs.VariableExtensions();
This function is called, if you have have set "v" as an extension for a certain location. Currently it is used for the OpenClose extension, but of course you can add your own variable extensions here, for example "turn on / turn off".
Getting Started in AGS
Editor
- New Game templates
- Editor Preferences
- General Settings
- Default Setup
- Colours Editor
- Room Editor
- Character Editor
- Cursor Editor
- Dialog Editor
- Font Preview
- GUI Editor
- Inventory Items Editor
- View Editor
- Sprite Manager
- Music and sound
- Voice speech
- Script Modules
- System limits
- Log Panel
- Plugins
- Other Features
Engine
Scripting
- Scripting Tutorial
- Scripting Language
-
Scripting API
- Script API Overview
- Standard Constants
- Standard Enumerated Types
- Standard Types
- Game variables
- Global arrays
- Global event handlers
- repeatedly_execute / repeatedly_execute_always
- Custom dialog options rendering
- Global functions: general
- Global functions: message display
- Global functions: multimedia actions
- Global functions: palette operations
- Global functions: room actions
- Global functions: screen effects
- Global functions: wait
- AudioChannel functions and properties
- AudioClip functions and properties
- Camera functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- Dictionary functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game functions and properties
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Object functions and properties
- Overlay functions and properties
- Parser functions
- Region functions and properties
- Room functions and properties
- Screen functions and properties
- Set functions and properties
- Speech functions and properties
- String functions
- System functions and properties
- TextWindowGUI functions and properties
- ViewFrame functions and properties
- Viewport functions and properties
- Obsolete Script API
- Event Types
- Key code table
- Audio in script
Legal Notice
Getting in touch
Misc