Skip to content

Designer: Creating Requirements

Silent edited this page Jul 8, 2024 · 1 revision

What Are Requirements

Requirements are a universal mechanism in TXEnginePY that allows you to control whether a certain game element can be accessed or used by the player. Requirements have a wide breadth of functionality and are highly configurable, giving you precise control over how your player can interact with your game elements.

What Features use Requirements?

  • Abilities

    • Combat Abilities can implement a wide array of Requirements to dynamically prevent the player from using the Ability if certain conditions are not met. For example, an Ability's usage can be blocked if a Skill hasn't reached the required level or if a certain Item is no in the player's inventory.
  • Usable Items

    • Usable Items can implement Requirements that prevent the player from using the item without meeting certain conditions.
  • Equipment

    • You can use Requirements to prevent the player from equipping Equipment unsuitable for their point in the game. For example, a SkillRequirement can be used to prevent the player from equipping a fancy shield before their "Blocking" Skill reaches a certain level.
  • Room Actions

    • Any Room Action can implement a Requirement to prevent the player from using it. For example, an ExitAction may implement a FlagRequirement that prevents the player from going to a specific Room without satisfying the quest that sets the corresponding Flag.
  • Crafting Recipes

    • Crafting Recipes may only be used if all Requirements are met. For example, your player cannot use the "Iron Bar" recipe if his/her "Smithing" Skill hasn't reached level 10.

What Requirements are Available?

  • ResourceRequirement
  • ItemRequirement
  • SkillRequirement
  • FlagRequirement
  • FactionRequirement
  • CurrencyRequirement

Requirements are Universal

Remember, a Requirement written for an Ability can be directly copied and pasted into a Room Action, or vice-versa! Requirements are simply a description of a certain condition that must be met, so feel free to re-use them as much as possible!

Examples