Game Creator
  • Welcome to Game Creator!
  • Quickstart
    • Get Started
    • Setup
    • Tutorials
  • Game Creator
    • Game Creator
      • Actions
      • Conditions
      • Triggers
      • Hotspots
      • Characters
        • Player
        • Markers
        • Gestures
        • States
        • Advanced
          • IK in custom Animations
      • Camera
        • Camera Motors
      • Variables
        • Global Variables
        • Local Variables
        • List Variables
    • Systems
      • Localization
      • Event System
      • Timeline
      • UI
      • Module Manager
      • Game Creator Toolbar
      • Pool System
      • Game Creator API
        • Custom Actions
        • Custom Conditions
        • Custom Triggers
        • Custom Hooks
        • Custom Save & Load
        • Variables Access
        • Custom Module
  • Dialogue
    • Dialogue
      • Anatomy
      • Actors
      • Dialogue UI
      • API
  • Inventory
    • Inventory
      • Inventory Window
        • Catalogue
        • Recipes
        • Types
        • Settings
      • Merchants
      • Containers
      • Loot Tables
      • Equip Items
      • Actions
      • Conditions
      • Custom Inventory UI
  • Quests
    • Quests
      • Quests Overview
      • Create Quests
      • Quests UI
        • Custom UI
  • Stats
    • Stats
      • Stats Overview
        • Stat
        • Attributes
        • Status Effects
        • Formulas
        • Stat Modifiers
      • Stats UI
      • Common Use Cases
        • Simple Health Bar
        • Regenerative Mana
        • Poison Status Effect
        • Levels and XP
        • Strength and Armor
        • Lockpicking
  • Behavior
    • Behavior
      • Behavior Graph
        • Nodes
        • Blackboard
      • Perception
  • Shooter
    • Shooter
      • Weapons
      • Ammunition
      • Interaction
      • Examples
        • Example 1 - Get Started
        • Example 2 - Pick Weapons
        • Example 3 - Top Down
        • Example 4 - Side Scroll
        • Example 5 - First Person
        • Example 6 - Combat
      • Advanced
        • Custom Crosshairs
        • Shooter API
  • Melee
    • Melee
      • Weapons
        • Blade Component
      • Shields
      • Melee Clips
      • Combat
  • Traversal
    • Traversal
      • Obstacles
      • Climbables
      • Built-in Elements
  • Annex
    • Roadmap
    • FAQ
Powered by GitBook
On this page
  • Status Effect Definition
  • Adding a Status Effect
  • Displaying the Status Effect

Was this helpful?

  1. Stats
  2. Stats
  3. Common Use Cases

Poison Status Effect

Aaargh! Y-You... YOU POISONED ME...!

PreviousRegenerative ManaNextLevels and XP

Last updated 6 years ago

Was this helpful?

The Stats module comes with a great tools to create any kind of Status Effect. Here we'll learn how to create one of the most common ones: The Poison.

It is important that before reading this section you know how to create a Status Effect and which options and properties it has.

Here are the key elements of this particular Status Effect.

  • We want out Poison to slowly drain hit points from the player for as long as it's active.

  • We also want the Status Effect to wear off after some seconds.

  • Last we also want to disable the player's locomotion system and display: "You are dead".

Status Effect Definition

Open the Preferences Window and head to the Stats section. Open the Status Effects tab and create one.

The most important part here are the Has Duration property, which is set to true and the amount of seconds the effect lasts.

The other important section are the Actions. The Poison effect doesn't have any On Start nor On End Actions. All the logic is inside the While Active Actions, which are a special Actions that is constantly executed while the effect is active. In this case we wait 0.1 seconds and right after that the health of the Invoker is reduced by a certain amount.

Adding a Status Effect

To apply the Status Effect all that needs to be done is to use the Status Effect Action. This instruction allows to add and remove individual elements or by category.

In this case we want the Green Ball to execute a Status Effect Action which will add the Poison effect to whatever object that collides with it.

Displaying the Status Effect

To display the current Status Effect (poison in this case, though should work for any other you create) all that needs to be done is to create a container where all Status Effects will be displayed and create a prefab that will populate that container with each individual element.

The third scene in the Stats Examples has a Status Effects object inside the Canvas-Health prefab. That object has a vertical layout group that dynamically organizes and aligns its child elements.

Status Effects UI component references a prefab called Status Effect UI which is used to display the information of the current status effect, such as the green skull and the title of the effect.

The Status Effects UI and Status Effect UI will automatically update their information when the status effects of the target change.

(Poison Status Effect properties)
(Status Effects UI with the Status Effect prefab reference)
(Status Effect UI which displays just some of the properties)