Skip to content

Tumbleweed_unhandled

Morgan Willcock edited this page Oct 8, 2023 · 5 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

Editor

Engine

Scripting

Legal Notice

Getting in touch

Misc

Clone this wiki locally