- Joined
- Mar 24, 2014
- Messages
- 579
- Reaction score
- 219
- First Language
- English
- Primarily Uses
- RMVXA
Let me just start by saying that my scripting knowledge is limited at best.
I'm sure there are multiple solutions for this problem, but every time I get close to an answer, I hit a roadblock due to my own ignorance.
Problem - During combat, the maximum HP of party members can and likely will be decreased permanently by most damaging skills. I'm using add_param(0, value) to do this because it allows me to control the MHP attribute with integers as oppose to percentages. After combat, I naturally want the MHP values of the party to be returned normal. I have figured out how to do this with an event, but I'm looking for something more efficient.
If you're thinking I should use a state, then please tell me how I would go about this. The change to the MHP attribute is based on the amount damage dealt by an attack, so it must be plugged into, or directly effected by, the damage formula.
To be thorough, I'll explain the different ways I've attempted to tackle this problem.
Event Solution - At the start of battle on turn 0, I set a variable(HP-Max) to be equal to the actor's mhp. When the battle ends I run the event below.
@> Control Variables: [0002:1.HP-Min] = Variable [Actor 1]'s MHP
@> Change HP: Entire Party, -9999
@> Change Parameters [Actor1]'s, MHP - Variable [0002:1.HP-Min]
@> Change Parameters [Actor1]'s, MHP + Variable [0001:1.HP-Max]
@> Change HP: Entire Party, +9999
I have gotten this to work, but to commit to it completely would require that I set two variables for each actor in the database. Lets just say I have a lot of them...
Script Solution? - I tried running a common event with the script below. I'm using the script N.A.S.T.Y. Extra Stats by Nelderson. The point of this is to avoid using a variable.
p1 = $game_party.members[1]
p1.xstat.ahp == p1.mhp;
It kinda works. I get an error when I try to add more than 1 actor through.
Skill/Script Solution? - I create two skills: combat begin and combat end. One to be cast at the beginning of battle on turn 0, and the other sometime after combat.
Damage Formula: Combat Begin: a.xstat.ahp == a.mhp; add_param(0, -250)
Damage Formula: Combat End: a.add_param(0, -a.mhp);a.add_param(0, a.xstat.ahp)
Then I run the script below as a common event to force these skills
battler1 = $game_party.members[1]
battler1.force_action(138, 0)
BattleManager.force_action(battler1)
Fiber.yield while
BattleManager.action_forced?
Kinda works, except it doesn't. Whenever try this on more than 1 actor, I get an error. I guess force action can't be used on multiple actors at once? idk.
I really just need a way to return the MHP value of all party members to normal after battle.
How would I start off simple script that runs when battle begins and just after it ends?
I'm sure there are multiple solutions for this problem, but every time I get close to an answer, I hit a roadblock due to my own ignorance.
Problem - During combat, the maximum HP of party members can and likely will be decreased permanently by most damaging skills. I'm using add_param(0, value) to do this because it allows me to control the MHP attribute with integers as oppose to percentages. After combat, I naturally want the MHP values of the party to be returned normal. I have figured out how to do this with an event, but I'm looking for something more efficient.
If you're thinking I should use a state, then please tell me how I would go about this. The change to the MHP attribute is based on the amount damage dealt by an attack, so it must be plugged into, or directly effected by, the damage formula.
To be thorough, I'll explain the different ways I've attempted to tackle this problem.
Event Solution - At the start of battle on turn 0, I set a variable(HP-Max) to be equal to the actor's mhp. When the battle ends I run the event below.
@> Control Variables: [0002:1.HP-Min] = Variable [Actor 1]'s MHP
@> Change HP: Entire Party, -9999
@> Change Parameters [Actor1]'s, MHP - Variable [0002:1.HP-Min]
@> Change Parameters [Actor1]'s, MHP + Variable [0001:1.HP-Max]
@> Change HP: Entire Party, +9999
I have gotten this to work, but to commit to it completely would require that I set two variables for each actor in the database. Lets just say I have a lot of them...
Script Solution? - I tried running a common event with the script below. I'm using the script N.A.S.T.Y. Extra Stats by Nelderson. The point of this is to avoid using a variable.
p1 = $game_party.members[1]
p1.xstat.ahp == p1.mhp;
It kinda works. I get an error when I try to add more than 1 actor through.
Skill/Script Solution? - I create two skills: combat begin and combat end. One to be cast at the beginning of battle on turn 0, and the other sometime after combat.
Damage Formula: Combat Begin: a.xstat.ahp == a.mhp; add_param(0, -250)
Damage Formula: Combat End: a.add_param(0, -a.mhp);a.add_param(0, a.xstat.ahp)
Then I run the script below as a common event to force these skills
battler1 = $game_party.members[1]
battler1.force_action(138, 0)
BattleManager.force_action(battler1)
Fiber.yield while
BattleManager.action_forced?
Kinda works, except it doesn't. Whenever try this on more than 1 actor, I get an error. I guess force action can't be used on multiple actors at once? idk.
I really just need a way to return the MHP value of all party members to normal after battle.
How would I start off simple script that runs when battle begins and just after it ends?

