tld_AmqvSP5wF4.mp4
tld_r9IgAZx37c.mp4
tld_vli8NtM43n.mp4
tld_WLgwI732aL.mp4
The API provides a easy way to add new examine actions (like harvest/repair/sharpen) to the game The Long Dark.
It's a very flexible framework, a lot of options can be combined to design custom actions that have totally dynamic behaviors according to what is being examined, what tools is selected... etc.
It can even be used to create a fully fledged crafting system.
Things To Do is a mod which is initially made to showcase the features of ExamineActionsAPI, but eventually included actual gameplay features.
Please refer to its readme for more information.
The API supports auto registering actions in json files. (Examples)
To supply action definition jsons, compress them into a zip file named as eaapi
files (for example: mymod.eaapi
), then put the zip into Mods
folder.
Start by implementing IExamineAction
on your action class, once all the required properties are implemented, it's good to go. Call ExamineActionsAPI.Regsiter()
to regsiter the action.
Please refer to action implementations in ThingsToDo for practical examples.
- The core interface, any class implementing this can be registered
- Without implementing other interfaces, the action will always success and be finished
- Only exception is the action is forcefully interrupted in situations like wolf attacks
- Action menu name & sprite, button text and progress audio can be customized.
- Additional interfaces below can be implemented to introduce various mechanics to the action.
- Setup what are required (and to be consumed) for the action
- The parameters of each:
- Name of the gear ("GEAR_???")
- How many units to consume
- The chance the maaterial is consumed, ranging from 0 to 100
- Edge case: Subject and Materials are same type of gears
- The subject item/stack is always ignored/excluded in the material check and consumation.
- For example, you are examine a stack of 99 sticks, even if the action only requires 1 sticks, it can't be performed because the stack of 99 sticks is excluded.
- Supports up to 5 in total of items/liquid/powder
- The parameters of each:
- Name of the gear ("GEAR_???")
- How many units to produce
- The chance the product is yieled, ranging from 0 to 100.
- Supports up to 5 in total of items/liquid/powder
- The parameters of each:
- Type object of the liquid
- Use references in
PowderAndLiquidTypesLocator
if you want to use official types
- Use references in
- How many liters to consume
- The chance these liquid is consumed, ranging from 0 to 100
- Type object of the liquid
- Supports up to 5 in total of items/liquid/powder
- The parameters of each:
- Type object of the liquid
- Use references in
PowderAndLiquidTypesLocator
if you want to use official types
- Use references in
- How many liters to produce
- The chance these liquid is produced, ranging from 0 to 100
- Type object of the liquid
- Supports up to 5 in total of items/liquid/powder
- The parameters of each:
- Type object of the powder
- Use references in
PowderAndLiquidTypesLocator
if you want to use official types
- Use references in
- How many kilograms to consume
- The chance these powder is consumed, ranging from 0 to 100
- Type object of the powder
- Supports up to 5 in total of items/liquid/powder
- The parameters of each:
- Type object of the powder
- Use references in
PowderAndLiquidTypesLocator
if you want to use official types
- Use references in
- How many kilograms to produce
- The chance these powder is produced, ranging from 0 to 100
- Type object of the powder
- Make the action possible to fail by chance (0 ~ 100)
- You can control should the subject to be still consumed on a failure
- Make the action possible to be interrupted due to light/conditions/afflictions...
- You can control should the subject to be still consumed on a interruption
- Make the action can be cancelled by players
- You can control should the subject to be still consumed on a cancellation
- Make the action requires tool to be performed.
- You can also scale how much condition to be reduced on the tool.
- Display up to 3 information like how the duration/chance is shown.
- While the panel can display up to 4 information blocks, one is always occupied by the action time. If the action implements interfaces that automatically display related info, the blocks provided later may not be displayed.
- Apply additional constraints to the action, like weather, time... or even requires the player to looking at some specific object...
- Define dependencies required for the action to be registered, so it's easier to work with modded content.