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,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
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,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
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,592
Reaction score
1,969
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

Ok is telling someone that their drawing isnt good rude
I'm familiar with MZ thanks to jam now. I say it's a better working and looking MV. Lots of plugins too and FOSSIL helps alot. It's not bad.
Some more progress <3 and in most important news:
ALPACARAPTOR SPRITE! (not animated yet, though :( )
h4u90Sz.png
Caz
At the risk of giving myself even more work to do, I kinda wanna redraw the faces of the MV RTP to be a little less.. uhhhhh..

mv-redraw.png
Hmm...you'd think in this day and age, what with Japanese Schoolgirls frequenting anime, JRGs and whatever else...that someone might have made some gym clothes for the generator. You know, the ones with the short bloomers.

Forum statistics

Threads
113,651
Messages
1,076,430
Members
147,671
Latest member
somsomsom
Top