The Script object (and the Encounter variable) [varies]
Script objects are a bit of a special case. They're used to refer to other scripts that were loaded by
the engine itself.
In the encounter script, the enemies table is filled with Script objects after
the encounter starts, and the Wave table is filled with Script objects when entering the
state DEFENDING.
The variable Encounter is also a script object that refers to the current encounter, and is accessible from anywhere except from the Encounter itself. Do not enter the name of your encounter file, it will always just be Encounter. Case-sensitive.
Encounter.Call("TakeTwoArguments", {"argument 1!", "argument 2!"})
-- This is the ENCOUNTER file, and I want to deactivate my first enemy from here -- To do that, I'll call the function "SetActive" (see Misc. Functions) in the MONSTER file from here enemies[1].Call("SetActive", false)
-- here is a simple way to change the encounter's "wavetimer" from another script, for instance, -- a monster script if a player ACTs right, or just from a Wave that needs to last a certain time Encounter.SetVar("wavetimer", 10) -- alternatively: Encounter["wavetimer"] = 10
-- let's say we're in the MONSTER file, and we want to turn a Sprite in the ENCOUNTER file to dust -- we can do it in at least two different ways: local spriteToDust = Encounter.GetVar("torso") spriteToDust.Dust(true, true) -- see Sprites & Animation. -- alternatively: Encounter["torso"].Dust(true, true)