keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

Lua add events

Open PieterVdc opened this issue 6 months ago • 3 comments

just making longer list of events that I'll implement in a single pr later on, as that's less work then making prs for each OnTrapTriggered, OnDoorDamaged, OnDoorLocked

PieterVdc avatar Jun 23 '25 19:06 PieterVdc

  • on trap depleted
  • on trap rearming
  • on trap charged
  • on door opened

Loobinex avatar Jun 23 '25 19:06 Loobinex

  • OnThingRemoved return thing to detect destruction or any other removal

  • OnThingCreated return thing useful entry point for setup we may want to do on dynamically spawned things and creatures also lets us check for summons, temple rewards, etc maybe even manipulate shots?

  • OnThingDropped return thing iirc OnPowerCast can detect slaps and pickups, right? but we can't yet detect when you drop a thing?

  • OnThingSacrificed return thing for custom temple interactions maybe together with commands to manipulate the active temple ingredients list (to reset when the custom scripted recipe has been fulfilled)

  • OnThingSold / OnSlabSold return thing, gold (override?) more specific form of removal, could override sell value based on trap shots remaining or something

  • OnCreatureSpellUsed return creature, spell opens the door to all sorts of custom abilities

  • OnCreatureStateEntered return creature, state for checking if something specific is happening to a creature or what job they started doing

  • OnCreatureBuffGained / OnCreatureBuffLost return creature, buff to detect spell effects such as Speed, Slow, Freeze, Protect, etc

  • OnGameOver return bool victory for stuff that should happen or stop when the game is over

  • OnKeyboardPress return key... as... string? for custom hotkeys, or WASD movement, etc

Trotim avatar Jun 26 '25 10:06 Trotim

  • OnShotHitOther return shot, thing Other if exists for scripting the effects of custom creature abilities and projectiles

Trotim avatar Jul 23 '25 14:07 Trotim