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,008
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,008
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,716
Reaction score
1,165
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

Well... My game plays better at 1920x1080, so I guess that's the new resolution. Still runs at 60FPS. :LZSexcite: Also... I really want a boss to be able to build new maps around the player... Mostly because it's visually spectacular! I'm er... not quite sure yet how I can do that without making MV explode.... But I'll find a way, anything in service to the "sparkles"! :kaopride:
How to change your netbooks screen resolution

Forum statistics

Threads
100,787
Messages
979,542
Members
132,430
Latest member
Timiti
Top