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,693
Reaction score
3,027
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,693
Reaction score
3,027
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

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,818
Reaction score
2,874
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

Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive :D
Finding new interesting stuff to make for the resource calendar becomes harder every year D:
ScreenShot_8_19_2022_2_3_18.png
FINALLY got the mood system in the game during battle. Since the game is called Panic Attack, I figured you should have certain moods present including Panic. so the main 3 or Hype, Depressed, and Anxious. Panic is only when stunned.

Forum statistics

Threads
124,698
Messages
1,165,346
Members
163,514
Latest member
snaphat
Top