Set tcr to 0 in the damage formula

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
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,682
Reaction score
3,004
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
40
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,682
Reaction score
3,004
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
40
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
2,227
Reaction score
1,635
First Language
EN
Primarily Uses
RMMZ
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
40
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:
 

Latest Threads

Latest Posts

Latest Profile Posts

I feel like banging my head against a wall every time I want to find that post that shows all the plugin header codes. Then I think "next time I find it, I'm going to bookmark it". Then I think "wait a minute ... maybe I bookmarked it last time because it took me so long to find it". Check bookmarks, and there it is :)
... a few of my main characters standing around doing nothing lol. I mostly wanted to see them together on screen.
Today I drove through my city of 100,000+ people during rush hour and the streets were nearly empty. Just so I could go get my favorite burger. There a dental assistant (she said that's her other job, even though I didn't ask) took my order and handed me a burger. I know it's bad out there... But wow, she's either atrocious with her money, or "it really be like that".

Forum statistics

Threads
107,815
Messages
1,032,411
Members
139,964
Latest member
Floflux
Top