add ACS entry documentation

pull/1/head
an 2019-01-11 09:08:51 -05:00
parent 4a236c23b1
commit ca1a601b77
2 changed files with 18 additions and 0 deletions

View File

@ -530,6 +530,8 @@ The `string` type is a mutable, garbage-collected string reference type. Strings
The `name` type is an indexed string. While their contents are the same as a string, their actual value is merely an integer which can be compared far quicker than a string. Names are used for many internal purposes such as damage type names. Strings are implicitly cast to names.
Names can be converted to `int` with an explicit cast, and the negative of `int(name())` may be used to create an integer representation of a string usable by action specials, most prominently `ACS_NamedExecute`.
## Color
| Name | Usable as argument |

View File

@ -4,6 +4,7 @@ Table of Contents
<!-- vim-markdown-toc GFM -->
* [Entry Points](#entry-points)
* [ACS](#acs)
* [Actors](#actors)
* [CVARINFO](#cvarinfo)
* [DECALDEF](#decaldef)
@ -22,6 +23,21 @@ Entry Points
For backwards compatibility reasons and so as to not bloat the ZScript language itself, many interactions with the engine are not defined in ZScript. This section describes all ZScript interactions with the engine, both inside and outside of ZScript itself.
ACS
===
ACS has several functions for interfacing with ZScript: `SetUserVariable` (callfunc `24`,) `GetUserVariable` (callfunc `25`,) `SetUserArray` (callfunc `28`,) `GetUserArray` (callfunc `29`) and `ScriptCall` (callfunc `210`.)
`GetUserVariable` may be used to get any `float` or `double` (converted to fixed-point,) `name` or `string` (converted to ACS string,) `bool` (converted to integer,) or integer (of any type including `enum`, converted to a 32-bit signed integer) member of an `Actor`, by TID or by the script activator. The member may be `native`, though it may not be `meta`. If the type is an `array` or fixed-size array, the first element is used.
`SetUserVariable` follows the same rules as `GetUserVariable`, although `native` variables may not be set. `name` is not handled.
`SetUserArray` and `GetUserArray` follow the same rules as `SetUserVariable` and `GetUserVariable`, but the index of an array may be used. The variable does not have to be an array if the index is `0`.
`ScriptCall` may be used to call any `static` function on any class. It cannot call functions on `struct`s. If the first argument of the function is type `Actor`, the activator is passed to this argument (or `null` if there is no activator.) Each argument may be of type `int` (or its aliases,) `color` or `bool` (converted from integer,) `double` (converted from fixed-point,) `name`, `string` or `sound` (converted from ACS string.)
The function may have default arguments. The function may return zero or more values, although more than one value will be ignored. The returned value may be `int` (or one of its aliases,) `bool` or `color` (converted to integer,) `double` (converted to fixed-point,) `name`, `sound` or `string` (converted to ACS string.) If it is not one of these types, it will be ignored.
Actors
======