# AGI Command Reference

Thanks to the Sarien team and to Nick Sonneveld for some info on the unknown commands.

**Table of Contents**

- Arithmetic Commands
- Commands to Load and Unload Resources
- Program Control Commands
- Object Control Commands
- Object description Commands
- Object Motion Control Commands
- Inventory Item Management Commands
- Picture Resource Management Commands
- Sound Resource Management Commands
- Text Management Commands
- String Management Commands
- Initialization Commands
- Menu Management Commands
- Test Commands
- Other Commands
- Unknown Commands

__I Arithmetic Commands__

Commands that operate on variables:

__increment(n);__

The value of the variable Var(n) is incremented by one, i.e.

Var(n) = Var(n)+1. If the value is already 255, it is left unchanged.
__decrement(n);__

The value of the variable Var(n) is decremented by one, i.e.

Var(n) = Var(n)-1. If the value is 0, it is left unchanged.
__assign(n, m);__

Variable Var(n) is assigned the value m, i.e. Var(n) = m
__assignv(n, m);__

Variable Var(n) is assigned the value of Var(m), i.e.

Var(n) = Var(m).
__addn(n, m);__

The value of variable Var(n) is incremented by m, i.e.

Var(n) = Var(n) + m.
__addv(n, m);__

The value of variable Var(n) is incremented by the value of Var(m), i.e. Var(n) = Var(n) + m.

[Now what happens in the above two commands on 8-bit overflow: does the result wrap over 0 or stays 255?

I.e. is 250 + 10 == 4 or 250 + 10 == 255?]
__subn(n, m);__

The value of Var(n) is decremented by m, I.e. Var(n) = Var(n) - m
__subv(n, m);__

The value of Var(n) is decremented by Var(m), i.e. Var(n) = Var(n) - Var(m).

[Again, what happens when the result must be negative: is

1 - 2 == 255 or 1 - 2 == 0?]
__lindirectn(n, m);__

Variable Var(i) where i is the value of Var(n) is assigned a value m, i.e. Var(Var(n)) = m.
__lindirectv(n, m);__

Variable Var(i) where i is the value of Var(n) is assigned the value of Var(m), i.e. Var(Var(n)) = Var(m).
__rindirect(n, m);__

Variable Var(n) is assigned the value of Var(i) where i is the value of Var(m), i.e. Var(n) = Var(Var(m)).
__muln(n, m);__

Variable Var(n) is multiplied by m, i.e. Var(n) = Var(n) * m.
__mulv(n, m);__

Variable Var(n) is multiplied by the value of Var(m), i.e.

Var(n) = Var(n) * Var(m).

[What happens on overflow?]
__divn(n, m)__

Variable Var(n) is divided by m, i.e. Var(n) = Var(n) / m.
__divv(n, m)__

Variable Var(n) is divided by the value of Var(m),

i.e. Var(n) = Var(n) / Var(m). [What happens on division by 0?]
__random(n, m, k)__

Variable Var(k) is assigned a random value in the range between n and m. Now let us consider the commands changing flag values. Remember that a flag can
only have a value 0 or 1.
__set(n)__

flag(n) is set to 1.
__set.v(n)__

flag(i), where i is the value of var (n), is set to 1. i.e.

flag(var(n)) = 1.
__reset(n)__

flag(n) is set to 0.
__reset.v(n)__

flag(i), where i is the value of var (n), is set to 0, i.e.

flag(var(n)) = 0.
__toggle(n)__

flag(n) toggles its value.
__toggle.v(n)__

flag(i), where i is the value of var (n), i.e. flag(var(n)), toggles is value.
Page: **[ 1 ]** 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16

*You can help keep The Sierra Help Pages and its affiliates alive by helping to defray some of the costs
of hosting this site. If it has been of help to you, please consider contributing to help keep it online.*
*Thank you.*

Top
The Sierra Help Pages | Sierra
Game Help | Walkthroughs | Hints,
Tips & Spoilers | Utilities | Links | SHP
Forums | Search

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.