FORGOTTEN TOWNS

FORGOTTEN TOWNS / DOCUMENTAÇÃO DE MODIFICAÇÃO

Wiki de modificação ↗

Java Referência da API (Javadoc)

MOD API 15

Navegue na wiki

Documentação atual da Mod API.

A documentação técnica está disponível em inglês. O código e os nomes dos campos seguem a API Mod atual.

DOCUMENTAÇÃO DE MODIFICAÇÃO

Memorials

A standalone Java example with no mod dependencies. A citizen death posts a localized, clickable native notification and starts a small mourning mood for surviving citizens. The deadline is stored inside the game save. Loading a save restores the mood without repeating the death notice. All code uses only JDK classes and forgottentowns.mod.api; player-facing text has thirteen translations.

Build and install

From the source repository:

.\gradlew.bat --no-daemon assembleMemorialsMod

The result is build/mods/memorials/. Or, from the extracted SDK root:

.\examples\mod-sdk\build-mod.ps1 -Project .\examples\memorials-mod -ApiJar .\build\mod-sdk\forgotten-towns-mod-api-15.jar -OutputDirectory .\memorials-build

Install only the resulting memorials runtime folder into the game's mods directory. Enable it, choose Apply & reload. Use a disposable test world when experimenting with death events. The example is not enabled by building the SDK and requires no source changes to the game.

Settings and behavior

Edit settings.json before validation/restart:

Setting Default Accepted range
mourningDays 2 Integer 1-12 game days
mourningRate -0.25 Happiness per game minute from -5 to 0; zero disables the mood

A death sets the deadline to at least the event day plus mourningDays. This uses calendar day boundaries rather than an exact number of hours from the event. Another death can extend the same deadline; it does not add another penalty. Changing settings does not rewrite a saved deadline. The mood uses stacking key bereavement so another source choosing that key can share the native strongest-effect rule. Normal food, weather and other moods still apply.

The example follows CitizenDied, including temporary friendly actors and heroes. Immediate native resurrection prevents that event; a later resurrection does not undo an already-started mourning period. Historical deaths and restored corpses do not create notices. A burst is subject to the host's eight-notice-per-mod-per-minute limit; mourning still updates when a notice is throttled.

Save schema 1 contains only schema and untilDay. The sample rejects unknown schemas instead of silently erasing state. It does not create graves, intercept damage or poll every citizen for deaths.

Read the events and notifications guide for all event types, delivery order, notification bounds and save semantics.