Skip to content
7Soul edited this page Jun 30, 2022 · 50 revisions

Index

Component

Base-class for all Components. A Component always belongs to one and only one GameObject. Components can be enabled and disabled. A disabled component usually acts as it would not exist in the game.

  • Component:addConnector(event, target, action)
  • Component:disable()
  • Component:enable()
  • Component:getClass() Beta 2.2.1
  • Component:getConnector(i)
  • Component:getConnectorCount()
  • Component:getName() Beta 2.2.1
  • Component:getOffset()
  • Component:isEnabled()
  • Component:removeConnector(event, target, action)
  • Component:setOffset(offset)
  • Component:setRotationAngles(x, y, z)
  • Component.onInit(self)

AmmoItemComponent (Component)

Makes an item ammo for missile or firearm attack. The ammo types must match in the Ammo component and the attack component.

  • AmmoItemComponent:getAmmoType()
    Get ammunition type which must match with weapon's ammo type.
  • AmmoItemComponent:getAttackPower()
    Get damage bonus to weapon's base damage.
  • AmmoItemComponent:setAmmoType(string)
    Set ammunition type which must match with weapon's ammo type.
  • AmmoItemComponent:setAttackPower(number)
    Set damage bonus to weapon's base damage.

AnimationComponent (Component)

Adds animations to the 3D model attached to the same GameObject. The GameObject must have a Model component.

  • AnimationComponent:crossfade(name, length)
  • AnimationComponent:getCurrentLevelOnly()
    Get whether animation component is updated only when party is on the same level.
  • AnimationComponent:getLoop()
    Get looping for initial animation.
  • AnimationComponent:getMaxUpdateDistance()
    Get max update distance in squares.
  • AnimationComponent:getPlayOnInit()
    Get name of the initial animation to be played when the object is spawned.
  • AnimationComponent:play(name, boolean)
    Specify the filename of the animation to play and an optional Boolean to specify whether the animation should loop.
  • AnimationComponent:sample()
  • AnimationComponent:setCurrentLevelOnly(boolean)
    Set whether animation component is updated only when party is on the same level.
  • AnimationComponent:setLoop(boolean)
    Set looping for initial animation.
  • AnimationComponent:setMaxUpdateDistance(number)
    Set max update distance in squares.
  • AnimationComponent:setPlayOnInit(string)
    Set name of the initial animation to be played when the object is spawned.
  • AnimationComponent:stop()
  • AnimationComponent.onAnimationEvent(self, event)

BeaconFurnaceControllerComponent (Component)

Implements the behavior of altars in Elemental Shrines. The name of the class is weird because of historical reasons.

  • BeaconFurnaceControllerComponent:getElement()
  • BeaconFurnaceControllerComponent:setElement(string)

BlastComponent (Component)

Spawns objects in 2 square radius area. Used to implement Magma Golem's flame wave attack.

  • BlastComponent:getDelay()
  • BlastComponent:getEffect()
  • BlastComponent:setDelay(number)
  • BlastComponent:setEffect(string)

BlindedMonsterComponent (Component)

BombItemComponent (Component)

Makes a thrown item explode when it hits something.

  • BombItemComponent:getBombPower()
  • BombItemComponent:getBombType()
  • BombItemComponent:setBombPower(number)
  • BombItemComponent:setBombType(string)
  • BombItemComponent.onExplode(self,level,x,y,facing,elevation) Beta 2.2.3

BossFightComponent (Component)

Implements boss fights. When activated, bossfight music starts and a progress bar is displayed at the top of the screen. The boss fight ends automatically when all monsters taking part in it are destroyed or it can be manually deactivated.

  • BossFightComponent:activate()
  • BossFightComponent:addMonster(monster)
  • BossFightComponent:deactivate()
  • BossFightComponent:getAchievement()
  • BossFightComponent:getAutoDeactivate()
  • BossFightComponent:getBossName()
  • BossFightComponent:getMusic()
  • BossFightComponent:recomputeTotal()
    Recompute the maximum for the life bar at the top of the screen. If you add new monsters to the boss fight while it is already activated, you need to call this, otherwise the life bar will not take the new monsters into account.
  • BossFightComponent:removeMonster(monster)
  • BossFightComponent:setAchievement(string)
  • BossFightComponent:setAutoDeactivate(boolean)
  • BossFightComponent:setBossName(string)
  • BossFightComponent:setMusic(string)

BrainComponent (Component)

Base-class for all monster brains. You can either use one of the built in brains (e.g. TurleBrain) or implement a custom onThink hook. When the monster is ready to perform a new action, the brain's onThink hook is called. The brain should respond by calling monster component's performAction() method with a valid action name. The brain class itself contains many higher level behaviors such as fleeing and pursuit which can be used in place of performAction() to delegate decision making. If the brain can not decide what to do, Brain:wait() should be called. This will put the monster's brain to sleep for a short time (typically 0.1s) to prevent extensive CPU usage.

