DoubleX_RMMZ_TPBS_Countdown_States

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,803
Reaction score
950
First Language
Chinese
Primarily Uses
N/A
Purpose
Lets you set some states to update its turn after some seconds in TPBS

Introduction
Code:
*    1. This plugin lets you set some states to have its turn count updated
*       after a set amount of seconds in TPBS

Video

Games using this plugin
None so far

Code:
*    ## Notetag Info
*       1. Among all the same notetag types in the same data, only the 1st
*          can be effective
*       2. Each line can only have at most 1 notetag
*       3. The following is the structure of all notetags in this plugin:
*          - <doublex rmmz countdown states>
*          - <countdown states>
*          Where contents are in the form of type suffixes: entries
*          Either of the above can be used, but the 1st one reduce the chance
*          of causing other plugins to treat the notetags of this plugin as
*          theirs, while the 2nd one is more user-friendly
*          - type is one of the following:
*            1. interval
*          - suffixes is the list of suffixes in the form of:
*            suffix1 suffix2 suffix3 ... suffixn
*            Where each suffix is either of the following:
*            val(The notetag value will be used as-is)
*            switch(The value of the game switch with id as the notetag value
*                   will be used)
*            var(The value of the game variable with id as the notetag value
*                will be used)
*            (Advanced)script(The value of the game variable with id as the
*                            notetag value will be used as the contents of
*                            the functions to be called upon using the
*                            notetag)
*          - The this pointer of the script suffix is the battler involved
*            (Game_Battler.prototype)
*          - entries is the list of entries in the form of:
*            entry1, entry2, entry3, ..., entryn
*            Where entryi must conform with the suffixi specifications
*----------------------------------------------------------------------------
*    # State Notetags
*      1. interval condSuffix intervalSuffix: condEntry, intervalEntry
*         - Sets the state to be a countdown state having its turn counter
*           updated with interval being the returned value of intervalEntry
*           in TPBS if condEntry returns a truthy result
*         - condSuffix can be val, switch or script
*         - intervalEntry can be val, var or script
*         - The result of condEntry can be anything as only whether it's
*           truthy matters
*         - If the result of condEntry is falsy, this notetag will be
*           discarded upon such use cases
*         - The result of intervalEntry must be a Number
*         - intervalEntry being positive means the state turn counter will be
*           decreased every intervalEntry seconds
*         - intervalEntry being 0 means the state turn counter will be frozen
*         - intervalEntry being negative means the state turn counter will be
*           increased every intervalEntry seconds
*         - E.g.:
*           <countdown states interval switch val: 1, 2> will set the state
*           to be a countdown state having its turn counter decreased every
*           2 seconds if the game switch with id 1 is on

DoubleX RMMZ State Triggers can be useful when setting some events to happen upon updating the countdown state turn counters

Plugins:
1. DoubleX RMMZ Enhanced Codebase
Abilities:
1. Nothing special

Code:
*      1. The default plugin parameters file name is
*         DoubleX_RMMZ_TPBS_Countdown_States
*         If you want to change that, you must edit the value of
*         DoubleX_RMMZ.TPBS_Countdown_States.PLUGIN_NAME, which must be done
*         via opening this plugin js file directly

Code:
*      1. Commercial use's always allowed and crediting me's always optional.
*      2. You shall keep this plugin's Plugin Info part's contents intact.
*      3. You shalln't claim that this plugin's written by anyone other than
*         DoubleX or my aliases. I always reserve the right to deny you from
*         using any of my plugins anymore if you've violated this.
*      4. If you repost this plugin directly(rather than just linking back),
*         you shall inform me of these direct repostings. I always reserve
*         the right to request you to edit those direct repostings.
*      5. CC BY 4.0, except those conflicting with any of the above, applies
*         to this plugin, unless you've my permissions not needing follow so.
*      6. I always reserve the right to deny you from using this plugin
*         anymore if you've violated any of the above.

Code:
*      Authors:
*      1. DoubleX
*      Plugin Development Collaborators:
*      - None So Far
*      Bug Reporters:
*      - None So Far
*      Compatibility Issue Raisers:
*      - None So Far
*      Feature Requesters:
*      - None So Far

Code:
 *      { codebase: "1.1.0", plugin: "v1.00b" }(2020 Dec 11 GMT 0400):
 *      1. Adding the plugin command and query counterpart of the
 *         isTPBSCountdownState battler manipulation
 *      2. Documented the isTPBSCountdownState battler manipulation
 *      3. Fixed the bug of not removing countdown states nor triggering
 *         effects from plugin DoubleX RMMZ State Triggers
*      { codebase: "1.1.0", plugin: "v1.00a" }(2020 Oct 30 GMT 1300):
*      1. 1st version of this plugin finished

Download Link
Demo Link
 
Last edited:

ASUG0

Annihilation Special Unit Generation 0
Veteran
Joined
Jul 16, 2020
Messages
41
Reaction score
11
First Language
German
Primarily Uses
RMMV
I absolutely need a script like this for my game,:LZSlol: but sadly it doesn't seem to work for my project (most likely due to compatibility with other scripts).:LZSteary:

Edit: I just tried it on a new project... did I do something wrong?

Link:
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,803
Reaction score
950
First Language
Chinese
Primarily Uses
N/A
I absolutely need a script like this for my game,:LZSlol: but sadly it doesn't seem to work for my project (most likely due to compatibility with other scripts).:LZSteary:

