Skip to content

Tumbleweed_unhandled

Morgan Willcock edited this page Oct 7, 2019 · 3 revisions

Tumbleweed Unhandled Events

In order to give a the player a feedback for actions the author hasn't thought of, unhandled events come into play. With a single function, you can achieve something like "That doesn't work" or "I can't pull that", which makes a game much more authentic and alive. The messages itself are defined outside of this function, initially in TemplateSettings.asc


Verbs.Unhandled

void Verbs.Unhandled(int door_script);

Use this function at the end of your any_click functions in order to cause default reactions. For example:

function cChar_AnyClick()
{
        if (Verbs.UsedAction(eGA_LookAt)) player.Say("He looks like he is hungry.");
        else Verbs.Unhandled();
}

In this example, you get a default reaction for everything but look at. The optional parameter is only used internally to make the function work with the door scripts.

Getting Started in AGS

Introduction

Frequently Asked Questions

Tutorial

Editor Reference

Room Editor

Character Editor

GUI Editor

Sprite Manager

View Editor

Inventory Items Editor

Other Features

Engine

The run-time engine

Graphics driver selection

Engine Setup Program

Scripting

Scripting Language

Scripting API

Reference

Working on Legacy games

Upgrading from a previous version

Legal Notice

Copyright and terms of use

Anonymous usage information

Credits

Getting in touch

Contacting the developers

Clone this wiki locally