When implementing onThinkon a built-in brain, it's possible to override the built-in behaviour in some specific cases while keeping the default implementation for the rest:

  • The onThink hook should return true when an action is performed (wait() and performXXX() methods already return true, so it's possible to write, for example return self:wait())
  • If the onThink hook does not return true, the built-in logic kicks in and control for the next action is passed to the built-in brain.

Properties

  • BrainComponent.blockedLeft
  • BrainComponent.blockedRight
  • BrainComponent.blockedBack
  • BrainComponent.blockedFront
    The blockedLeft, blockedRight, blockedBack, and blockedFront properties are true if the monster can move in that direction without hitting a wall, falling into a pit (if not flying), etc.
  • BrainComponent.seesParty
  • BrainComponent.partyDiagonal
    The partyDiagonal property is true if the party is diagonally adjacent to the monster, false otherwise. Ignores elevation.
  • BrainComponent.partyAdjacent
    The partyAdjacent property is true if the party is cardinally adjacent to the monster, false otherwise. Ignores elevation.
  • BrainComponent.partyLeft
  • BrainComponent.partyRight
    The partyLeft or partyRight property is true if the party is anywhere to the left or right of the monster, respectively (they don't need to be adjacent or even on the same level).
  • BrainComponent.partyStraightAhead
  • BrainComponent.partyStraightBehind
    The partyStraightAhead or partyStraightBehind property is true if the party is in front of or behind the monster, respectively, and not to the left or right of the monster. The party needn't be adjacent, at the same elevation, or even on the same level.
  • BrainComponent.partyAhead
  • BrainComponent.partyBehind
    Like partyStraightAhead and partyStraightBehind, except the property will still be true if the party is to the left or right of the monster.
  • BrainComponent.partyOnLevel
  • BrainComponent.partyLastSeen
    This is the game time in seconds (and sub-seconds) when the party was last seen. It will always increase or stay the same if not seen.
  • BrainComponent.partyDistY
  • BrainComponent.partyDistX
    The partyDistX and partyDistY is the distance in squares to the party. Note, they will be negative if the party is east or south.
  • BrainComponent.partyY
  • BrainComponent.partyX

Methods

  • BrainComponent:alert()
  • BrainComponent:carrying(string)
    Returns true or false if the monster is holding game object matching the ID of the string passed in.
  • BrainComponent:changeAltitude()
  • BrainComponent:charge()
  • BrainComponent:circleStrafeHesitate()
  • BrainComponent:circleStrafeStall()
  • BrainComponent:dropItem(string)
  • BrainComponent:dropItemOn(string, string)
  • BrainComponent:flee()
    Makes the monster try to run away from the party. flee() will not strafe or move backward, only turn and move forward.
  • BrainComponent:follow()
  • BrainComponent:getAllAroundSight()
    Get whether the monster can see in any direction.
  • BrainComponent:getMorale()
    Get morale rating in range 0-100 (0 = coward, 100 = fearless)
  • BrainComponent:getSeeInvisible()
    Get whether the monster can sense invisible things (such as invisible party members).
  • BrainComponent:getSight()
    Get maximum sight range in squares.
  • BrainComponent:goTo(string)
    A game object ID that the monster will try to reach. It must be an object on the current level or this command is ignored.
  • BrainComponent:here(string)
    Returns true if the monster has reached the square containing the specified game object ID as string, false otherwise.
  • BrainComponent:isSafeTile(x, y) Returns true if both x and y are between 0 and 31 inclusive, false otherwise - even if the monster is not on a 32x32 level.
  • BrainComponent:meleeAttack()
  • BrainComponent:moveBackward()
  • BrainComponent:moveForward()
  • BrainComponent:moveTowardsParty()
  • BrainComponent:openLockWith(string, string)
  • BrainComponent:operate(string)
    Attempt to operate the device with the id string. The device should be a GameObject with a LeverComponent or LockComponent.
  • BrainComponent:performAction(...)
    The first argument should be the name of the MonsterActionComponent you want to perform such as "basicAttack". The meaning of additional arguments depends on the class of the MonsterActionComponent. It is imperative that you pass the correct types of argument for the MonsterActionComponent; if you pass one of the wrong type (for example, passing a GameObject when you should have passed a string) it can cause serialization bugs which are very annoying to track down! MonsterAttackComponent: The second argument (number) is the direction in which to attack, defaulting to 0 (forward). Example: self:performAction("turnAttack",1) to turn attack to the right.
    MonsterChangeAltitudeComponent: The second argument (number) should be 1 to move up or -1 to move down.
    MonsterChargeComponent: None.
    MonsterDropItemComponent: The second argument (string) is the id of the item to drop. The third argument (string) is optional; if present, it must be the id of an object with a SurfaceComponent named "surface". The monster will place the item in that SurfaceComponent instead of dropping it on the ground. MonsterJumpComponent: TODO
    MonsterKnockbackComponent: The second argument (number) is the direction to be knocked back in.
    MonsterMoveAttackComponent: None.
    MonsterMoveComponent: The second argument (number) is the direction in which to move. Usually it is better to use a BrainComponent:move... method instead.
    MonsterOperateDeviceComponent: The second argument (string) is the id of the device to operate (see BrainComponent:operate()). The third argument (string) is optional; if present, it is the id of an item in the monster's inventory that will be destroyed upon operating the device. This is intended to be used to destroy a key in a monster's inventory when it operates a lock. It's easier to use BrainComponent:openLockWith() for the same effect. MonsterPickUpItemComponent: The second argument (string) is the id of the item to pick up.
    MonsterStealWeaponComponent: None.
    MonsterTurnComponent: The second argument (number) is the direction to turn (1 for right, -1 for left).
    MonsterWarpComponent: TODO
  • BrainComponent:pickUpItem(string, boolean)
  • BrainComponent:pursuit()
  • BrainComponent:rangedAttack()
    Similar to calling BrainComponent:performAction("rangedAttack"), except that BrainComponent:rangedAttack() returns false (and performs no action) if the monster isn't facing the party or doesn't have line of fire to the party.
  • BrainComponent:seek(x, y)
    Specifies the current map square that the monster will try to move to. If he determines he cannot reach this square, this command is ignored.
  • BrainComponent:setAllAroundSight(boolean)
    Set whether the monster can see in any direction.
  • BrainComponent:setMorale(number)
    Set morale rating in range 0-100 (0 = coward, 100 = fearless)
  • BrainComponent:setSeeInvisible(boolean)
    Set whether the monster can sense invisible things (such as invisible party members).
  • BrainComponent:setSight(number)
    Set maximum sight range in squares.
  • BrainComponent:startFleeing()
  • BrainComponent:startGuarding()
  • BrainComponent:stepTowards(string, number)
  • BrainComponent:stopFleeing()
  • BrainComponent:stopGuarding()
  • BrainComponent:strafeLeft()
  • BrainComponent:strafeRight()
  • BrainComponent:turnAround()
  • BrainComponent:turnAroundAttack()
  • BrainComponent:turnAttack()
  • BrainComponent:turnAttackLeft()
  • BrainComponent:turnAttackRight()
  • BrainComponent:turnLeft()
  • BrainComponent:turnRight()
  • BrainComponent:turnTowardsDirection()
  • BrainComponent:turnTowardsParty()
  • BrainComponent:turnTowardsTarget()
  • BrainComponent:wait()
  • BrainComponent:wander()
  • BrainComponent:wanderIfPartyNotDetected()
  • BrainComponent.onThink(self)
  • BrainComponent.onBloodied(self)

BurningMonsterComponent (Component)

Implements the burning condition for monsters. A monster with the burning condition is dealt ongoing fire damage until the effect's duration ends or the monster dies.

  • BurningMonsterComponent:getCausedByChampion()
  • BurningMonsterComponent:setCausedByChampion(number)

ButtonComponent (Component)

Implements wall button mechanics for an object. Requires Clickable and Animation component. When the object is clicked, the button component plays a sound, tells the animation component to play "press" animation clip and triggers its onActivate hook and connectors.

  • ButtonComponent:getDisableSelf()
  • ButtonComponent:getSound()
  • ButtonComponent:setDisableSelf(boolean)
    Makes the ButtonComponent disable itself when pressed. This doesn't stop the ButtonComponent from activating its connectors.
  • ButtonComponent:setSound(string)
  • ButtonComponent.onActivate(self)
    If you want disableSelf to work like in Grimrock 1 (i.e. the button stops activating its connectors after being disabled), use this onActivate hook: onActivate = function(self) return self:isEnabled() end,

CameraComponent (Component)

Custom camera component for rendering from arbitrary view point.

  • CameraComponent:setFov() Beta 2.2.4
  • CameraComponent:setNearClip() Beta 2.2.4
  • CameraComponent:setFarClip() Beta 2.2.4
  • CameraComponent:getFov() Beta 2.2.4
  • CameraComponent:getNearClip() Beta 2.2.4
  • CameraComponent:getFarClip() Beta 2.2.4
  • CameraComponent.onUpdate(self)

CameraShakeComponent (Component)

CastSpellComponent (ItemActionComponent)

Implements cast spell actions for spell wands. When used, a spell stored in the wand is cast. Optionally the wand may have limited number of charges.

  • CastSpellComponent:deplete()
  • CastSpellComponent:getCharges()
  • CastSpellComponent:getEmptyGfxIndex()
  • CastSpellComponent:getEmptyItem()
  • CastSpellComponent:getFullGfxIndex()
  • CastSpellComponent:getMaxCharges()
  • CastSpellComponent:getPower()
  • CastSpellComponent:getRequiredLevel()
  • CastSpellComponent:getSkill()
  • CastSpellComponent:getSpell()
  • CastSpellComponent:recharge()
  • CastSpellComponent:setCharges(number)
  • CastSpellComponent:setEmptyGfxIndex(number)
  • CastSpellComponent:setEmptyItem(string)
  • CastSpellComponent:setFullGfxIndex(number)
  • CastSpellComponent:setMaxCharges(number)
  • CastSpellComponent:setPower(number)
  • CastSpellComponent:setRequiredLevel(number)
  • CastSpellComponent:setSkill(string)
  • CastSpellComponent:setSpell(string)

ChestComponent (Component)

Implements the chest opening and closing animations. A chest be optionally locked and it could be mimic.

  • ChestComponent:getLocked()
  • ChestComponent:getMimic()
  • ChestComponent:setLocked(locked)
  • ChestComponent:setMimic(boolean)

ClickableComponent (Component)

Defines the click box of an object. onClick hook is called when the player clicks on the object. A GameObject can have any number of Clickables.

  • ClickableComponent:getDebugDraw()
  • ClickableComponent:getFrontFacing()
    Get whether the party needs to face the clickable to use it. (default: false)
  • ClickableComponent:getMaxDistance()
    Get maximum distance in squares. (default: 0)
  • ClickableComponent:getSize()
  • ClickableComponent:setDebugDraw(boolean)
  • ClickableComponent:setFrontFacing(boolean)
    Set whether the party needs to face the clickable to use it. (default: false)
  • ClickableComponent:setMaxDistance(number)
    Set maximum distance in squares. (default: 0)
  • ClickableComponent:setSize(size)
  • ClickableComponent.onClick(self)

CloudSpellComponent (Component)

A CloudSpell deals ongoing damage to party, monsters and obtacles in the same square. The component is automatically destroyed when its duration runs out.

  • CloudSpellComponent:getAttackPower()
  • CloudSpellComponent:getCastByChampion()
  • CloudSpellComponent:getDamageInterval()
  • CloudSpellComponent:getDamageType()
  • CloudSpellComponent:getDuration()
  • CloudSpellComponent:getSound()
  • CloudSpellComponent:setAttackPower(number)
  • CloudSpellComponent:setCastByChampion(number)
  • CloudSpellComponent:setDamageInterval(number)
  • CloudSpellComponent:setDamageType(string)
  • CloudSpellComponent:setDuration(time)
  • CloudSpellComponent:setSound(string)

ContainerItemComponent (Component)

Makes an item a container for other items.

  • ContainerItemComponent:addItem(item)
  • ContainerItemComponent:getCapacity()
  • ContainerItemComponent:getContainerType()
  • ContainerItemComponent:getItem(slot)
  • ContainerItemComponent:getItemCount()
  • ContainerItemComponent:insertItem(slot, item)
  • ContainerItemComponent:removeItem(item)
  • ContainerItemComponent:removeItemFromSlot(slot)
  • ContainerItemComponent:setContainerType(string)
  • ContainerItemComponent.onInsertItem(self, item, slot)
  • ContainerItemComponent.onRemoveItem(self, item, slot)
    Note that onInsertItem and onRemoveItem are not called when stacks of items are merged/split inside the container. That is, if there is a rock in the container, and the player adds a rock to that stack, onInsertItem is not called. If there is a stack of two rocks in the container, and the player takes one rock out of that stack, onRemoveItem is not called. Therefore, these hooks do not provide a way to detect when the sack's contents have been changed.

ControllerComponent (Component)

Generic controller component which can be used to implement custom activate/deactivate/toggle, open/close, increment/decrement or start/stop semantics for an object. For example, if you add onActivate and onDeactivate hooks to the Controller, the controller can act as target for activate and deactivate events in the Dungeon Editor.

  • ControllerComponent:activate()
  • ControllerComponent:close()
  • ControllerComponent:deactivate()
  • ControllerComponent:decrement()
  • ControllerComponent:getInitialState()
  • ControllerComponent:increment()
  • ControllerComponent:open()
  • ControllerComponent:pause()
  • ControllerComponent:reset()
  • ControllerComponent:setInitialState(string)
  • ControllerComponent:start()
  • ControllerComponent:stop()
  • ControllerComponent:toggle()
  • ControllerComponent.onInitialActivate(self)
  • ControllerComponent.onInitialDeactivate(self)
  • ControllerComponent.onInitialOpen(self)
  • ControllerComponent.onInitialClose(self)
  • ControllerComponent.onActivate(self)
  • ControllerComponent.onDeactivate(self)
  • ControllerComponent.onToggle(self)
  • ControllerComponent.onOpen(self)
  • ControllerComponent.onClose(self)
  • ControllerComponent.onIncrement(self)
  • ControllerComponent.onDecrement(self)
  • ControllerComponent.onStart(self)
  • ControllerComponent.onStop(self)
  • ControllerComponent.onPause(self)

CounterComponent (Component)

Counters start with an initial value and count down when activated. When counter's value reaches zero, it calls its onActivate hook and triggers onActivate connectors.

  • CounterComponent:decrement()
  • CounterComponent:getValue()
  • CounterComponent:increment()
  • CounterComponent:reset()
  • CounterComponent:setInitialValue(number)
  • CounterComponent:setValue(value)
  • CounterComponent.onActivate(self)
  • CounterComponent.onDeactivate(self)

CrabBrainComponent (BrainComponent)

Implements AI for Cave Crabs.

CraftPotionComponent (Component)

CrowControllerComponent (Component)

CrowernAttackComponent (Component)

CrystalComponent (Component)

Implements the animation and behavior of healing crystals.

  • CrystalComponent:activate()
  • CrystalComponent:deactivate()
  • CrystalComponent:getCooldown()
  • CrystalComponent:setCooldown(number)

CrystalShardItemComponent (Component)

DiggingToolComponent (Component)

DoorComponent (Component)

Door component blocks movement and projectiles from passing between two adjacent squares. Requires a Model component with a node named "gate". The gate node is animated when the door is opened and closed. Doors can either open vertically (single doors) or horizontally (double doors). Doors are technically compatible with "floor" placement in addition to the standard "wall" placement. However, items in a "floor" door's square cannot be picked up while the door is closed unless the door is sparse. "floor" doors that are closed on a monster will damage the monster, reopen, then immediately try to close again until the monster moves or dies. This effect only exists for monsters, not the party or obstacles.

  • DoorComponent:close()
  • DoorComponent:getCloseAcceleration()
  • DoorComponent:getCloseSound()
  • DoorComponent:getCloseVelocity()
  • DoorComponent:getDoorState()
  • DoorComponent:getDoubleDoor()
  • DoorComponent:getHitSound()
    Get sound to play when the door is hit.
  • DoorComponent:getKillPillars()
  • DoorComponent:getLockSound()
  • DoorComponent:getMaxHeight()
  • DoorComponent:getOpenSound()
  • DoorComponent:getOpenVelocity()
  • DoorComponent:getOpeningDirection()
  • DoorComponent:getPullChain()
  • DoorComponent:getPullchainObject()
    Get custom pullchain object.
  • DoorComponent:getSecretDoor()
    Get secret doors are not visible on the map.
  • DoorComponent:getSparse()
    Items can be picked up and dropped through sparse doors. Monsters can also see through sparse doors, and the Poison Cloud spell can be cast through sparse doors.
  • DoorComponent:isClosed()
  • DoorComponent:isClosing()
  • DoorComponent:isOpen()
  • DoorComponent:isOpening()
  • DoorComponent:isPassable()
  • DoorComponent:open()
  • DoorComponent:setCloseAcceleration(number)
  • DoorComponent:setCloseSound(string)
  • DoorComponent:setCloseVelocity(number)
  • DoorComponent:setDoorState(state)
  • DoorComponent:setDoubleDoor(boolean)
  • DoorComponent:setHitSound(string)
    Set sound to play when the door is hit.
  • DoorComponent:setKillPillars(boolean)
  • DoorComponent:setLockSound(string)
  • DoorComponent:setMaxHeight(number)
  • DoorComponent:setOpenSound(string)
  • DoorComponent:setOpenVelocity(number)
  • DoorComponent:setOpeningDirection(string)
  • DoorComponent:setPullChain(enable)
  • DoorComponent:setPullchainObject(string)
    Set custom pullchain object.
  • DoorComponent:setSecretDoor(boolean)
    Set secret doors are not visible on the map.
  • DoorComponent:setSparse(boolean)
  • DoorComponent:toggle()
  • DoorComponent.onOpen(self)
  • DoorComponent.onClose(self)
  • DoorComponent.onAttackedByChampion(self, champion, weapon, attack, slot)
    Called when a champion attacks the door with a melee or firearm attack. This hook is not called when the door is hit by projectiles.

DynamicObstacleComponent (Component)

EarthquakeComponent (Component)

EntangledMonsterComponent (Component)

EquipmentItemComponent (Component)

Implemented various modifiers to stats of an Champion when the item is equipped. The traits of an item define where the item can be equipped.

  • EquipmentItemComponent:getAccuracy()
    Get accuracy modifier.
  • EquipmentItemComponent:getCooldownRate()
    Get cooldown rate modifier.
  • EquipmentItemComponent:getCriticalChance()
    Get critical chance modifier.
  • EquipmentItemComponent:getDamage()
  • EquipmentItemComponent:getDexterity()
    Get dexterity modifier.
  • EquipmentItemComponent:getEnergy()
    Get energy modifier.
  • EquipmentItemComponent:getEnergyRegenerationRate()
    Get energy regeneration rate modifier.
  • EquipmentItemComponent:getEvasion()
    Get evasion modifier.
  • EquipmentItemComponent:getExpRate()
    Get experience rate modifier.
  • EquipmentItemComponent:getFoodRate()
    Get food consumption rate modifier.
  • EquipmentItemComponent:getHealth()
    Get health modifier.
  • EquipmentItemComponent:getHealthRegenerationRate()
    Get health regeneration rate modifier.
  • EquipmentItemComponent:getProtection()
    Get protection modifier.
  • EquipmentItemComponent:getResistCold()
    Get cold resistance modifier.
  • EquipmentItemComponent:getResistFire()
    Get fire resistance modifier.
  • EquipmentItemComponent:getResistPoison()
    Get poison resistance modifier.
  • EquipmentItemComponent:getResistShock()
    Get shock resistance modifier.
  • EquipmentItemComponent:getSlot()
  • EquipmentItemComponent:getStrength()
    Get strength modifier.
  • EquipmentItemComponent:getVitality()
    Get vitality modifier.
  • EquipmentItemComponent:getWillpower()
    Get willpower modifier.
  • EquipmentItemComponent:setAccuracy(number)
    Set accuracy modifier.
  • EquipmentItemComponent:setCooldownRate(number)
    Set cooldown rate modifier.
  • EquipmentItemComponent:setCriticalChance(number)
    Set critical chance modifier.
  • EquipmentItemComponent:setDamage(number)
  • EquipmentItemComponent:setDexterity(number)
    Set dexterity modifier.
  • EquipmentItemComponent:setEnergy(number)
    Set energy modifier.
  • EquipmentItemComponent:setEnergyRegenerationRate(number)
    Set energy regeneration rate modifier.
  • EquipmentItemComponent:setEvasion(number)
    Set evasion modifier.
  • EquipmentItemComponent:setExpRate(number)
    Set experience rate modifier.
  • EquipmentItemComponent:setFoodRate(number)
    Set food consumption rate modifier.
  • EquipmentItemComponent:setHealth(number)
    Set health modifier.
  • EquipmentItemComponent:setHealthRegenerationRate(number)
    Set health regeneration rate modifier.
  • EquipmentItemComponent:setProtection(number)
    Set protection modifier.
  • EquipmentItemComponent:setResistCold(number)
    Set cold resistance modifier.
  • EquipmentItemComponent:setResistFire(number)
    Set fire resistance modifier.
  • EquipmentItemComponent:setResistPoison(number)
    Set poison resistance modifier.
  • EquipmentItemComponent:setResistShock(number)
    Set shock resistance modifier.
  • EquipmentItemComponent:setSlot(number)
  • EquipmentItemComponent:setStrength(number)
    Set strength modifier.
  • EquipmentItemComponent:setVitality(number)
    Set vitality modifier.
  • EquipmentItemComponent:setWillpower(number)
    Set willpower modifier.
  • EquipmentItemComponent.onRecomputeStats(self, champion)
  • EquipmentItemComponent.onComputeAccuracy(self, champion, weapon, attack, attackType)
  • EquipmentItemComponent.onComputeCritChance(self, champion, weapon, attack, attackType)

ExitComponent (Component)

EyctopusBrainComponent (BrainComponent)

Implements AI for Eyctopuses.

FireElementalBrainComponent (BrainComponent)

Implements AI for Fire Elementals.

FirearmAttackComponent (ItemActionComponent)

Implements firearm attacks. Firearm attacks need ammo.

  • FirearmAttackComponent:getAccuracy()
    Get optional accuracy bonus.
  • FirearmAttackComponent:getAmmo()
    Get type of ammo needed to fire the weapon. (optional)
  • FirearmAttackComponent:getAttackPower()
    Get attack power of the attack.
  • FirearmAttackComponent:getAttackSound()
    Get name of the sound effect to play. (default: "swipe")
  • FirearmAttackComponent:getBaseDamageStat()
    Get base statistic used for computing damage modifier. (default: none)
  • FirearmAttackComponent:getClipSize()
    Get (optional) clip size for revolver like weapons.
  • FirearmAttackComponent:getDamageType()
    Get damage type of the attack.
  • FirearmAttackComponent:getLoadedCount()
    Get (optional) how much ammo is currently loaded in the revolver.
  • FirearmAttackComponent:getPierce()
    Get how many points of armor is bypassed by the attack.
  • FirearmAttackComponent:getRange()
    Get range in squares.
  • FirearmAttackComponent:getRequiredLevel()
  • FirearmAttackComponent:getSkill()
  • FirearmAttackComponent:setAccuracy(number)
    Set optional accuracy bonus.
  • FirearmAttackComponent:setAmmo(string)
    Set type of ammo needed to fire the weapon. (optional)
  • FirearmAttackComponent:setAttackPower(number)
    Set attack power of the attack.
  • FirearmAttackComponent:setAttackSound(string)
    Set name of the sound effect to play.
  • FirearmAttackComponent:setBaseDamageStat(number)
    Set base statistic used for computing damage modifier. (default: none)
  • FirearmAttackComponent:setClipSize(number)
    Set (optional) clip size for revolver like weapons.
  • FirearmAttackComponent:setDamageType(string)
    Set damage type of the attack: Standard damage types are "physical" (default), "cold", "fire", "poison", "shock", "dispel", "pure".
  • FirearmAttackComponent:setLoadedCount(number)
    Set (optional) how much ammo is currently loaded in the revolver.
  • FirearmAttackComponent:setPierce(number)
    Set how many points of armor is bypassed by the attack.
  • FirearmAttackComponent:setRange(number)
    Set range in squares.
  • FirearmAttackComponent:setRequiredLevel(number)
  • FirearmAttackComponent:setSkill(string)
  • FirearmAttackComponent.onBackfire(self, champion)
  • FirearmAttackComponent.onPostAttack(self, champion, slot)

FloorTriggerComponent (Component)

A floor trigger reacts to objects placed into trigger's square. A floor trigger can be in two states: activated and deactivated. When an object is placed on a deactivated trigger, it changes to activated state and fires its onActivate hooks and connectors. Similarly when an object is removed from the square of an activated trigger, the trigger changes into deactivated state and fires its onDeactivate hooks and connectors.

  • FloorTriggerComponent:getActivateSound()
  • FloorTriggerComponent:getDeactivateSound()
  • FloorTriggerComponent:getDisableSelf()
  • FloorTriggerComponent:getPressurePlate()
    Get whether the floor trigger is part of an actual pressure plate device (camera is tilted down when standing on pressure plates, etc.)
  • FloorTriggerComponent:getTriggeredByDigging()
  • FloorTriggerComponent:getTriggeredByEntityType()
  • FloorTriggerComponent:getTriggeredByItem()
  • FloorTriggerComponent:getTriggeredByMonster()
  • FloorTriggerComponent:getTriggeredByParty()
  • FloorTriggerComponent:getTriggeredByPushableBlock()
  • FloorTriggerComponent:isActivated()
  • FloorTriggerComponent:isDeactivated()
  • FloorTriggerComponent:setActivateSound(string)
  • FloorTriggerComponent:setDeactivateSound(string)
  • FloorTriggerComponent:setDisableSelf(boolean)
  • FloorTriggerComponent:setPressurePlate(boolean)
    Set whether the floor trigger is part of an actual pressure plate device (camera is tilted down when standing on pressure plates, etc.)
  • FloorTriggerComponent:setTriggeredByDigging(boolean)
  • FloorTriggerComponent:setTriggeredByEntityType(string)
  • FloorTriggerComponent:setTriggeredByItem(boolean)
  • FloorTriggerComponent:setTriggeredByMonster(boolean)
  • FloorTriggerComponent:setTriggeredByParty(boolean)
  • FloorTriggerComponent:setTriggeredByPushableBlock(boolean)
  • FloorTriggerComponent.onActivate(self)
  • FloorTriggerComponent.onDeactivate(self)
  • FloorTriggerComponent.onToggle(self)

FogParamsComponent (Component)

Overrides fog parameters for indoor scenes. This component is used to make the fog green in Herder's Den level in the main campaign. Only works indoors! The Sky component defines fog parameters for outdoor scenes.

  • FogParamsComponent:getFogColor()
  • FogParamsComponent:getFogMode()
  • FogParamsComponent:getFogRange()
  • FogParamsComponent:setFogColor(vec)
  • FogParamsComponent:setFogMode(string)
  • FogParamsComponent:setFogRange(table)

FogParticlesComponent (Component)

Adds particle fog effect to the scene. The effect quite heavy on performance so use it wisely.

  • FogParticlesComponent:getColor1()
  • FogParticlesComponent:getColor2()
  • FogParticlesComponent:getColor3()
  • FogParticlesComponent:getOpacity()
  • FogParticlesComponent:getParticleSize()
  • FogParticlesComponent:getTexture()
  • FogParticlesComponent:setColor1(vec)
  • FogParticlesComponent:setColor2(vec)
  • FogParticlesComponent:setColor3(vec)
  • FogParticlesComponent:setOpacity(number)
  • FogParticlesComponent:setParticleSize(number)
  • FogParticlesComponent:setTexture(texture)

ForceFieldComponent (Component)

FrozenMonsterComponent (Component)

GoromorgBrainComponent (BrainComponent)

Implements AI for Goromorgs.

GoromorgShieldComponent (Component)

Implements the Goromorg shield effect for monsters. The shielded monster is invulnerable to all damage. Instead the damage is directed to the shield. When the shield's energy is depleted the shield is destroyed.

  • GoromorgShieldComponent:getEnergy()
  • GoromorgShieldComponent:setEnergy(number)

GravityComponent (Component)

Makes the object fall unless it is on ground or supported by a surface or a platform.

  • GravityComponent:getDestroySelf()
    Get whether component should be destroyed when it impacts ground.
  • GravityComponent:getFallingSpeed()
  • GravityComponent:isFalling()
  • GravityComponent:setDestroySelf(boolean)
    Set whether component should be destroyed when it impacts ground.
  • GravityComponent:setFallingSpeed(speed)

HealthComponent (Component)

Makes the object breakable. Typically used with Obstacle component to make breakable obstacles. When the health value reaches zero, the object is destroyed.

  • HealthComponent:getDieSound()
  • HealthComponent:getHealth()
  • HealthComponent:getImmunities()
  • HealthComponent:getInvulnerable()
    Get whether the object is invulnerable to all damage.
  • HealthComponent:getSpawnOnDeath()
  • HealthComponent:setDieSound(string)
  • HealthComponent:setHealth(number)
  • HealthComponent:setImmunities(table)
  • HealthComponent:setInvulnerable(boolean)
    Set whether the object is invulnerable to all damage.
  • HealthComponent:setSpawnOnDeath(string)
  • HealthComponent.onDie(self)

HeightmapComponent (Component)

HerderBigBrainComponent (BrainComponent)

Implements AI for Big Herders.

HerderSmallBrainComponent (BrainComponent)

Implements AI for Small Herders.

IceGuardianBrainComponent (BrainComponent)

Implements AI for Ice Guardians.

IceLizardBrainComponent (BrainComponent)

Implements AI for Ice Lizards.

IceShardsComponent (Component)

Implements the Ice Shards spell.

  • IceShardsComponent:getDelay()
  • IceShardsComponent:getRange()
  • IceShardsComponent:grantTemporaryImmunity(GameObject, number)
  • IceShardsComponent:setDelay(number)
  • IceShardsComponent:setRange(number)

ItemActionComponent (Component)

Base-class for item actions (usually attacks). onAttack hook is called when the item's action is performed by an champion.

  • ItemActionComponent:getBuildup()
    Get power attack buildup time (default: 1 second)
  • ItemActionComponent:getChainAction()
  • ItemActionComponent:getChainActionDelay()
  • ItemActionComponent:getCooldown()
  • ItemActionComponent:getEnergyCost()
  • ItemActionComponent:getGameEffect()
  • ItemActionComponent:getNextChainAction()
  • ItemActionComponent:getRepeatCount()
  • ItemActionComponent:getRepeatDelay()
  • ItemActionComponent:getRequirements()
    Get list of skill requirements, e.g. {"two_handed", 1, "axes", 3}
  • ItemActionComponent:getRequirementsText()
  • ItemActionComponent:getUiName()
    Get power attack name.
  • ItemActionComponent:setBuildup(number)
    Set power attack buildup time. (default: 1 second)
  • ItemActionComponent:setChainAction(string)
  • ItemActionComponent:setChainActionDelay(number)
  • ItemActionComponent:setCooldown(number)
  • ItemActionComponent:setEnergyCost(number)
  • ItemActionComponent:setGameEffect(string)
  • ItemActionComponent:setRepeatCount(number)
  • ItemActionComponent:setRepeatDelay(number)
  • ItemActionComponent:setRequirements(table)
    Set list of skill requirements, e.g. {"two_handed", 1, "axes", 3}
  • ItemActionComponent:setUiName(string)
    Set power attack name.
  • ItemActionComponent.onAttack(self, champion, slot, chainIndex)

ItemComponent (Component)

Makes the object an item that can be picked up, dropped, thrown and placed into champions' hands and inventory. Requires Model component.

  • ItemComponent:addTrait(trait)
  • ItemComponent:getAchievement()
    Get achievement unlocked when the item is first picked up.
  • ItemComponent:getArmorSet()
    Get the name of the armor set the item belongs to.
  • ItemComponent:getCharges()
  • ItemComponent:getConvertToItemOnImpact()
  • ItemComponent:getDescription()
    Get textual description of the item.
  • ItemComponent:getFitContainer()
    Get whether the item fits inside containers such as sacks or wooden boxes. (default: true)
  • ItemComponent:getFormattedName()
  • ItemComponent:getFragile()
  • ItemComponent:getFuel()
  • ItemComponent:getGameEffect()
  • ItemComponent:getGfxAtlas()
    Get filename of the icon texture.
  • ItemComponent:getGfxIndex()
    Get index of icon in texture atlas.
  • ItemComponent:getGfxIndexInHand()
    Get index of in-hand icon.
  • ItemComponent:getGfxIndexPowerAttack()
    Get index of charging power attack icon.
  • ItemComponent:getImpactSound()
    Get sound which is played when projectile item hits wall or a wall is hit with melee attack.
  • ItemComponent:getJammed()
  • ItemComponent:getMultiple()
    Get minimum count of items for splitting stacks.
  • ItemComponent:getPrimaryAction()
    Get name of the component to trigger when item is clicked in the attack panel.
  • ItemComponent:getProjectileRotationSpeed()
  • ItemComponent:getProjectileRotationX()
  • ItemComponent:getProjectileRotationY()
  • ItemComponent:getProjectileRotationZ()
  • ItemComponent:getSecondaryAction()
    Get name of the component to trigger when it's secondary action is used.
  • ItemComponent:getSharpProjectile()
    Get whether the item sticks to monsters on impact when thrown.
  • ItemComponent:getStackSize()
  • ItemComponent:getStackable()
    Get whether the item is stackable.
  • ItemComponent:getTotalWeight()
  • ItemComponent:getUiName()
    Get the name shown to the player.
  • ItemComponent:getWeight()
    Get weight of the item in kilograms.
  • ItemComponent:hasTrait(trait)
  • ItemComponent:land() Beta 2.2.1
  • ItemComponent:removeTrait(trait)
  • ItemComponent:setAchievement(string)
    Set achievement unlocked when the item is first picked up.
  • ItemComponent:setArmorSet(string)
    Set the name of the armor set the item belongs to.
  • ItemComponent:setCharges(number)
  • ItemComponent:setConvertToItemOnImpact(string)
  • ItemComponent:setDescription(string)
    Set textual description of the item.
  • ItemComponent:setFitContainer(boolean)
    Set whether the item fits inside containers such as sacks or wooden boxes. (default: true)
  • ItemComponent:setFragile(boolean)
  • ItemComponent:setFuel(number)
  • ItemComponent:setGameEffect(string)
  • ItemComponent:setGfxAtlas(string)
    Set filename of the icon texture.
  • ItemComponent:setGfxIndex(number)
    Set index of icon in texture atlas.
  • ItemComponent:setGfxIndexInHand(number)
    Set index of in-hand icon.
  • ItemComponent:setGfxIndexPowerAttack(number)
    Set index of charging power attack icon.
  • ItemComponent:setImpactSound(string)
    Set sound which is played when projectile item hits wall or a wall is hit with melee attack.
  • ItemComponent:setJammed(boolean)
  • ItemComponent:setMultiple(number)
    Set minimum count of items for splitting stacks.
  • ItemComponent:setPrimaryAction(string)
    Set name of the component to trigger when item is clicked in the attack panel.
  • ItemComponent:setProjectileRotationSpeed(number)
  • ItemComponent:setProjectileRotationX(number)
  • ItemComponent:setProjectileRotationY(number)
  • ItemComponent:setProjectileRotationZ(number)
  • ItemComponent:setSecondaryAction(string)
    Set name of the component to trigger when it's secondary action is used.
  • ItemComponent:setSharpProjectile(boolean)
    Set whether the item sticks to monsters on impact when thrown.
  • ItemComponent:setStackSize(count)
  • ItemComponent:setStackable(boolean)
    Set whether the item is stackable.
  • ItemComponent:setTraits(traits)
  • ItemComponent:setUiName(string)
    Set the name shown to the player.
  • ItemComponent:setWeight(number)
    Set weight of the item in kilograms.
  • ItemComponent:throwItem(dir, power) Beta 2.2.1
  • ItemComponent:updateBoundingBox()
  • ItemComponent.onThrowAttackHitMonster(self, monster)
  • ItemComponent.onEquipItem(self, champion, slot)
  • ItemComponent.onUnequipItem(self, champion, slot)

ItemConstrainBoxComponent (Component)

LadderComponent (Component)

LensFlareComponent (Component)

LeverComponent (Component)

A controller component that implements lever mechanics for an object. The GameObject should have a Clickable and an Animation component with "activate" and "deactivate" animation clips attached to it.

  • LeverComponent:getDisableSelf()
  • LeverComponent:getSound()
  • LeverComponent:isActivated()
  • LeverComponent:isDeactivated()
  • LeverComponent:setDisableSelf(boolean)
  • LeverComponent:setSound(string)
  • LeverComponent:setState(state)
  • LeverComponent:toggle()
  • LeverComponent.onActivate(self)
  • LeverComponent.onDeactivate(self)
  • LeverComponent.onToggle(self)

LightComponent (Component)

Dynamic light source for rendering. A single GameObject can have multiple Light components.

  • LightComponent:fadeIn(time)
  • LightComponent:fadeOut(time)
  • LightComponent:getBrightness()
  • LightComponent:getCastShadow()
  • LightComponent:getClipDistance()
  • LightComponent:getColor()
  • LightComponent:getColor2()
  • LightComponent:getColor3()
  • LightComponent:getDebugDraw()
  • LightComponent:getDestroyObject()
  • LightComponent:getDirection()
  • LightComponent:getDisableSelf()
  • LightComponent:getFadeOut()
  • LightComponent:getRange()
  • LightComponent:getShadowMapSize()
  • LightComponent:getSpotAngle()
  • LightComponent:getSpotSharpness()
  • LightComponent:getStaticShadowDistance()
  • LightComponent:getStaticShadows()
  • LightComponent:getType()
  • LightComponent:setBrightness(brightness)
  • LightComponent:setCastShadow(castShadow)
  • LightComponent:setClipDistance(face, distance)
  • LightComponent:setColor(color)
  • LightComponent:setColor2(color)
  • LightComponent:setColor3(color)
  • LightComponent:setDebugDraw(debugDraw)
  • LightComponent:setDestroyObject(boolean)
  • LightComponent:setDirection(direction)
  • LightComponent:setDisableSelf(boolean)
  • LightComponent:setFadeOut(time)
  • LightComponent:setRange(range)
  • LightComponent:setShadowMapSize(size)
  • LightComponent:setSpotAngle(angle)
  • LightComponent:setSpotSharpness(sharpness)
  • LightComponent:setStaticShadowDistance(number)
  • LightComponent:setStaticShadows(boolean)
  • LightComponent:setType(type)
    Must be one of "point" (default), "ambient", "directional", or "spot".
  • LightComponent.onUpdate(self)

LindwormBrainComponent (BrainComponent)

Implements AI for the Lindworm.

LindwormChargeComponent (Component)

LindwormFlyComponent (Component)

LockComponent (Component)

A controller component that implements lock mechanics for an object. Requires Clickable component.

  • LockComponent:getOpenedBy()
  • LockComponent:getSound()
  • LockComponent:setOpenedBy(string)
  • LockComponent:setSound(string)
  • LockComponent.onActivate(self)

MagmaGolemBrainComponent (BrainComponent)

Implements AI for Magma Golems.

MapGraphicsComponent (Component)

Adds custom graphics to the automap.

  • MapGraphicsComponent:getImage()
  • MapGraphicsComponent:getOffset0()
  • MapGraphicsComponent:getOffset1()
  • MapGraphicsComponent:getOffset2()
  • MapGraphicsComponent:getOffset3()
  • MapGraphicsComponent:getRotate()
  • MapGraphicsComponent:setImage(image)
  • MapGraphicsComponent:setOffset0(vec)
  • MapGraphicsComponent:setOffset1(vec)
  • MapGraphicsComponent:setOffset2(vec)
  • MapGraphicsComponent:setOffset3(vec)
  • MapGraphicsComponent:setRotate(boolean)

MapMarkerComponent (Component)

Adds a marker with text on the automap.

  • MapMarkerComponent:getText()
  • MapMarkerComponent:setText(string)

MeleeAttackComponent (ItemActionComponent)

Implements melee attack action for items. Melee attacks can hit and damage a single target in front of the party.

  • MeleeAttackComponent:getAccuracy()
    Get optional accuracy bonus.
  • MeleeAttackComponent:getAttackPower()
    Get attack power of the attack.
  • MeleeAttackComponent:getAttackSound()
    Get name of the sound effect to play. (default: "swipe")
  • MeleeAttackComponent:getBaseDamageStat()
    Get base statistic used for computing damage modifier. (default: "strength")
  • MeleeAttackComponent:getCameraShake()
  • MeleeAttackComponent:getCauseCondition()
  • MeleeAttackComponent:getConditionChance()
  • MeleeAttackComponent:getDamageType()
    Get damage type of the attack: "physical" (default), "cold", "fire", "poison" or "shock"
  • MeleeAttackComponent:getPierce()
    Get how many points of armor is bypassed by the attack.
  • MeleeAttackComponent:getReachWeapon()
    Get a boolean flag, if enabled the weapon can be used to attack from the back row.
  • MeleeAttackComponent:getRequiredLevel()
  • MeleeAttackComponent:getSkill()
  • MeleeAttackComponent:getSwipe()
    Get name of the swipe animation to play. (default: "horizontal")
  • MeleeAttackComponent:getUnarmedAttack()
  • MeleeAttackComponent:setAccuracy(number)
    Set optional accuracy bonus.
  • MeleeAttackComponent:setAttackPower(number)
    Set attack power of the attack.
  • MeleeAttackComponent:setAttackSound(string)
    Set name of the sound effect to play. (default: "swipe")
  • MeleeAttackComponent:setBaseDamageStat(string)
    Set base statistic used for computing damage modifier (default: "strength")
  • MeleeAttackComponent:setCameraShake(boolean)
  • MeleeAttackComponent:setCauseCondition(string)
  • MeleeAttackComponent:setConditionChance(number)
  • MeleeAttackComponent:setDamageType(string)
    Set damage type of the attack: "physical" (default), "cold", "fire", "poison" or "shock"
  • MeleeAttackComponent:setPierce(number)
    Set how many points of armor is bypassed by the attack.
  • MeleeAttackComponent:setReachWeapon(boolean)
    Set a boolean flag, if enabled the weapon can be used to attack from the back row.
  • MeleeAttackComponent:setRequiredLevel(number)
  • MeleeAttackComponent:setSkill(string)
  • MeleeAttackComponent:setSwipe(string)
    Set name of the swipe animation to play. (default: "horizontal")
  • MeleeAttackComponent:setUnarmedAttack(boolean)
  • MeleeAttackComponent.onPostAttack(self, champion, slot)
    The function is called when attacking an empty space. Hitting objects and monsters will NOT trigger this.
  • MeleeAttackComponent.onHitMonster(self, monster, tside, damage, champion)
    The function is called if a monster is hit. Scoring a miss will NOT trigger this.

MeleeBrainComponent (BrainComponent)

Implements AI for generic (stupid) melee monsters.

MimicCameraAnimationComponent (Component)

ModelComponent (Component)

3D model for rendering. A single GameObject can have multiple Model components.

  • ModelComponent:getBoundBox()
  • ModelComponent:getCastShadow()
  • ModelComponent:getDebugDraw()
  • ModelComponent:getDissolveEnd()
  • ModelComponent:getDissolveStart()
  • ModelComponent:getEmissiveColor()
  • ModelComponent:getMaterial()
  • ModelComponent:getMaterialOverrides()
  • ModelComponent:getModel()
  • ModelComponent:getReflection()
  • ModelComponent:getRenderHack()
  • ModelComponent:getShadowLod()
  • ModelComponent:getSortOffset()
  • ModelComponent:getStaticShadow()
  • ModelComponent:getStoreSourceData()
  • ModelComponent:setBoundBox(desc)
  • ModelComponent:setCastShadow(enable)
  • ModelComponent:setDebugDraw(debugDraw)
  • ModelComponent:setDissolveEnd(number)
  • ModelComponent:setDissolveStart(number)
  • ModelComponent:setEmissiveColor(color)
  • ModelComponent:setMaterial(material)
  • ModelComponent:setMaterialOverrides(map)
  • ModelComponent:setModel(filename)
  • ModelComponent:setReflection(boolean)
  • ModelComponent:setRenderHack(hack)
    Valid render hacks are "DisableDepthTest", "ForceZWrite", "Sky", and "Water".
  • ModelComponent:setShadowLod(number)
  • ModelComponent:setSortOffset(offset)
  • ModelComponent:setStaticShadow(enable)
  • ModelComponent:setStoreSourceData(boolean)
  • ModelComponent:updateLods()

MonsterActionComponent (Component)

Implements a custom monster action. An action is always connected with an animation that controls when the action starts and ends. onBeginAction and onEndAction hooks are called when the action is started and ended. onAnimationEvent hook is called when an animation event is triggered.

  • MonsterActionComponent:getAnimation()
  • MonsterActionComponent:getCooldown()
  • MonsterActionComponent:setAnimation(string)
  • MonsterActionComponent:setCooldown(number)
  • MonsterActionComponent.onBeginAction(self)
  • MonsterActionComponent.onEndAction(self)
  • MonsterActionComponent.onAnimationEvent(self, event)

MonsterAttackComponent (MonsterActionComponent)

Implements a monster attack action. A monster can have more than one attacks.

  • MonsterAttackComponent:getAccuracy()
  • MonsterAttackComponent:getAnimationSpeed()
  • MonsterAttackComponent:getAnimations()
  • MonsterAttackComponent:getAttackFromBehindAnimation()
  • MonsterAttackComponent:getAttackPower()
  • MonsterAttackComponent:getAttackType()
  • MonsterAttackComponent:getCameraShake()
  • MonsterAttackComponent:getCameraShakeDuration()
  • MonsterAttackComponent:getCameraShakeIntensity()
  • MonsterAttackComponent:getCauseCondition()
  • MonsterAttackComponent:getConditionChance()
  • MonsterAttackComponent:getImpactSound()
  • MonsterAttackComponent:getKnockback()
  • MonsterAttackComponent:getMaxDistance()
  • MonsterAttackComponent:getMinDistance()
  • MonsterAttackComponent:getProjectileHeight()
  • MonsterAttackComponent:getProjectileOriginNode()
  • MonsterAttackComponent:getReach()
  • MonsterAttackComponent:getRepeatChance()
  • MonsterAttackComponent:getScreenEffect()
  • MonsterAttackComponent:getShootProjectile()
  • MonsterAttackComponent:getSound()
  • MonsterAttackComponent:getTurnToAttackDirection()
  • MonsterAttackComponent:resetCooldown()
  • MonsterAttackComponent:setAccuracy(number)
  • MonsterAttackComponent:setAnimationSpeed(number)
  • MonsterAttackComponent:setAnimations(anims)
  • MonsterAttackComponent:setAttackFromBehindAnimation(string)
  • MonsterAttackComponent:setAttackPower(number)
  • MonsterAttackComponent:setAttackType(string)
  • MonsterAttackComponent:setCameraShake(boolean)
  • MonsterAttackComponent:setCameraShakeDuration(number)
  • MonsterAttackComponent:setCameraShakeIntensity(number)
  • MonsterAttackComponent:setCauseCondition(table)
  • MonsterAttackComponent:setConditionChance(number)
  • MonsterAttackComponent:setImpactSound(string)
  • MonsterAttackComponent:setKnockback(boolean)
  • MonsterAttackComponent:setMaxDistance(number)
  • MonsterAttackComponent:setMinDistance(number)
  • MonsterAttackComponent:setProjectileHeight(number)
  • MonsterAttackComponent:setProjectileOriginNode(string)
  • MonsterAttackComponent:setReach(number)
  • MonsterAttackComponent:setRepeatChance(number)
  • MonsterAttackComponent:setScreenEffect(string)
  • MonsterAttackComponent:setShootProjectile(string)
  • MonsterAttackComponent:setSound(string)
  • MonsterAttackComponent:setTurnToAttackDirection(boolean)
  • MonsterAttackComponent:startCooldown()
  • MonsterAttackComponent.onAttack(self)
    Called whenever the MonsterAttackComponent tries to perform an attack, i.e. whenever an "attack" animation event occurs. If this hook returns false, the attack won't be performed, but the animation will continue.
  • MonsterAttackComponent.onAttackHit(self, champion)
  • MonsterAttackComponent.onDealDamage(self, champion, damage)

MonsterChangeAltitudeComponent (Component)

MonsterChargeComponent (Component)

Implements a monster charge action. When the action is started, it first plays the "chargeBegin" animation after which it alternates between "chargeContinue1" and "chargeContinue2" animations until the charge ends. Each animation moves the monster forward by one square.

  • MonsterChargeComponent:getAttackPower()
  • MonsterChargeComponent:getCooldown()
  • MonsterChargeComponent:getSound()
  • MonsterChargeComponent:setAttackPower(number)
  • MonsterChargeComponent:setCooldown(number)
  • MonsterChargeComponent:setSound(string)

MonsterComponent (Component)

Makes the object a monster. Requires Model, Animation and a brain component. Most monsters (depending on the brain) also require MonsterMove, MonsterTurn and MonsterAttack components.

  • MonsterComponent:addItem(item)
  • MonsterComponent:addTrait(trait)
  • MonsterComponent:attack()
  • MonsterComponent:contents()
    Returns a function that can be executed like ipairs(iterator, object) returning all of the items held by the monster. Note you need to reference names and ids with "go" since they are returning item components.
  • MonsterComponent:die()
    Accepts the optional boolean True, which treats the monster as if it were killed by the party and awards exp.
  • MonsterComponent:dropAllItems()
  • MonsterComponent:getCapsuleHeight()
  • MonsterComponent:getCapsuleRadius()
  • MonsterComponent:getCollisionRadius()
  • MonsterComponent:getCurrentAction()
  • MonsterComponent:getDeathEffect()
  • MonsterComponent:getDieSound()
  • MonsterComponent:getEvasion()
  • MonsterComponent:getExp()
  • MonsterComponent:getFlying()
  • MonsterComponent:getFootstepSound()
  • MonsterComponent:getGroupSize()
  • MonsterComponent:getHeadRotation()
    Get head node rotation for stun effect.
  • MonsterComponent:getHealth()
  • MonsterComponent:getHitEffect()
  • MonsterComponent:getHitSound()
  • MonsterComponent:getIdleAnimation()
  • MonsterComponent:getImmunities()
  • MonsterComponent:getLevel()
  • MonsterComponent:getLootDrop()
  • MonsterComponent:getMaxHealth()
  • MonsterComponent:getMeshName()
  • MonsterComponent:getMonsterFlag(string)
  • MonsterComponent:getProtection()
  • MonsterComponent:getResistance()
  • MonsterComponent:getShape()
  • MonsterComponent:getSwarm()
  • MonsterComponent:hasTrait(trait)
  • MonsterComponent:isAlive()
  • MonsterComponent:isChangingAltitude()
  • MonsterComponent:isFalling()
  • MonsterComponent:isGroupLeader()
  • MonsterComponent:isIdle()
  • MonsterComponent:isImmuneTo(effect)
  • MonsterComponent:isInBackRow()
  • MonsterComponent:isInvulnerable()
  • MonsterComponent:isMoving()
  • MonsterComponent:isPerformingAction(name)
  • MonsterComponent:isReadyToAct()
  • MonsterComponent:knockback(direction)
  • MonsterComponent:moveBackward()
  • MonsterComponent:moveForward()
  • MonsterComponent:performAction(name)
  • MonsterComponent:removeItem(item)
  • MonsterComponent:removeTrait(trait)
  • MonsterComponent:setAIState(state)
  • MonsterComponent:setCapsuleHeight(number)
  • MonsterComponent:setCapsuleRadius(number)
  • MonsterComponent:setCollisionRadius(number)
  • MonsterComponent:setCondition(condition)
  • MonsterComponent:setDeathEffect(string)
  • MonsterComponent:setDieSound()
  • MonsterComponent:setEvasion(number)
  • MonsterComponent:setExp(number)
  • MonsterComponent:setFlying(boolean)
  • MonsterComponent:setFootstepSound(string)
  • MonsterComponent:setHeadRotation(vec)
    Set head node rotation for stun effect.
  • MonsterComponent:setHealth(health)
  • MonsterComponent:setHitEffect(string)
  • MonsterComponent:setHitSound(string)
  • MonsterComponent:setIdleAnimation(string)
  • MonsterComponent:setImmunities(immunities)
  • MonsterComponent:setLevel(level)
  • MonsterComponent:setLootDrop(table)
  • MonsterComponent:setMaxHealth(health)
  • MonsterComponent:setMeshName(string)
  • MonsterComponent:setMonsterFlag(string, boolean)
    The following monster flags exist:
    NonMaterial - Monster becomes intangible to melee attacks (even the "Miss" damageText is not produced) and TileDamagerComponents. The monster can still be hit by projectiles and telefragged/crushed, and still functions as an obstacle.
    CantDie - Monster cannot die by any means, even telefrags and MonsterComponent:die(). The monster still takes damage. Invulnerable - Monster cannot take damage. It can still be hit, but all hits will do 0 damage. The monster cannot be telefragged/crushed, but can still be killed by MonsterComponent:die().
    Collides - Unlike the rest of the flags, true by default. If set to false, the monster's will no longer collide with projectiles. It still functions as an obstacle, gets hit by melee attacks, etc.
    DamagedByChampion1, DamagedByChampion2, DamagedByChampion3, DamagedByChampion4 - Not used AFAIK. Presumably a holdover from Grimrock 1 where champions that didn't damage a monster only got half experience.
  • MonsterComponent:setProtection(number)
  • MonsterComponent:setResistances(resists)
  • MonsterComponent:setShape(shape)
  • MonsterComponent:setSwarm(boolean)
  • MonsterComponent:setTraits(traits)
  • MonsterComponent:shootProjectile(projectile, height, attackPower, node)
    node argument is optional. If present, it must be the name of a node on the monster's model which the projectile will be fired from.
  • MonsterComponent:showDamageText(text)
  • MonsterComponent:strafeLeft()
  • MonsterComponent:strafeRight()
  • MonsterComponent:throwItem(item, height, attackPower)
  • MonsterComponent:turnLeft()
  • MonsterComponent:turnRight()
  • MonsterComponent.onProjectileHit(self, item, damage, damageType)
  • MonsterComponent.onPerformAction(self, name)
  • MonsterComponent.onDamage(self, damage, damageType)
  • MonsterComponent.onDie(self)

MonsterDropItemComponent (Component)

MonsterGroupComponent (Component)

Spawns a group of monsters when the next time the level is updated.

  • MonsterGroupComponent:getAIState()
  • MonsterGroupComponent:getCount()
  • MonsterGroupComponent:getLevel()
  • MonsterGroupComponent:getMonsterType()
  • MonsterGroupComponent:setAIState(state)
  • MonsterGroupComponent:setCount(number)
  • MonsterGroupComponent:setLevel(number)
  • MonsterGroupComponent:setMonsterType(string)
  • MonsterGroupComponent:spawnNow()

MonsterJumpComponent (Component)

MonsterKnockbackComponent (Component)

MonsterLightCullerComponent (Component)

MonsterMoveAttackComponent (Component)

MonsterMoveComponent (Component)

Implements low level movement behavior for monsters.

  • MonsterMoveComponent:getAnimationSpeed()
  • MonsterMoveComponent:getAnimations()
  • MonsterMoveComponent:getCooldown()
  • MonsterMoveComponent:getDashChance()
  • MonsterMoveComponent:getMoveBackwardAnimation()
  • MonsterMoveComponent:getMoveForwardAnimation()
  • MonsterMoveComponent:getResetBasicAttack()
  • MonsterMoveComponent:getSound()
  • MonsterMoveComponent:getStrafeLeft()
  • MonsterMoveComponent:getStrafeLeftAnimation()
  • MonsterMoveComponent:getStrafeRight()
  • MonsterMoveComponent:getStrafeRightAnimation()
  • MonsterMoveComponent:getTurnDir()
  • MonsterMoveComponent:setAnimationSpeed(number)
  • MonsterMoveComponent:setAnimations(anims)
  • MonsterMoveComponent:setCooldown(number)
  • MonsterMoveComponent:setDashChance(number)
  • MonsterMoveComponent:setMoveBackwardAnimation(string)
  • MonsterMoveComponent:setMoveForwardAnimation(string)
  • MonsterMoveComponent:setResetBasicAttack(boolean)
  • MonsterMoveComponent:setSound(string)
  • MonsterMoveComponent:setStrafeLeft(boolean)
  • MonsterMoveComponent:setStrafeLeftAnimation(string)
  • MonsterMoveComponent:setStrafeRight(boolean)
  • MonsterMoveComponent:setStrafeRightAnimation(string)
  • MonsterMoveComponent:setTurnDir(number)
  • MonsterMoveComponent:onBeginAction(self)
    Called when the monster is about to move
  • MonsterMoveComponent.onUnlinkMonsterGroup(self)

MonsterOperateDeviceComponent (Component)

MonsterPickUpItemComponent (Component)

MonsterStealWeaponComponent (Component)

MonsterTurnComponent (Component)

Implements low level turning behavior for monsters.

  • MonsterTurnComponent:getAnimationSpeed()
  • MonsterTurnComponent:getAnimations()
  • MonsterTurnComponent:getCooldown()
  • MonsterTurnComponent:getResetBasicAttack()
  • MonsterTurnComponent:getSound()
  • MonsterTurnComponent:getTurnAroundAnimation()
  • MonsterTurnComponent:getTurnLeftAnimation()
  • MonsterTurnComponent:getTurnRightAnimation()
  • MonsterTurnComponent:setAnimationSpeed(number)
  • MonsterTurnComponent:setAnimations(anims)
  • MonsterTurnComponent:setCooldown(number)
  • MonsterTurnComponent:setResetBasicAttack(boolean)
  • MonsterTurnComponent:setSound(string)
  • MonsterTurnComponent:setTurnAroundAnimation(anim)
  • MonsterTurnComponent:setTurnLeftAnimation(anim)
  • MonsterTurnComponent:setTurnRightAnimation(anim)
  • MonsterTurnComponent:onBeginAction(self)
    Called when the monster is about to turn.

MonsterWarpComponent (Component)

MosquitoSwarmBrainComponent (BrainComponent)

Implements AI for Mosquito Swarms.

NullComponent (Component)

ObstacleComponent (Component)

Blocks movement for party and monsters. Optionally prevents placing items into obstacle's square. Use the Health component to make the obstacle breakable.

  • ObstacleComponent:getBlockItems()
    Get whether items can be dropped to obstacle's square.
  • ObstacleComponent:getBlockMonsters()
    Get whether the obstacle blocks monster movement.
  • ObstacleComponent:getBlockParty()
    Get whether the obstacle blocks party movement.
  • ObstacleComponent:getHitEffect()
    Get particle effect to play when obstacle is hit.
  • ObstacleComponent:getHitSound()
    Get sound to play when obstacle is hit.
  • ObstacleComponent:getRepelProjectiles()
    Get whether impacted projectiles should be pushed out of obstacle's square.
  • ObstacleComponent:setBlockItems(boolean)
    Set whether items can be dropped to obstacle's square.
  • ObstacleComponent:setBlockMonsters(boolean)
    Set whether the obstacle blocks monster movement.
  • ObstacleComponent:setBlockParty(boolean)
    Set whether the obstacle blocks party movement.
  • ObstacleComponent:setHitEffect(string)
    Set particle effect to play when obstacle is hit.
  • ObstacleComponent:setHitSound(string)
    Set sound to play when obstacle is hit.
  • ObstacleComponent:setRepelProjectiles(boolean)
    Set whether impacted projectiles should be pushed out of obstacle's square.

OccluderComponent (Component)

OgreBrainComponent (BrainComponent)

Implements AI for Ogres.

ParticleComponent (Component)

Adds a particle effect to the GameObject. A single GameObject can have multiple Particle components.

  • ParticleComponent:fadeIn(time)
  • ParticleComponent:fadeOut(time)
  • ParticleComponent:getDebugDraw()
  • ParticleComponent:getDestroyObject()
    Get whether game object should be automatically destroyed when particle system is finished.
  • ParticleComponent:getDestroySelf()
    Get whether particle component should be automatically destroyed when particle system is finished.
  • ParticleComponent:getDisableSelf()
    Get whether particle component should be automatically disabled when particle system is finished.
  • ParticleComponent:getEmitterMesh()
  • ParticleComponent:getParticleSystem()
  • ParticleComponent:getSortOffset()
  • ParticleComponent:restart()
  • ParticleComponent:setDebugDraw(boolean)
  • ParticleComponent:setDestroyObject(boolean)
    Set whether game object should be automatically destroyed when particle system is finished.
  • ParticleComponent:setDestroySelf(boolean)
    Set whether particle component should be automatically destroyed when particle system is finished.
  • ParticleComponent:setDisableSelf(boolean)
    Set whether particle component should be automatically disabled when particle system is finished.
  • ParticleComponent:setEmitterMesh(modelFile)
  • ParticleComponent:setFadeOut(number)
  • ParticleComponent:setParticleSystem(name)
  • ParticleComponent:setSortOffset(offset)
  • ParticleComponent:start()
  • ParticleComponent:stop()

PartyComponent (Component)

The singular party component that holds the four champions. Champion's position in the party can change when party formation is changed. However champions can be identified with their ordinal number that never changes.

  • PartyComponent:getChampion(index)
  • PartyComponent:getChampionByOrdinal(ordinal)
  • PartyComponent:getMovementSpeed() Beta 2.2.4
  • PartyComponent:grapple(time)
  • PartyComponent:heal()
  • PartyComponent:isCarrying(string)
    Returns a boolean if the anyone in the party is carrying an object whose "name" is equal to the string passed in. This also includes if an object of that name is in a container held by the party.
  • PartyComponent:isClimbing()
  • PartyComponent:isFalling()
  • PartyComponent:isIdle() Beta 2.2.4
  • PartyComponent:isMoving()
  • PartyComponent:isResting()
  • PartyComponent:knockback(direction)
  • PartyComponent:move(direction) Beta 2.2.4
  • PartyComponent:playScreenEffect(filename)
  • PartyComponent:rest()
  • PartyComponent:setMovementSpeed() Beta 2.2.4
  • PartyComponent:shakeCamera(..., number)
  • PartyComponent:swapChampions(i, j)
  • PartyComponent:turn() Beta 2.2.4
  • PartyComponent:wakeUp(restInterrupted)
  • PartyComponent.onCastSpell(self, champion, spell)
    Called whenever a champion is about to successfully cast a spell (but not when they use a CastSpellComponent). Return false to cancel the spell.
  • PartyComponent.onClickItemSlot(self, champion, container, slot, button) Beta 2.2.4
    Called whenever the player clicks an item slot, either in the inventory menu or in the champion attack panels. Return false to cancel all effects of the click. This can be used to prevent champions from attacking or using items, or even stop them from moving items around in their inventories.
    champion: The champion that the item slot belongs to.
    container: If the item slot is in a ContainerItemComponent, this argument is that ContainerItemComponent, otherwise nil.
    slot: The number of the slot. For example, this will be equal to ItemSlot.Weapon if the player clicked on a champion's weapon slot, and will be 1 if they clicked on the first slot in a ContainerItemComponent.
    button: The mouse button that was clicked. 0 = primary button (pick up / set down item), 1 = middle button, 2 = secondary button (use item).
  • PartyComponent.onDamage(self, champion, damage, damageType)
    Called whenever a champion is about to take damage. Returning false will cancel the damage. Canceling the damage will not prevent monsters (or TileDamagerComponents) from inflicting wounds and other conditions, and the champion will still play their damage sound.
    damage: The amount of damage taken.
    damageType: The type of damage taken.
  • PartyComponent.onDie(self, champion)
    Called whenever a champion is about to die. Returning false will prevent the champion from dying, and set their health to 1 if it is below 1.
  • PartyComponent.onAttack(self, champion, action, slot)
    Called whenever a champion is about to attack with an item. This hook is not called when a champion attacks with their bare hands. Returning false will cancel the attack.
    action: The ItemActionComponent the champion is attacking with.
    slot: The slot the item is in, either ItemSlot.Weapon or ItemSlot.OffHand.
  • PartyComponent.onGetPortrait(self,champion) Beta 2.2.3
    Called whenever a champion's portrait is drawn. Return a filename to use it in place of the champion's normal portrait. For example: return "assets/textures/portraits/toorum.tga
    Return nothing to use the champion's regular portrait.
    Use this hook instead of Champion:setPortrait() if possible, as Champion:setPortrait() can cause memory leaks and has worse performance in general.
    Note that this hook is called even when the champion is in bear form! So you probably want to check whether champion:hasCondition("bear_form") before you return a custom portrait.
  • PartyComponent.onLevelUp(self, champion)
    Called after a champion gains a level. The return value of this hook is ignored; you cannot cancel the level up.
  • PartyComponent.onReceiveCondition(self, champion, condition)
    Called whenever a champion is about to receive a condition other than the level_up condition. Return false to cancel the condition. This hook is called after the onReceiveCondition hooks for traits and skills, and won't be called if one of those already returned false.
  • PartyComponent.onDrawAttackPanel(self, champion, context, x, y) Beta 2.2.4
    Called when drawing a champion's attack panel.
    champion: The champion whose attack panel is being drawn.
    context: A GraphicsContext (see the Objects and Classes page).
    x: The x position of the attack panel.
    y: The y position of the attack panel.
    Anything drawn with this hook will appear in front of the champion's health and energy bars and conditions, but behind items held in their hands.
    Unlike other draw hooks, onDrawAttackPanel will automatically scale anything you draw with it to fit with the scale of the built-in GUI elements. This may or may not be what you want. This also has the side effect of making the context.mouseX and context.mouseY fields nearly useless, but the context.button() method will still work fine.
  • PartyComponent.onDrawGui(self, context)
    Called after most of the built-in GUI is drawn, letting you draw your own elements on top of it.
  • PartyComponent.onDrawInventory(self, context, champion)
    Called after a champion's Inventory tab is drawn; not called if a champion's Inventory tab is not open.
  • PartyComponent.onDrawStats(self, context, champion)
    Called after a champion's Stats tab is drawn; not called if a champion's Stats tab is not open.
  • PartyComponent.onDrawSkills(self, context, champion)
    Called after a champion's Skills tab is drawn; not called if a champion's Skills tab is not open.
  • PartyComponent.onDrawTraits(self, context, champion)
    Called after a champion's Traits tab is drawn; not called if a champion's Traits tab is not open.
  • PartyComponent.onPickUpItem(self, item)
    Called when the player tries to pick up an item by clicking on it. Not called when a thrown projectile weapon is automatically picked up. Return false to cancel picking up the item.
  • PartyComponent.onProjectileHit(self, champion, item, damage, damageType)
    Called when the party is hit by a ProjectileItemComponent. Returning false will prevent any direct damage from a flying item, but the projecile will still drop to the ground (or explode).
  • PartyComponent.onRest(self)
    Called whenever the party is about to rest. Returning false will cancel the resting.
    Warning: Using a DiggingToolComponent or RopeToolComponent causes the party to rest, and if the onRest hook returns false to cancel this rest, saving the game will produce a broken save that crashes if loaded; this bug will persist until the party rests and wakes up normally. Therefore, before returning false from this hook, you must make absolutely sure that the rest did not come from DiggingToolComponent or RopeToolComponent.
  • PartyComponent.onWakeUp(self)
    Called whenever the party wakes up. Returning false will cancel the waking up, leaving them resting. Unlike the onRest hook, doing this when DiggingToolComponent or RopeToolComponent try to wake the party up will not break save games.
  • PartyComponent.onTurn(self, direction)
    Called whenever the party is about to turn. Not called for turns made by mouse-looking. Returning false will cancel the turn.
    direction: -1 for a left turn, or 1 for a right turn
    If you need to prevent turns entirely, you can use GameMode.setGameFlag("DisableMouseLook",true) in addition to this hook.
  • PartyComponent.onMove(self, direction)
    Called whenever the party is about to move. Returning false will cancel the move.

PitComponent (Component)

Implements pit mechanics for an object. Non-flying monsters, items and party fall down to level below if the pit is open.

  • PitComponent:close()
  • PitComponent:getState()
  • PitComponent:isClosed()
  • PitComponent:isOpen()
  • PitComponent:open()
  • PitComponent:setState(state)
  • PitComponent:toggle()

PlatformComponent (Component)

PoisonCloudAttackComponent (Component)

PoisonedMonsterComponent (Component)

Implements the poisoned condition for monsters. A monster with the poisoned condition is dealt ongoing poisoned damage until the effect's duration ends or the monster dies.

  • PoisonedMonsterComponent:getCausedByChampion()
  • PoisonedMonsterComponent:setCausedByChampion(number)

PortalComponent (Component)

  • PortalComponent.onArrival(self)

ProjectileColliderComponent (Component)

Defines the collision box for projectile-object collisions. Walls, doors, monsters and the party are implicitly projectile colliders and do not need ProjectileCollider components.

  • ProjectileColliderComponent:getCollisionGroup()
    Get collision group for filtering unwanted collisions. (default: 1)
  • ProjectileColliderComponent:getDebugDraw()
  • ProjectileColliderComponent:getSize()
  • ProjectileColliderComponent:setCollisionGroup(number)
    Set collision group for filtering unwanted collisions. (default: 1)
  • ProjectileColliderComponent:setDebugDraw(boolean)
  • ProjectileColliderComponent:setSize(size)

ProjectileComponent (Component)

Causes the object to fly towards its facing direction. When the projectile hits something its onProjectileHit hook is called.

  • ProjectileComponent:getAngularVelocity()
  • ProjectileComponent:getAttackPower()
    Get piggy back data for projectile attacks and spells.
  • ProjectileComponent:getCastByChampion()
  • ProjectileComponent:getCollisionMask()
    Get collision mask for filtering unwanted collisions. (default: 1)
  • ProjectileComponent:getDestroyOnImpact()
    Get destroy game object on impact.
  • ProjectileComponent:getFallingVelocity()
  • ProjectileComponent:getGravity()
  • ProjectileComponent:getHitEffect()
  • ProjectileComponent:getRadius()
  • ProjectileComponent:getSpawnOffsetY()
  • ProjectileComponent:getVelocity()
  • ProjectileComponent:pushForward()
  • ProjectileComponent:setAngularVelocity(number)
  • ProjectileComponent:setAttackPower(number)
    Set piggy back data for projectile attacks and spells.
  • ProjectileComponent:setCastByChampion(boolean)
  • ProjectileComponent:setCollisionMask(number)
    Set collision mask for filtering unwanted collisions. (default: 1)
  • ProjectileComponent:setDestroyOnImpact(boolean)
    Set destroy game object on impact.
  • ProjectileComponent:setFallingVelocity(number)
  • ProjectileComponent:setGravity(number)
  • ProjectileComponent:setHitEffect(string)
  • ProjectileComponent:setIgnoreEntity(ent, time)
    The time parameter is the number of in-game seconds to ignore the entity for; after that time passes, the ProjectileComponent will be able to hit the entity. It is optional and defaults to 0.7.
  • ProjectileComponent:setRadius(number)
  • ProjectileComponent:setSpawnOffsetY(number)
  • ProjectileComponent:setVelocity(number)
  • ProjectileComponent.onProjectileHit(self, what, entity)

ProjectileImpactComponent (Component)

Implements custom hit reaction for a projectile hit. This component is obsolete and not used by the main campaign. Use an onProjectileHit hook in the Projectile component instead.

  • ProjectileImpactComponent.onHitEntity(self, entity)
  • ProjectileImpactComponent.onHitMonster(self, monster)
  • ProjectileImpactComponent.onHitParty(self, party)

PullChainComponent (Component)

PushableBlockComponent (Component)

Implements pushable block mechanics for an object. The pushable block must be activated and it can only be pushed to squares with pushable block floors.

  • PushableBlockComponent:activate()
  • PushableBlockComponent:deactivate()
  • PushableBlockComponent:push(dir)

PushableBlockFloorComponent (Component)

Implements custom floor trigger for pushable blocks.

  • PushableBlockFloorComponent:activate()
  • PushableBlockFloorComponent:deactivate()
  • PushableBlockFloorComponent:getInitialState()
  • PushableBlockFloorComponent:isActivated()
  • PushableBlockFloorComponent:setInitialState(boolean)
  • PushableBlockFloorComponent:toggle()

RangedAttackComponent (ItemActionComponent)

Implements missile attack action for items. Missile attacks require ammo that must be held in champion's other hand.

  • RangedAttackComponent:getAmmo()
  • RangedAttackComponent:getAttackPower()
  • RangedAttackComponent:getAttackSound()
  • RangedAttackComponent:getBaseDamageStat()
    Get base statistic used for computing damage modifier. (default: "dexterity")
  • RangedAttackComponent:getDamageType()
    Get damage type of the attack: "physical" (default), "cold", "fire", "poison" or "shock"
  • RangedAttackComponent:getProjectileItem()
    Get (optional) projectile item type that ammo is converted to when shot.
  • RangedAttackComponent:getRequiredLevel()
  • RangedAttackComponent:getSkill()
  • RangedAttackComponent:getSwipe()
  • RangedAttackComponent:setAmmo(string)
  • RangedAttackComponent:setAttackPower(number)
  • RangedAttackComponent:setAttackSound(string)
  • RangedAttackComponent:setBaseDamageStat(string)
    Set base statistic used for computing damage modifier. (default: "dexterity")
  • RangedAttackComponent:setDamageType(string)
    Set damage type of the attack: "physical" (default), "cold", "fire", "poison" or "shock"
  • RangedAttackComponent:setProjectileItem(string)
    Set (optional) projectile item type that ammo is converted to when shot.
  • RangedAttackComponent:setRequiredLevel(number)
  • RangedAttackComponent:setSkill(string)
  • RangedAttackComponent:setSwipe(string)
  • RangedAttackComponent.onPostAttack(self, champion, slot)

RangedBrainComponent (BrainComponent)

Implements AI for generic (stupid) ranged monsters.

RatlingBossBrainComponent (BrainComponent)

Implements AI for the Ratling Boss.

ReloadFirearmComponent (Component)

RopeToolComponent (Component)

RunePanelComponent (Component)

ScriptComponent (Component)

Custom Lua script component. The script code may be embedded inside the component or in an external file.

  • ScriptComponent:loadFile(filename)
  • ScriptComponent:setSource(source)

ScriptControllerComponent (Component)

ScrollItemComponent (Component)

Displays a piece of text or an image in item's tooltip.

  • ScrollItemComponent:getScrollImage()
    Get image shown when the scroll is examined.
  • ScrollItemComponent:getScrollText()
    Get text shown when the scroll is examined.
  • ScrollItemComponent:getTextAlignment()
    Get text alignment, "center" or "left"
  • ScrollItemComponent:setScrollImage(string)
    Set image shown when the scroll is examined.
  • ScrollItemComponent:setScrollText(string)
    Set text shown when the scroll is examined.
  • ScrollItemComponent:setTextAlignment(string)
    Set text alignment, "center" or "left"

SecretComponent (Component)

Implements secret mechanics for an object. When the secret component is activated, it playes the secret found sound and increments the "secrets_found" statistics. Each secret can be triggered only once.

  • SecretComponent:activate()

SkeletonArcherBrainComponent (BrainComponent)

Implements AI for Skeleton Archers.

SkeletonCommanderBrainComponent (BrainComponent)

Implements AI for Skeleton Commanders.

SkyComponent (Component)

Placing an object with Sky component into a level makes it an outdoor level. Rendering parameters such as view distance and fog are set for outdoor rendering. The Sky component animates the light component attached to the same object to simulate day-night cycle. There should be only one Sky per level.

  • SkyComponent:getAmbientIntensity()
  • SkyComponent:getFarClip()
  • SkyComponent:getFogColor1()
  • SkyComponent:getFogColor2()
  • SkyComponent:getFogColor3()
  • SkyComponent:getFogMode()
  • SkyComponent:getFogRange()
  • SkyComponent:getSunColor1()
  • SkyComponent:getSunColor2()
  • SkyComponent:getSunColor3()
  • SkyComponent:getTonemapSaturation()
  • SkyComponent:setAmbientIntensity(number)
    To get the final brightness of the ambient light, the ambient LightComponent's brightness attribute is multiplied by the sky's ambientIntensity attribute.
  • SkyComponent:setFarClip(number)
  • SkyComponent:setFogColor1(vec)
  • SkyComponent:setFogColor2(vec)
  • SkyComponent:setFogColor3(vec)
  • SkyComponent:setFogMode(string)
    Must be one of "dense", "exp", "linear", "linear_lit". linear_lit is the default.
  • SkyComponent:setFogRange(table)
    Format: {start,end}. The default is {5, 300}, meaning that fog begins at 5 meters from the camera and reaches full opacity at 300 meters from the camera. Set both values to the same number, e.g. {1,1}, to disable fog entirely.
  • SkyComponent:setSunColor1(vec)
  • SkyComponent:setSunColor2(vec)
  • SkyComponent:setSunColor3(vec)
  • SkyComponent:setTonemapSaturation(number)
    Multiplies the saturation of all colors on the sky's level. Negative values (hue inversion) are supported. RGB values are clamped, so numbers greater than 1 or less than -1 are okay.

SleepingMonsterComponent (Component)

SlimeBrainComponent (BrainComponent)

Implements AI for Slimes.

SmallFishControllerComponent (Component)

SocketComponent (Component)

An attachment point for items. Wall hooks, sconces, statue's hand could be sockets. A socket can hold a single item.

  • SocketComponent:addItem(item)
  • SocketComponent:count()
  • SocketComponent:getDebugDraw()
  • SocketComponent:getItem()
  • SocketComponent:setDebugDraw(boolean)
  • SocketComponent.onInsertItem(self, item)
  • SocketComponent.onRemoveItem(self, item)
  • SocketComponent.onAcceptItem(self, item)

SoundComponent (Component)

Dynamic sound source. A single GameObject can have multiple Sound components.

  • SoundComponent:fadeIn(time)
  • SoundComponent:fadeOut(time)
  • SoundComponent:getPitch()
  • SoundComponent:getSound()
  • SoundComponent:getSoundType()
  • SoundComponent:getVolume()
  • SoundComponent:play(sound)
  • SoundComponent:setPitch(number)
    The pitch is a multiplier for the speed of the sound; a pitch of 1.5 will play the sound at 150% of its normal speed. The maximum pitch is 2 (double speed); higher values will have the same effect as 2.
  • SoundComponent:setSound(name)
  • SoundComponent:setSoundType(type)
    Must be either "point" or "ambient". "point" is the default and makes the SoundComponent emit a 3D sound at its location. "ambient" makes the SoundComponent play a 2D sound, which will be the same volume regardless of location. You must use "ambient" for stereo sounds.
  • SoundComponent:setVolume(number)
    Negative volumes (phase inversion) are supported.
  • SoundComponent:stop()

SpawnerComponent (Component)

A Spawner dynamically spawns a new object when it's activate method is called. After spawning an object the spawner goes into cooldown. After the cooldown time has elapsed, the spawner can be activated again.

  • SpawnerComponent:activate()
  • SpawnerComponent:getCooldown()
  • SpawnerComponent:getDisableSelf()
  • SpawnerComponent:getMonsterLevel()
  • SpawnerComponent:getSpawnedEntity()
  • SpawnerComponent:setCooldown(number)
  • SpawnerComponent:setDisableSelf(boolean)
  • SpawnerComponent:setMonsterLevel(number)
  • SpawnerComponent:setSpawnedEntity(string)
  • SpawnerComponent.onActivate(self)

SpellScrollItemComponent (Component)

Displays the gesture and information about a spell in item's tooltip.

  • SpellScrollItemComponent:getSpell()
  • SpellScrollItemComponent:setSpell(string)

StairsComponent (Component)

Transports the party and thrown items to another location in the game world. The target can be either a level below to above (set with setDirection method) or any location (set with setTeleportTarget).

  • StairsComponent:getDirection()
  • StairsComponent:getTeleportTarget()
  • StairsComponent:setDirection(string)
  • StairsComponent:setTeleportTarget(level, x, y, elevation)

StatisticsComponent (Component)

StonePhilosopherControllerComponent (Component)

StunnedMonsterComponent (Component)

SurfaceComponent (Component)

A support for placing items. Altars, alcoves and chests are typically surfaces.

  • SurfaceComponent:addItem(item)
  • SurfaceComponent:contents()
    Returns an iterator function of iterate index and object (like ipairs). Each object on the surface will be returned. NOTE: You must use the go property to access the components (i.e. entity.go.surface)
  • SurfaceComponent:count()
  • SurfaceComponent:getDebugDraw()
  • SurfaceComponent:getSize()
    Warning: Unlike most functions that return a vector, getSize() returns the original vector and not a copy. If you change the vector returned by SurfaceComponent:getSize(), you will change the size of the surface, even if you don't call setSize() afterwards. If you need a copy, you can make one by calling table.deepcopy(surface:getSize()).
  • SurfaceComponent:setDebugDraw(boolean)
  • SurfaceComponent:setSize(vec)
  • SurfaceComponent.onAcceptItem(self, item) Beta 2.2.4
  • SurfaceComponent.onInsertItem(self, item)
  • SurfaceComponent.onRemoveItem(self, item)

SwarmBrainComponent (BrainComponent)

Implements AI for swarm monsters.

TeleporterComponent (Component)

Transports the party, monsters, items and spells to another location in the game world.

  • TeleporterComponent:getSpin()
  • TeleporterComponent:getTeleportTarget()
    As of 2.2.4: Returns multiple values: level, x, y, elevation
  • TeleporterComponent:getTriggeredByItem()
  • TeleporterComponent:getTriggeredByMonster()
  • TeleporterComponent:getTriggeredByParty()
  • TeleporterComponent:getTriggeredBySpell()
  • TeleporterComponent:setSpin(spin)
  • TeleporterComponent:setTeleportTarget(level, x, y, elevation)
  • TeleporterComponent:setTriggeredByItem(boolean)
  • TeleporterComponent:setTriggeredByMonster(boolean)
  • TeleporterComponent:setTriggeredByParty(boolean)
  • TeleporterComponent:setTriggeredBySpell(boolean)

TentacleBrainComponent (BrainComponent)

Implements AI for Tentacles.

TentacleHideComponent (Component)

ThornWallComponent (Component)

ThrowAttackComponent (ItemActionComponent)

Implements throw attack action for items. When thrown, a Projectile component is dynamically created and added to the thrown item.

  • ThrowAttackComponent:getAttackPower()
  • ThrowAttackComponent:getAttackSound()
  • ThrowAttackComponent:getBaseDamageStat()
    Get base statistic used for computing damage modifier. (default: "strength")
  • ThrowAttackComponent:getRequiredLevel()
  • ThrowAttackComponent:getSkill()
  • ThrowAttackComponent:getSwipe()
  • ThrowAttackComponent:setAttackPower(number)
  • ThrowAttackComponent:setAttackSound(string)
  • ThrowAttackComponent:setBaseDamageStat(string)
    Set base statistic used for computing damage modifier. (default: "strength")
  • ThrowAttackComponent:setRequiredLevel(number)
  • ThrowAttackComponent:setSkill(string)
  • ThrowAttackComponent:setSwipe(string)
  • ThrowAttackComponent.onPostAttack(self, champion, slot)
    This hook is called immediately after the item has been thrown. It cannot be used to cancel the throw; use the onAttack hook (inherited from ItemActionComponent) instead.

TileDamagerComponent (Component)

A TileDamager damages party, monsters and obstacles in the same square when activated. TileDamagers can be one shot or cause damage as long as the target stays in the same space.

  • TileDamagerComponent:getAttackPower()
    Get strength of the attack.
  • TileDamagerComponent:getCameraShake()
    Get whether camera should be shaked when party is hit.
  • TileDamagerComponent:getCastByChampion()
    Get champion ordinal if the spell was cast by a champion.
  • TileDamagerComponent:getDamageFlags()
    Get special damage flags.
  • TileDamagerComponent:getDamageType()
    Get damage type of the attack: "physical", "fire", "cold", "shock", or "poison"
  • TileDamagerComponent:getDestroyObject()
    Get whether the game object with burst spell component should be destroyed when component is triggered.
  • TileDamagerComponent:getRepeatCount()
  • TileDamagerComponent:getRepeatDelay()
  • TileDamagerComponent:getScreenEffect()
    Get name of the on-screen particle effect to play when party is hit.
  • TileDamagerComponent:getSound()
    Get name of the sound effect to play.
  • TileDamagerComponent:setAttackPower(number)
    Set strength of the attack.
  • TileDamagerComponent:setCameraShake(boolean)
    Set whether camera should be shaked when party is hit.
  • TileDamagerComponent:setCastByChampion(number)
    Set champion ordinal if the spell was cast by a champion.
  • TileDamagerComponent:setDamageFlags(number)
    Set special damage flags.
  • TileDamagerComponent:setDamageType(string)
    Set damage type of the attack: "physical", "fire", "cold", "shock", or "poison"
  • TileDamagerComponent:setDestroyObject(number)
    Set whether the game object with burst spell component should be destroyed when component is triggered.
  • TileDamagerComponent:setRepeatCount(number)
  • TileDamagerComponent:setRepeatDelay(number)
  • TileDamagerComponent:setScreenEffect(string)
    Set name of the on-screen particle effect to play when party is hit.
  • TileDamagerComponent:setSound()
    Set name of the sound effect to play.
  • TileDamagerComponent.onHitChampion(self, champion)
    If this hook returns false, the champion won't be hit.
  • TileDamagerComponent.onHitMonster(self, monster)
    If this hook returns false, the monster won't be hit.
  • TileDamagerComponent.onHitObstacle(self, obstacle) If this hook returns false, the obstacle won't be hit.

TimerComponent (Component)

Timer component triggers its onActivate hook periodically. The timer inverval or period can be customized. Timers can act in one shot mode (disable self set) or running mode (disable self not set). A timer will activate at most once per update. A timer with an interval of 0 will activate once every time its level updates. The level the party is currently on always updates once per frame; other levels update slower. Timers only count down while enabled.

  • TimerComponent:getCurrentLevelOnly()
  • TimerComponent:getDisableSelf()
  • TimerComponent:getTimerInterval(number)
  • TimerComponent:getTriggerOnStart()
  • TimerComponent:pause()
  • TimerComponent:setCurrentLevelOnly(boolean)
    If set to true, the timer will only count down while the party is on its level.
  • TimerComponent:setDisableSelf(boolean)
    If set to true, the timer will disable itself upon activating.
  • TimerComponent:setTimerInterval(number)
  • TimerComponent:setTriggerOnStart(boolean)
    If set to true, the timer will activate when it is started, as well as when it reaches 0.
  • TimerComponent:start()
  • TimerComponent:stop()
  • TimerComponent.onActivate(self)

TinyCritterControllerComponent (Component)

Implements the animation and behavior of tiny critters such as beach crabs.

  • TinyCritterControllerComponent:getSpeed()
    Get speed.
  • TinyCritterControllerComponent:getStrafing()
    Get strafing (true or false)
  • TinyCritterControllerComponent:setSpeed(number)
    Set speed.
  • TinyCritterControllerComponent:setStrafing(boolean)
    Set strafing (true or false)

ToadBrainComponent (BrainComponent)

Implements AI for Swamp Toads.

TorchHolderControllerComponent (Component)

Controller for torch holders. Requires Socket, Light, Sound and Particle components. The controller automatically spawns a new torch at the start of a new game and places it into the Socket component.

  • TorchHolderControllerComponent:getHasTorch()
  • TorchHolderControllerComponent:setHasTorch(boolean)

TorchItemComponent (Component)

Makes an item a torch that burns until it runs out of fuel.

  • TorchItemComponent:getFuel()
    Get fuel for torches and other light sources.
  • TorchItemComponent:setFuel(number)
    Set fuel for torches and other light sources.

TricksterBrainComponent (BrainComponent)

Implements AI for the Trickster.

  • TricksterBrainComponent:setState(state)
  • TricksterBrainComponent.onThinkSpecial(self)

TurtleBrainComponent (BrainComponent)

Implements AI for Turtles.

TwigrootBrainComponent (BrainComponent)

Implements AI for Twigroots.

UggardianBrainComponent (BrainComponent)

Implements AI for Uggardians.

UggardianFlamesComponent (Component)

A flaming special effect for creatures. Requires Model component.

  • UggardianFlamesComponent:getEmitFromMaterial()
  • UggardianFlamesComponent:getParticleSystem()
  • UggardianFlamesComponent:setEmitFromMaterial(string)
    If set to "", will emit from all materials. Do not include * in the string otherwise, because any other string containing "" (even "**") will cause the game to crash.
  • UggardianFlamesComponent:setParticleSystem(string)
  • UggardianFlamesComponent:stop()

UsableItemComponent (Component)

Makes an item Usable by right-clicking on it.

  • UsableItemComponent:getCanBeUsedByDeadChampion()
  • UsableItemComponent:getEmptyItem()
  • UsableItemComponent:getNutritionValue()
    Get nutrition value, i.e. how much food is restored when item is consumed (range 0-1000)
  • UsableItemComponent:getRequirements()
  • UsableItemComponent:getSound()
    Get sound to play when item is consumed.
  • UsableItemComponent:setCanBeUsedByDeadChampion(boolean)
  • UsableItemComponent:setEmptyItem(string)
  • UsableItemComponent:setNutritionValue(number)
    Set nutrition value, i.e. how much food is restored when item is consumed (range 0-1000)
  • UsableItemComponent:setRequirements(table)
  • UsableItemComponent:setSound(string)
    Set sound to play when item is consumed.
  • UsableItemComponent.onUseItem(self, champion)
    If this hook returns false, the item will not be destroyed when used, its nutritionValue will not be applied, and its sound will not play.

ViperRootBrainComponent (BrainComponent)

Implements AI for Viper Roots.

WallTextComponent (Component)

Displays a piece of text in the center of the screen when the object is clicked on. Requires Clickable component.

  • WallTextComponent:getHeight()
  • WallTextComponent:getWallText()
  • WallTextComponent:setHeight(number)
  • WallTextComponent:setWallText(string)
  • WallTextComponent.onShowText(self)
  • WallTextComponent.onDismissText(self)

WallTriggerComponent (Component)

A wall trigger is activated when a projectile hits a wall in the wall trigger's square. The wall needs to have same facing as the wall trigger. When activated the wall trigger fires its onActivate hooks and connectors.

  • WallTriggerComponent:getEntityType()
  • WallTriggerComponent:setEntityType(string)
    If set to "any", the WallTriggerComponent will be activated by any projectile.
  • WallTriggerComponent.onActivate(self, entity)

WargBrainComponent (BrainComponent)

Implements AI for the Wargs.

WaterSurfaceComponent (Component)

Updates the reflection buffer of a water object. There should be max one water surface component per level. Water reflection is very heavy on performance so use it wisely.

  • WaterSurfaceComponent:getFogColor()
  • WaterSurfaceComponent:getFogDensity()
  • WaterSurfaceComponent:getPlaneY()
  • WaterSurfaceComponent:getReflectionColor()
  • WaterSurfaceComponent:getRefractionColor()
  • WaterSurfaceComponent:setFogColor(vec)
  • WaterSurfaceComponent:setFogDensity(number)
  • WaterSurfaceComponent:setPlaneY(number)
    Set the height of the reflection plane. This only changes the height of the plane about which the view is reflected. If you also want to change the height of the water mesh, use Component:setOffset() on the WaterSurfaceMeshComponent or ModelComponent.
  • WaterSurfaceComponent:setReflectionColor(vec)
  • WaterSurfaceComponent:setRefractionColor(vec)

WaterSurfaceMeshComponent (Component)

Collects all water tiles in the level and creates an animated mesh covering all the tiles.

  • WaterSurfaceMeshComponent:getMaterial()
  • WaterSurfaceMeshComponent:getUnderwaterMaterial()
  • WaterSurfaceMeshComponent:getWaterLevel()
    Returns the world Y position of the mesh.
  • WaterSurfaceMeshComponent:setMaterial(string)
  • WaterSurfaceMeshComponent:setUnderwaterMaterial(string)

WizardBrainComponent (BrainComponent)

Implements AI for the Wizard.

XeloroidBrainComponent (BrainComponent)

Implements AI for Xeloroids.

ZarchtonBrainComponent (BrainComponent)

Implements AI for Zarchtons.

Clone this wiki locally