Skip to content

CwlOnCreateEvent

Namespace: Cwl.Patches.Sources;

Event raised when a Card is created in the game. You need to use the derived attributes CwlCharaOnCreateEvent or CwlThingOnCreateEvent to register the events for when the game instantiates Chara and Thing, respectively.

CwlThingOnCreateEvent

cs
[CwlThingOnCreateEvent]
internal static void OnThingSpawned(Thing thing)
{
    if (thing.id == "some_item") {
        // do stuff
    }
}

CwlCharaOnCreateEvent

cs
[CwlCharaOnCreateEvent]
internal static void OnCharaInstantiation(Chara chara)
{
    if (chara.id == "chicken") {
        chara.Destroy();
    }
}

This project is an unofficial documentation site and is not affiliated with, endorsed by, or associated with Elin or Lafrontier / Noa. All trademarks are the property of their respective owners.