Set tcr to 0 in the damage formula

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Hello!

How can I set the tcr (TP charge rate) to 0 within a skills formula or inside notetags evals? I tried something like a.tcr = 0 or user.tcr = 0 but that doesn't seem to be the right command.

Thanks!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
TCR is a trait, not a direct parameter, thats why you can't do it that way..

If it behaves like the Param Rate traits, then you need to add a state that has a 0% TCR trait or add the trait directly to the user (via coding).
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
If it behaves like the Param Rate traits, then you need to add a state that has a 0% TCR trait or add the trait directly to the user (via coding).
I did it with a state. How would I add the trait directly?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
You push a new trait into the traits array of the actor and so on.. I dont really suggest doing so though because it doesnt stick since the traits array isnt saved into the save file, its reloaded from the database when the game is started. So if you do it that way, you'd also need to modify the save/load code to include the traits array (which will lead to the array not updating thru the database for saved games).. Because of that, Dynamic Trait systems usually save the new traits into a new array which is then saved into the save file and just make the game include that new array when checking for Traits..

So if you really want it, just use a Dynamic Traits plugin. I think Galv and Shaz both have one
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Oh ok. That all sounds much more complicated than just using a state. And I was looking for an easy way to avoid the need to make a new state for such things. But I will thankfully stick with states. :LZSgrin:
Thank you for the information though.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,654
Reaction score
1,106
First Language
EN
Primarily Uses
RMMV
Adding/removing a state may be the simplest option, but note that the damage formula is evaluated in full before the result is applied as damage/healing, so you'll either have to script some workaround (e.g. use a.gainHp to bypass the onDamage hook) or have to have some other means of removing the state (e.g. troop event or plugins). :kaoswt:

In case it's still needed...to add a state to the skill user:
Code:
a.addState(id);
To remove a state:
Code:
a.removeState(id);
Just replace id with the database ID of the state to add/remove~
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Thank you. That is how I did it. On execution eval I set the 0 tcr state and after the action sequence I let it remove it again. Works very fine. :LZSsmile:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Before I am done with even one game, I am going to need Psychiatric assistance after doing all these sprites!
Still I am improving, Spriting not mental fortitude.
It's still early days, and I was going to keep this under wraps until development is a bit further along, but I'm just so damn proud of how robust the integrity-checking in this plugin is that I have to share it.
Do you think the new RPG Maker MZ has support for Android devices ?
JDgoldvox wrote on Mr. Detective's profile.
hey, could u help me with a problem? basically, How do I delete a character from a map after a cut scene is over? I am really new with RPG maker MV. Please help!
The most rewarding part of making custom body character parts is absolutely not making the masks work. Somebody please put me out of my misery.

Forum statistics

Threads
99,265
Messages
963,657
Members
130,863
Latest member
AdamEternal
Top