Field manual / Level editor
object — Objects
Any object by name: whether it exists, enable, disable, delete, its classic_id and class, calling its function. Where Classic writes "this", OG Script writes host.
Summary
object::Exists | True if an object with this name exists. |
object::IsHere | True if x is a reference to an object of this location (including a deleted one); false for a reference to an object of another location (§4.2) and for a non-reference. |
object::GetNameID | Returns the object's classic_id (heroes: 20 Sullivan, 21 Ovitz, 22 Trantigne, 24 Lucy); "this" is the caller. |
object::GetClass | The object's class as the rules name it (in an OpenGorky project, the archetype path: "weapons::riffle", "characters::hornet"), for hooks; "" if the object does not exist. |
object::Enable | Enables the given object (it is active and visible again). |
object::Disable | Disables the given object; it stays on the level and can be enabled again. |
object::Delete | Disables the given object and marks it deleted. |
object::Impulse | Starts a one-shot playback of an active bitmap animation object (a lever, a puff of smoke). |
object::Call | Calls a function of an object (extra arguments are passed on), including objects of other loaded levels. |
Functions
object::Exists(string) → bool
True if an object with this name exists.
object::IsHere(any x) → bool
True if x is a reference to an object of this location (including a deleted one); false for a reference to an object of another location (§4.2) and for a non-reference.
object::GetNameID(string) → int
Returns the object's classic_id (heroes: 20 Sullivan, 21 Ovitz, 22 Trantigne, 24 Lucy); "this" is the caller. Returns -1 if the object does not exist.
object::GetClass(string) → string
The object's class as the rules name it (in an OpenGorky project, the archetype path: "weapons::riffle", "characters::hornet"), for hooks; "" if the object does not exist.
object::Enable(string) → int
Enables the given object (it is active and visible again).
object::Disable(string) → int
Disables the given object; it stays on the level and can be enabled again. Classic Disable() in an actor script is object::Disable(host) (§16.14).
object::Delete(string) → int
Disables the given object and marks it deleted.
object::Impulse(string) → int
Starts a one-shot playback of an active bitmap animation object (a lever, a puff of smoke). Does nothing for other objects.
object::Call(string, string) → any
Calls a function of an object (extra arguments are passed on), including objects of other loaded levels. Returns the function's result or 0.