Self's delay timer
This article contains a short guide on building a delay timer, designed to solve the following problems:
-Trigger events firing too soon
-Trigger events firing when they shouldn't
-Delaying trigger events for a number of turns
-Events triggering incorrectly
---
This situation is quite common with triggers like this: "Every time I get out of bed progress the day by one day".
In a turn where you say:
- "I go to bed and wake the following day"
You will get a response like this:
- "Your character heads to bed, has a nice dream then wakes up refreshed in their bed"
The AI will interpret this and advance the timer for your day by one - exactly as asked.
The following turn you will then say:
- "I get out of my bed and go to brush my teeth, excited about my IW adventure."
You will get a response like this:
- "Your character get out of bed and then goes to brush their teeth"
The AI will interpret this as another instance of getting out of bed, progressing the day again - Not what we want.
---
The solution to this is to introduce a timer, that delays the ability for that trigger to fire again for a limited time, giving the player of the game the ability to have natural responses without accidently triggering the event again.
We'll use a trigger event, and a tracked item,
Tracked item:-[edit]
Data type: Number
Description: Timer
Visibility: One of the AI options
Automatically update tracked item - Yes
Update Instructions: Each turn increase this value by 1
Initial value: 0
Trigger event:-[edit]
Specific situation: When I get out of bed
Trigger based on tracked item value: Timer - Value is greater than - 3
Effects - What ever it is you're trying to do
Set the value of a track item: Timer - Set to value - 0