Facts
Facts are essentially variables. They store information that can be modified by other entries. All facts are numbers and are treated as such.
The Basic Adapter
encompasses numerous facts available for use. However, it's important to note that adapters
have the capability to further augment the array of available facts.
Why Use Facts?
Facts play a crucial role in dynamic content creation and system behavior customization. Here are some reasons to consider using facts:
-
Dynamic Quests: Track player progress in quests by using facts to store and modify completion status.
-
Customization: Personalize player experiences by utilizing facts to adjust in-game parameters, such as difficulty levels or character attributes.
-
Interactive Storytelling: Enhance narrative elements by employing facts to remember player choices and actions, shaping the evolving story.
-
Achievement Systems: Implement achievement tracking by using facts to record specific milestones and accomplishments.
Types of facts
Facts have two types: readable and writable.
- Readable Facts: Used in the criteria of an entry. For example, checking if a player has a certain item in their inventory.
- Writable Facts: Used in modifiers to modify the fact's value. For instance, updating a player's quest progression.
Some facts are both readable and writable. For example, the permanent fact can be used in both criteria and modifiers. But some facts are only readable. For example, the inventory item count fact can only be used in criteria.
Groups
In a fact you can select a group. There are 3 types of groups:
- Global: Sets a fact for all players.
- World: Sets a fact for all players in a specific world.
- Player: Sets a fact for a specific player.
Fields
In some entries, there are fields that influence the way facts are handled.
Criteria
Criteria is the condition for an entry, e.g., if fact = 10 then...
. It controls whether an entry will occur.
When using criteria, follow these steps:
- Select the fact to check.
- Choose the operator.
- Insert the value for the operator to check.
Modifiers
Modifiers, as the name suggests, modify a fact.
When using modifiers, follow these steps:
- Select the fact to modify.
- Select the operator. You can change the value directly (=) or add to it (+).
- Insert the value for the operator to modify.
Modifiers only run when the entry is executed.
If the entry has criteria and one of the criteria is false
, then the entry won't be executed, and the fact won't be modified.
Tutorial
To get you started with facts, we will use a permanent fact to track progression in a quest.
- Create a new page and select it as
static
. Give it the namePlayerprogress
- Click on the + icon and select
Add Permanent Fact
. Rename it toPlayerprogress
and give it a nice comment. - Select the player group.
- On the sequence page, click on an action.
- Set a Criteria: Check if
Playerprogress
== 0. - Set a Modifier: If criteria are met, update
Playerprogress
to 1.
- Set a Criteria: Check if
- Create additional actions to represent different quest stages, modifying
Playerprogress
accordingly.
Examples
There are many possibilities with the fact's system. Here are some examples:
- Gathering Items Quest
- Progression Tracking
- Balance check
Objective: A player talks to an NPC and needs to gather items.
Fact Used:
- Readable Fact: Inventory Item Count
Scenario:
- The player talks to the NPC.
- Check the criteria using the Inventory Item Count Fact to verify if the player has the required items.
Objective: Track a player's progression through different quest stages.
Fact Used:
- Writable Fact: Permanent Fact
Scenario:
- The player talks to an NPC (progression set to 1).
- Completes a specific action (progression set to 2).
- Finishes the quest (progression set to 3).
Objective: See if a player has enough money to buy an item.
Fact Used:
- Readable Fact: Balance Fact
Scenario:
- The player talks to an NPC.
- Check the criteria using the balance fact to see if the player has enough balance.
- If the player has enough balance, they can buy the item.
- If the player doesn't have enough balance, show a message to the player.
To see all the available facts, check out the Adapters section.