About this manual
This manual explains effects over time in ACTION GAME MAKER. It covers four things together: “Apply Effect Over Time” (ApplyEffectOverTime), which keeps changing a value at a fixed interval; “Clear Effect Over Time” (ClearEffectOverTime), which removes such an effect; “Modify Effect Over Time” (ModifyEffectOverTime), which rewrites an effect that is already running; and the condition “Effect Over Time Active” (EffectOverTimeActive), which tests whether one is running.
How effects over time work in ACTION GAME MAKER
An effect over time “keeps changing a value by a set amount at a set interval”. It does not occupy a state in the flow, so the object goes on behaving normally while the effect runs.
| What you want | How to build it with an effect over time |
|---|---|
| Poison / damage over time | Decrease hp at a fixed interval |
| Regeneration | Increase hp at a fixed interval |
| Income that grows over time | Increase a project variable at a fixed interval |
| A buff or debuff for a limited time | Change the value once and restore it when the duration expires |
Until now the same thing meant spending a state on a timer plus the damage. An effect over time folds that into a single action.
Adding one
- Open the add-action screen in a visual script.
- Choose the “Game Settings” category under “Other Actions” (it sits alongside “Wait” and “Count Timer”).
- Choose “Apply Effect Over Time”.
The condition “Effect Over Time Active” is in the “Variable” category under “Other Conditions”.
The effect begins the moment the action is passed, and from then on it keeps running on its own even if you move to another state. To stop it, either set a duration or remove it with “Clear Effect Over Time”.
“Apply Effect Over Time” (ApplyEffectOverTime)
Effect Name
The name that identifies the effect. Clear, Modify and Effect Over Time Active all look effects up by this name. Effects with the same name are also what stack.
Leaving the name empty means it cannot be identified, so it neither stacks nor can be targeted by a clear that names an effect. Always name your poisons and debuffs.
Choosing what to change
- Target Kind: choose from “variable”, “switch” or “node property”.
- Target object: choose from self, a specified object, a specified locked object, the parent object, the last contacted object, an object on the shared board, a project variable, or the database.
- Variable ID: the name of the variable (or switch) to change. Specify
hpand the change can be treated as damage. - Target property: when the target kind is “node property”, pick the node and the property. Boolean, integer and float properties can be selected.
Choose “project variable” and the effect lives on the manager rather than on an object. It continues even if the object that applied it disappears, and even across scene changes. Use this for things like income.
Switches and boolean properties cannot be incremented, so the pattern there is to write once at the start and restore when the duration expires.
Choosing how it changes
- Operator: choose from
=,+=,-=,*=,/=,%=. - Change Amount Type / amount: as well as entering it directly, you can take it from a variable, the database or the shared board.
- Interval (sec): how many seconds between applications.
What an interval of 0 means depends on the operator.
| Operator | With an interval of 0 |
|---|---|
+= -= |
Applied every frame. The amount is treated as “per second” |
*= /= = %= |
Applied once at the start only (applying every frame would blow up exponentially) |
For a temporary debuff expressed as a multiplier, “interval 0 + multiply” is the most natural shape.
Choosing the duration
- Duration Setting: choose from “infinite”, “seconds” or “times”.
- Duration: a number of seconds, or a number of applications.
- Apply Once On Start: turn it on and the first application happens immediately instead of after one interval.
- Re-read Values Each Time: turn it on and the amount, interval and duration are re-read from their variables every time. Off for a poison whose strength should be fixed at the moment it was applied; on for income that should follow the current value.
- Restore Value When Finished: turn it on and the value returns to what it was just before the effect started. Use it for time-limited buffs and debuffs.
Choosing a stop condition
Separately from the duration, this ends the effect when a value meets a condition.
- Stop Condition: choose from “none” or “value comparison”.
- Monitored Value / Comparison / Compare To: the comparisons are
=,!=,<,<=,>,>=.
The check runs every frame. Even on an effect with a 1-second interval, it stops the moment the condition is met. For “poison must not kill”, set the monitored value to hp, the comparison to <= and the value to 1.
Stopping goes through the normal end-of-effect path, so “Restore Value When Finished” still works properly.
Stacking and saving
- When Already Applied: what to do when an effect with the same name is already running. Choose from “stack”, “overwrite”, “extend the duration” or “do nothing”.
- Max Stack: the limit on how many effects of the same name can stack. 0 means unlimited.
- Is Savable: turn it on and the effect is written into the save data and restored on load along with its remaining time. Off by default.
When stacked, the first stack applies for all of them. Triple-stacked poison still shows “one damage number covering all 3 stacks” once a second. You never get three numbers piled on top of each other.
Also, “Apply Once On Start” does not fire when merging into an existing stack (it would slip in one extra application at the moment of merging). A merged stack rides the interval of the stack that was already there.
Treating it as damage
These settings only appear when the target is hp and the operator is += or -=.
- Treat As Damage: turn it on and the change goes through the damage path instead of writing to the variable directly.
- Attribute Source / attribute: the effect’s attribute. Choose from “no attribute”, “specify from the attribute type database” or “specify by attribute value”.
- No Effect While Invincible: turn it on and applications are held while the target is invincible, landing once invincibility ends (on by default).
- Grant Invincibility On Apply: turn it on and the target’s configured invincibility time also triggers (off by default).
- Damage Formula / rounding / Minimum Damage: choose “the conventional calculation” or a “custom formula”. In a custom formula
a.is the applier andb.is the receiver, and you can use variable names such asa.attackandb.hp.
Turning this on brings the existing attribute system along with it. Purple numbers for poison ticks, orange for fire ticks and so on come from the attribute’s damage display settings, and double damage on a weakness comes from the attribute damage rate. Healing (a positive change) appears in the heal colour of the damage display.
“Clear Effect Over Time” (ClearEffectOverTime)
Removes a running effect. Use it to stop poison killing someone during a cutscene, to build a save point that fully heals, to build an antidote item, and so on.
- Object With The Effect: whose effect to remove. Choose “project variable” to remove effects held on the manager side, such as income.
- Target Scope: choose “single” or “all” (this only matters when you specified a scene).
- Effects To Remove: choose “all effects” or “specify by effect name”.
- Effect Name / Stacks To Remove: set stacks to remove to 0 and everything under that effect name is removed. Set it to 1 and a single stack is peeled off.
Removal goes through the effect’s normal end path, so effects set to “Restore Value When Finished” restore their values properly.
“Modify Effect Over Time” (ModifyEffectOverTime)
Reaches into an effect that is already running.
- Object With The Effect / Target Scope: the same as for Clear.
- Effect Name: the name of the effect to change. Leave it empty and any effect is a target, but a name is required when changing the stack count (otherwise there is no telling which stack to add to).
- What To Change: choose from “stack count”, “remaining duration”, “change amount” or “interval”.
- Operator / value type / value:
*=with 2 doubles it; with 0.5 it halves it. - Max Stack: the limit when increasing the stack count. 0 means unlimited.
Remaining duration is changed by moving the duration rather than the elapsed time, so it never contradicts the number of applications or the interval. An effect whose remaining time reaches 0 goes through the normal end path, so “Restore Value When Finished” still works.
Added stacks are made by duplicating a stack that is still running. They inherit the remaining time of the stack they were copied from, so the ones made from older stacks expire first.
An infinite effect has no remaining time, so choosing “remaining duration” on one does nothing.
The condition “Effect Over Time Active” (EffectOverTimeActive)
- Object With The Effect: where to look for the effect.
- Effect Name: leave it empty and any effect matches.
- When To Check: choose “while it is applied” or “the moment the effect fires”.
- Stack Comparison / stack count: choose “at least”, “exactly” or “at most”.
Choose “the moment the effect fires” and it is only true on the frame where the value actually changed. That lets you play a sound or apply hit-stop each time poison damage lands. Stacks are folded into one, so the sound never triples up.
Worked examples
Applying a stacking poison to whatever you hit
The reliable pattern is for the receiving side to apply the poison to itself.
- On the enemy’s (the receiver’s) visual script, build a transition on “ContactWithAttackArea”.
- Put “Apply Effect Over Time” on the destination state and configure it like this:
- Effect Name:
poison - Target Kind: variable / Target object: self / Variable ID:
hp - Operator:
-=/ amount: 5 / Interval (sec): 1 - Duration Setting: seconds / Duration: 5
- When Already Applied: stack / Max Stack: 5
- Treat As Damage: on / Attribute Source: specify from the attribute type database → poison
- Effect Name:
- Every hit adds a stack, and once a second “one damage number covering all the stacks” appears in purple.
If you want to apply it from the attacking side, use “the last contacted object” as the target. Note that this is whoever was recorded by a contact condition (“ContactWithBody”, “contact with an object’s wall collision”), so landing an attack collision alone does not fill it in. Build it so that a contact check lands as well.
A skill that doubles the poison stacks
- Put “Modify Effect Over Time” on the skill’s visual script.
- Object With The Effect: the last contacted object (or an object on the shared board)
- Effect Name:
poison - What To Change: stack count
- Operator:
*=/ value: 2 - Max Stack: 10
- 3 stacks become 6. The added stacks inherit the remaining time of the originals.
- Without a limit, mashing the button grows it forever. Always set Max Stack.
For a debuff-shortening effect that halves the remaining time, set What To Change to “remaining duration” and use *= with 0.5.
Giving yourself 10 seconds of regeneration
- Put “Apply Effect Over Time” on the healing skill’s visual script.
- Effect Name:
regen - Target Kind: variable / Target object: self / Variable ID:
hp - Operator:
+=/ amount: 5 / Interval (sec): 1 - Duration Setting: seconds / Duration: 10
- When Already Applied: extend the duration
- Treat As Damage: on / Attribute Source: no attribute
- Effect Name:
- It heals 5 a second and ends after 10 seconds. Because “Treat As Damage” is on, the healing appears in the heal colour of the damage display.
- With “extend the duration”, reapplying stretches the time instead of stacking. To stack the healing instead, use “stack”.
A 30% attack-down debuff on 5 nearby enemies for 10 seconds
An area debuff is built in two steps: “search and record to the shared board”, then “apply the effect to that list”.
1. Gather the targets
- Place “SearchObjectToBlackboard”.
- Key Name:
DebuffTargets(prepare a key of the object reference list type) - Target group: the enemy group
- Max distance (0 for unlimited): 300
- Sort Type: distance / order: ascending (nearest and smallest first)
- Max Count: 5
- Key Name:
2. Apply it to all of them
- Then place “Apply Effect Over Time”.
- Effect Name:
atk_down - Target Kind: node property
- Target object: an object on the shared board / shared board key:
DebuffTargets - Target property: “Attack Strength” on the attack settings node
- Operator:
*=/ amount: 0.7 / Interval (sec): 0 - Duration Setting: seconds / Duration: 10
- Apply Once On Start: on
- Restore Value When Finished: on
- Effect Name:
Specify an object reference list key and the effect is applied to everyone still alive. To apply it to just one, use an object reference key (the non-list one).
“Attack Strength” defaults to 100 and is the multiplier applied to the attack power in the basic settings. *= with 0.7 makes it 70 (a 30% reduction), and it returns to 100 after 10 seconds.
The interval of 0 is the key here. With an interval of 0, a multiplication is applied once at the start, so it does not keep multiplying by 0.7 and shrinking for 10 seconds.
Note that turning on “Restore Value When Finished” removes “stack” from When Already Applied (the pre-start value cannot be shared between stacks). The default becomes “overwrite”.
Things to watch out for
- A stop condition cannot cut a single application short. With hp 100, the stop condition “hp at or below 50” and damage of 200, the 200 lands, hp reaches 0, and then it stops. The check can only run between applications, and on the damage path the final damage is not decided until after the attribute rate and the formula have been applied. Leave yourself a margin on the threshold.
- “Re-read Values Each Time” changes the meaning a great deal. Off fixes the value at the moment of application (a poison’s strength does not change afterwards); on re-reads every time (income follows the current value).
- Damage-path applications are held during invincibility, but the duration keeps running. That is what makes “ride out a 10-second poison with 10 seconds of invincibility” work.
- Leave “Grant Invincibility On Apply” off. Turn it on and invincibility triggers every time the effect lands, so real attacks stop connecting (a 1-second interval plus 1 second of invincibility means effectively permanent invincibility).
- “Is Savable” is off by default. That avoids the surprise of poison coming back on load. Turn it on and it is restored along with its remaining time.
- An effect with an empty name cannot be identified, so it cannot be cleared, modified or tested for.
- “The last contacted object” is whoever a contact condition recorded. Landing an attack collision alone does not fill it in.
- An effect targeting a project variable continues even if the object that applied it disappears, and across scene changes. To stop it, use “Clear Effect Over Time” with “project variable” as the target.
- Effects using “Restore Value When Finished” cannot stack (the pre-start value cannot be shared between stacks).
- Effects stop while the game is paused.