State improvement

Hi there,

I'm looking for a way to enhance states, when a specific state is already inflicted.

Warm would become Burn.
Poison would become Infection.
Bleed would become Hemorraghe.
etc.

I think the best way would be using custom formulas, directly in skills ? Something like "if target = warm then apply burn ; else apply warm".
I also need the weaker state to be removed if the stronger one is applied.

Does the vanilla version of the game allow that, or do I need a script for it to work ?

Thanks for your answer 🙂
This can easily be done in the damage formula. I am assuming that you want Burn to replace Warm and not be in addition to it.

For the sake of example, the state ids are as follows:
Warm = state id 48
Burn = state id 49

Code:
if b.state?(48);b.add_state(49); b.remove_state(48); end; a.atk * 4 - b.def * 2

All you need to do is to replace 48 and 49 with your own state ids and put in whatever you are using instead of a.atk * 4 - b.def * 2

EDIT
I've just re-read your post and seen that you want it to check if Warm is there and if not to add it. The formula then becomes:

Code:
if b.state?(48);b.add_state(49); b.remove_state(48); end; b.add_state(48); a.atk * 4 - b.def * 2
Yeah it does the work, that's perfect !

Thanks a lot 🙂

EDIT : Actually I have a small problem with it : I'm using the regular add state command in addition of the custom formula (otherwise is just doesn't inflict any state)

The first time the spell is used, it inflicts the weaker state.
The second time the spell is used, it inflicts the stronger state, and removes the lesser one.
However, if it's used a third time, the lesser state is applied in addition with the stronger one (I can tell it with the states icons).

How can I fix it ?

Thanks for your help !

SECOND EDIT : Ok, I just saw that you've edited your post. With this new formula, I don't need to use the regular "add state" command, however the state stacking still occurs if the spell is used three times (meaning both states will be applied on the target) It will remove it once again if used a 4th time,though.
Hmmmmmm.
This will need a second If statement. I'm not sure that it will fit in the damage formula box as it would be something along the lines of the following (and I'm not 100% confident that I've got the syntax correct anyway)
Code:
if b.state?(49);  a.atk * 4 - b.def * 2 : if b.state?(48);b.add_state(49); b.remove_state(48); end; b.add_state(48); a.atk * 4 - b.def * 2

If that doesn't fit the formula box, or if it does but doesn't work, then I think you will have to wait for someone with better scripting knowledge than I have to come along and give you the answer. It may well need a scriptlet, which is the standard way of getting a longer damage formula than the box allows.

Sorry I can't help further.
if the conditions are too complex, you'll need to use something like tsukihime's placeholder state script
Thanks for your answers.

Your formula doesn't fit the box indeed, Kes.

I'm using the script you told me to check, Andar ; However I have still the stacking problem :

Here's what the formula looks like :

<conditional state>
if a.state?(6)
7
else
6
end
</conditional state>

The thing is that I don't know what to write to actually remove the state. Logically, it should be something like "a.remove_state(6)" as Kes mentionned, but it looks like Tsukihime uses a different grammar.

I tried using this formula, but it results in an error :

<conditional state>
if a.state?(6)
7
a.remove_state(6)
else
6
end
</conditional state>
Use a custom damage formula in code.
Ruby:
class Game_Battler < Game_BattlerBase

 #a.state_strike(a, b)
    #Cycles through states each time the skill is used
    def state_strike(a, b)
        s = [nil,2,3,4,5,6,7,8,1]
        @use_count = 0 if @use_count == s.size || @use_count.nil?
        @use_count += 1
        b.add_state(s[@use_count])
        a.atk * 4 - b.def * 2
    end
end
set the states in the array to the states you are going to use.

Use a.state_strike(a, b) in the damage formula

Haven't tested but its one of the custom formulas I have found.

*Just realized it would only partially work for your needs.
Use a custom damage formula in code.
Ruby:
 class Game_Battler < Game_BattlerBase #a.state_strike(a, b) #Cycles through states each time the skill is used def state_strike(a, b) s = [nil,2,3,4,5,6,7,8,1] @use_count = 0 if @use_count == s.size || @use_count.nil? @use_count += 1 b.add_state(s[@use_count]) a.atk * 4 - b.def * 2 end end
set the states in the array to the states you are going to use. Use a.state_strike(a, b) in the damage formula Haven't tested but its one of the custom formulas I have found.

Thanks for your answer ! I'm afraid it's beyond my knowledge and understanding, though...

Where should I put this portion of code ? Is it using Tsukihime's script ?

EDIT :

I'm still messing around with Tsukihime's script. I understand the logic within, but it seems my syntax is not correct (I think it's because of the "end" keyword) :

Code:
<conditional state>
if a.state?(7)
0
else
6
if a.state?(6)
7
end
</conditional state>

Which I translate like this :

If 7 (Burn) is already applied
Does not add any state (0)
Else
Add 6 (Warm)
If 6 (Warm) is already applied
Add 7 (Burn)

I'm not sure what I'm doing wrong...

Original thread: https://forums.rpgmakerweb.com/threads/state-improvement.138465/