-
Notifications
You must be signed in to change notification settings - Fork 0
Tumbleweed_extensions
- Verbs.RemoveExtension
- Verbs.AddExtension
- Verbs.Extension
- Verbs.ExtensionEx
- Verbs.OpenCloseExtension
- Verbs.VariableExtensions
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 Reference
- Music and sound
- Distributing your game
- Backing up your game
- The text parser
- Translations
- Global variables
- Custom Properties
- Plugins
- Lip sync
- New Game templates
- Debugging features
- Auto-number speech files
- Integration with Windows
- Source Control integration
Engine
Scripting
- Scripting tutorial part 1
- Scripting tutorial part 2
- Pointers in AGS
- Calling global functions from local scripts
- The script header
- String formatting
- Multiple Scripts
- Understanding blocking scripts
- Dynamic Arrays
- Extender functions
- Game variables
- Predefined global script functions
- repeatedly_execute (_always)
- Custom dialog options rendering
- Built-in enumerated types
- Script language keywords
- AudioChannel functions and properties
- AudioClip functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game / Global functions
- 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
- Multimedia functions
- Object functions and properties
- Overlay functions and properties
- Palette functions
- Parser functions
- Region functions and properties
- Room functions
- Screen functions
- Speech functions and properties
- String functions
- System functions and properties
- Text display / Speech functions
- ViewFrame functions and properties
Working on Legacy games
Upgrading from a previous version
- Upgrading to AGS 2.7
- Upgrading to AGS 2.71
- Upgrading to AGS 3.0
- Upgrading to AGS 3.1
- Upgrading to AGS 3.2
- Upgrading to AGS 3.3
- Upgrading to AGS 3.3.5
- Upgrading to AGS 3.4
- Upgrading to AGS 3.4.1
Legal Notice
Getting in touch