[RMMV] REDUCING THE PARTY'S TP BY A PERCENTAGE

Posts

Pages: 1
unity
You're magical to me.
12540
Hello ^_^

Got a project in MV where I want to cut all party members' TP in half after each battle. Got a Common Event set up that runs after battles, but the engine will only allow me to reduce TP by a set number and not a percentage.

How would you use a script command to do this? I know I could in Ace but I assume the language is different in MV and it would be an MV specific one.

Any help is greatly appreciated ^_^
Marrend
Guardian of the Description Thread
21806
I know in Ace, the default value for maximum TP is 100. Not sure if it's the same in MV, but, seems likely. Though, if it's been changed (either by you changing it, or by the default value being set to something else), then, uh, sorry, can't help. ;_;

*Edit: Wait, we're talking about subtracting out half of current TP? Welp.

Like, I would do something like...

$game_actor[id].tp /= 2

...this, but, translating that to MV... I don't know the correct references at all. Sorry. ;_;
I'm not 100% sure but if this plugin works, would this work for you?

http://sumrndm.site/tp-upgrade/
You can read an actor's TP into a variable using "Control Variables" with the script call "$gameActors.actor(1).tp()" (for the first actor).
For some reason, the "game data" option doesn't include TP as an option, so you can't just use that.

This will be easier and less clunky with a script.

$gameParty.allMembers() returns an array you can iterate over and call tp(), setTp() or gainTp() as you prefer.

So you can write your own plugin that does that and attaches it to a plugin command you call from common events, or hooks into the end of the battle scene
unity
You're magical to me.
12540
author=Marrend
I know in Ace, the default value for maximum TP is 100. Not sure if it's the same in MV, but, seems likely. Though, if it's been changed (either by you changing it, or by the default value being set to something else), then, uh, sorry, can't help. ;_;

*Edit: Wait, we're talking about subtracting out half of current TP? Welp.

Like, I would do something like...

$game_actor[id].tp /= 2


...this, but, translating that to MV... I don't know the correct references at all. Sorry. ;_;


Thanks for the effort! Yeah, MV's completely different, so my (admittedly very very very small) knowledge of any coding is lost here too XD;

author=boos405
I'm not 100% sure but if this plugin works, would this work for you?

http://sumrndm.site/tp-upgrade/


Thanks for the suggestion! ^_^ That's a cool script, but it unfortunately doesn't play well with another script I'm using, so I ended up giving it a pass. Thanks anyway, I appreciate the thought :DDDDD

author=coelocanth
You can read an actor's TP into a variable using "Control Variables" with the script call "$gameActors.actor(1).tp()" (for the first actor).
For some reason, the "game data" option doesn't include TP as an option, so you can't just use that.

This will be easier and less clunky with a script.

$gameParty.allMembers() returns an array you can iterate over and call tp(), setTp() or gainTp() as you prefer.

So you can write your own plugin that does that and attaches it to a plugin command you call from common events, or hooks into the end of the battle scene


Thank you very much! :DDDDDDDDDDDDD This is the information I needed! I really appreciate it! ^_^
Pages: 1