Edit: I just tried it on a new project... did I do something wrong?

Link:
The hrg triggers per individual turn, not state turn, that's why I've asked you to use DoubleX RMMZ State Triggers as well :)
The state trigger notetag can be something like this:
Code:
<state triggers turn val script: true, x>
And the script event command for setting the game variable with id x for the poison to deal y damage per state turn counter update can be something like this:
JavaScript:
$gameVariables.setValue(x, `
    this._result.clear();
    this._result.used = this._result.success = true;
    this._result.hpAffected = true;
    this.gainHp(-y);
    this.onDamage(y);
    this.startDamagePopup();
    if (this._hp <= 0) {
        this.addState(this.deathStateId());
        BattleManager._logWindow.displayChangedStates(this);
    }
`);
 

ASUG0

Annihilation Special Unit Generation 0
Veteran
Joined
Jul 16, 2020
Messages
41
Reaction score
11
First Language
German
Primarily Uses
RMMV
The hrg triggers per individual turn, not state turn, that's why I've asked you to use DoubleX RMMZ State Triggers as well :)
The state trigger notetag can be something like this:
Code:
<state triggers turn val script: true, x>
And the script event command for setting the game variable with id x for the poison to deal y damage per state turn counter update can be something like this:
JavaScript:
$gameVariables.setValue(x, `
    this._result.clear();
    this._result.used = this._result.success = true;
    this._result.hpAffected = true;
    this.gainHp(-y);
    this.onDamage(y);
    this.startDamagePopup();
    if (this._hp <= 0) {
        this.addState(this.deathStateId());
        BattleManager._logWindow.displayChangedStates(this);
    }
`);
Ah... my bad... thank you

Ps. You're a live saver!
 

Kupotepo

Fantasy realist/Advocatus Diaboli
Veteran
Joined
Jul 5, 2017
Messages
1,955
Reaction score
2,084
First Language
Thai
Primarily Uses
RMMV
@DoubleX, When a state has expired, trigger another state or the target damage. Is that plugin allow this to happen? Just asking if it is possible. Thank you.

Example:
The time bomb state which in 3 turns after casting the spell. The target get damaged.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,803
Reaction score
950
First Language
Chinese
Primarily Uses
N/A
@DoubleX, When a state has expired, trigger another state or the target damage. Is that plugin allow this to happen? Just asking if it is possible. Thank you.

Example:
The time bomb state which in 3 turns after casting the spell. The target get damaged.
In that case, you'll want to use DoubleX RMMZ State Triggers as well, with its expire notetag, like:
<state triggers expire val script: true, x>
Where x is the id of the game variable storing the script for the trigger effects.

In the case of triggering another state(I assume it means adding that state to the battler owning the current state), use this script event command:
JavaScript:
$gameVariables.setValue(x, "this.addState(y);");
Where y is the id of that another state.

In the case of triggering damage owning the current state, use this script event command:
JavaScript:
$gameVariables.setValue(x, `
    this._result.clear();
    this._result.used = this._result.success = true;
    this._result.hpAffected = true;
    this.gainHp(-z);
    this.onDamage(z);
    this.startDamagePopup();
    if (this._hp <= 0) {
        this.addState(this.deathStateId());
        BattleManager._logWindow.displayChangedStates(this);
    }
`);
Where z is the amount of damage.

So, in general, this plugin works well with DoubleX RMMZ State Triggers :)
 

Kupotepo

Fantasy realist/Advocatus Diaboli
Veteran
Joined
Jul 5, 2017
Messages
1,955
Reaction score
2,084
First Language
Thai
Primarily Uses
RMMV
Ok, thank you for helping me. Wow, that is amazing it is possible. Ok, I go look your trigger state plugin. Thank you for writing the code out for me.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,803
Reaction score
950
First Language
Chinese
Primarily Uses
N/A
Updates
Code:
 *      { codebase: "1.1.0", plugin: "v1.00b" }(2020 Dec 11 GMT 0400):
 *      1. Adding the plugin command and query counterpart of the
 *         isTPBSCountdownState battler manipulation
 *      2. Documented the isTPBSCountdownState battler manipulation
 *      3. Fixed the bug of not removing countdown states nor triggering
 *         effects from plugin DoubleX RMMZ State Triggers
 

Latest Threads

Latest Posts

Latest Profile Posts

I saw my new eye doctor today, he reminds me of Satoru Iwata for some reason
I've been using a modified version of a script called Multiple Messages. It makes my text boxes look like a Mario & Luigi game! There is something about it that bothers me a little bit, but I shouldn't worry about that now.

Side note, Mist's walking animation is almost perfectly in sync with Loose Yourself by Eminem.
Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.
Searching what to play in my dead times, the nostalgia hit me hard and ended downloading the Patapon trilogy, hope I can avenge my child self and beating all the games hahaha
Finished the frontier and...I apologize to anyone who saw the trailer I posted and actually tried it. Technical marvel, crazy disjointed fetish story hidden inside a cheap milsim skin that has no idea what it's trying to be except sanctimonious and failing at even that. As much as I hate fallout 4's story, even it was better. I guess there just won't be another non-parody fallout after all.

Forum statistics

Threads
107,768
Messages
1,032,006
Members
139,913
Latest member
EpicLast
Top