Skip to content
aubergine10 edited this page Oct 29, 2015 · 3 revisions

##Overview

The global this variable is a reference to the map object that is associated with an instance of a script (which was created when the object was placed/constructed on the map).

For example, you define a new object called FirstAidKit in materials.txt and set Properties Scripted to make it scriptable. Whenever a FirstAidKit is spawned on the map, a new instance of data/scripts/FirstAidKit.lua script will be created. Within that script instance, this refers to the specific FirstAidKit on the map that caused the script instance to be created.

It is used to get and set [Object Properties](Object Properties) and execute [Object Methods](Object Methods) on the referenced object (see sidebar).

^ Open "Pages" to Search



Guides:

  • [Lua Basics](Lua Basics Guide)
  • [Save-Load Cycle](Save-Load Cycle Guide)

[Globals](Object Globals):

  • [Game](Game (Global))
  • [me](me (Global))
  • [Object](Object (Global))
  • [this](this (Global))

[Events](Object Events):

Psuedo-Types:

  • [Rotation table](Rotation table)
  • [Id table](Id table)
  • [Location table](Location table)
  • [Velocity table](Velocity table)

[Methods](Object Methods):

[Properties](Object Properties):

Clone this wiki locally