Main      Site Guide    
Smash Tutorial

Sample Adventure: The Trainer

The "objectactions.sma" File


This file contains the code that should be executed when the player selects an item from his inventory. Usually, selecting an item from the inventory should just provide a description of the object. If you are making use of timers in the game (The Trainer does not), you might consider rewinding all timers by 1 in each of these functions, so that examining an object does not take up any game time.

There must be one function per object listed in the objects.txt file, where the function tag is the same as the tag of the corresponding object.

~ coin p It's an ordinary coin, gold in color. ~ sword p It's a long broadsword. It's heavy to wield but packs quite a wallop. ~ axe p It's a very heavy double edged battle axe. You wouldn't want to be on the receiving end of this thing. ~ key p It's a small key on a huge keyring. ~ rope p The rope is about forty feet long and very sturdy. ~ rock p You inspect the rock. It's about the size of your palm, mostly gray, with pretty streaks of quartz running through it.