Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lua Events

To make modding with Depraved Sense easier, the framework has a ton of Lua events in store for other modders to use. Here’s the list of them.

Shared Events

Shared events are events that are triggered both on Client, and Server.

OnGraphLoaded

Triggered when the graph finishes loading.

Parameters

NameTypeNotes
graphDS_GraphManagerThe graph itself

Client Events

Events that are only triggered on the Client or Singleplayer.

OnCharacterEnteredBus

Triggered when a character enters an AnimBus.

Parameters

NameTypeNotes
characterIsoGameCharacterThe character entering the bus

OnCharacterExitedBus

Triggered when a character exits an AnimBus.

Parameters

NameTypeNotes
characterIsoGameCharacterThe character exiting the bus

OnDepravedDataModified

Triggered when the DepravedData of a character has been altered. Often by syncing the data from the Server.

Parameters

NameTypeNotes
dataDS_DepravedDataThe DepravedData module
characterIsoGameCharacterThe character who had its data updated

OnPlayerBitten

Triggered when a player was bitten. This is right before the damage is applied, but nothing will avoid the vanilla logic. if you want to change the logic itself, check media/lua/shared/DepravedSense/AnimEvents/zombie/OnZombieAttack.lua

Parameters

NameTypeNotes
playerIsoPlayerThe player that is being bitten

OnCharacterHasClimaxed

Triggered when a character climaxes.

Parameters

NameTypeNotes
characterIsoGameCharacterThe character who climaxed

Server Events

OnAnimBusCreated

Triggered when an AnimBus is created.

Parameters

NameTypeNotes
animbusDS_AnimBusThe AnimBus itself

OnAnimBusUpdated

Triggered when an AnimBus is updated.

Parameters

NameTypeNotes
animbusDS_AnimBusThe updated AnimBus

OnAnimBusRemoved

Triggered when an AnimBus is removed from the BusManager.

Parameters

NameTypeNotes
animbusDS_AnimBusThe AnimBus itself

OnActorForcedRemoval

Triggered when an Actor is forced out of an AnimBus. Often by external sources.

Parameters

NameTypeNotes
animbusDS_AnimBusThe AnimBus itself
actorDS_AnimActorThe actor that was forced out

Calling The Events

In order to call these events, it is necessary to require the enum storing the events names. For example, this is how you would add an event call on the Server:

local ServerEvents = require("DepravedSense/Events/ServerEvents")

---@param animbus DS_AnimBus
local function cool_function(animbus)
	-- CODE!
end

-- Attention with the "[]"!

Events[ServerEvents.OnAnimBusCreated].Add(cool_function)