DYSMANTLE
0 of 0

File information

Last updated

Original upload

Created by

MoleEater

Uploaded by

MoleEater1

Virus scan

Safe to use

Tags for this mod

About this mod

For developers, level-designer modders, it gives you an NPC who can enchant the player's tools with random permanent buffs.

Permissions and credits
Changelogs


NPCs appear on stage reset, standing on every large tractor tyre (there is one right at the beginning of the game). They start to wander off by themselves.
Interact with the NPC to open the custom UI overlay.
The buffs are applied to the tool currently held in the player's hand. It is applied to player 2 too, if he uses the same weapon.
The player gets to choose from 3 random buffs, the 3 generated buffs are stored for every NPC, so the player can not cheese the randomness.
The buffs that can be applied are the standard item modifiers by 10tons (examples: heat protection, fishing speed, build limit).
Because not every modifier makes sense for this application, you need to specify the list of allowed modifiers. There are 3 layers of allowed modifiers: general, or by specific npc, or by specific item. This way you can put modifiers which makes sense for every tool, into general, and you can put modifers which you want to be specific to one of the NPC into his config, and same goes for the items.
The files are:
- mods/mod-buffs-config.nut for general
- actors/mods/{npc}-buffs.nut for actors, but this can be a different file for every instance of the same actor type
- items/tools/utils/{item}-buffs.nut for the items
The modifier can have an exact value (all values must be integers, floats are NOT allowed!), or a random number within a range specified by a maximum and an optional minimum (if unspecified, defaults to 1).
The functions in the config files get passed a reference to the npc actor and the id of the item, so you can return an even more detailed buff list if you want.
Items have 2 new metadata entries: mod_buffs_enabled must always exists with the value true, for the item to work. This is because the code can not check if the OnEquipped function is modified in the item script or not. mod_buffs_config specifies the item config script described above.
NPCs can be any actor types in the game, you just need to give it the mod_buffs interaction and the 11+ custom key values, and the PERSISTENT_STATE tag and the PERMANENT_KEY_VALUES persistency_flag.
The name of the NPC and their dialogue are stored in the actor custom key values, so every instance of even the same actor type can say different dialogues, and can give different buffs.
Items can be blacklisted by NPC, so one NPC can enchant just slashing weapons, while the other just the fishing pole.
NPCs can be limited to allow only 1 enchant at all, or can be limited to allow only 1 enchant per weapon.