I'm using this event for some combat gimmicks in my game, but it's turning into a real hassle that it just bypasses resistances completely when I'd really rather it not. Is there any script or anything else I could use to change this?
[XP] Making the 'Change Enemy State' event account for enemy state resistances
RPG Maker XP Supportevent commands like that are supposed to bypass all resistances in order to make story elements guaranteed. changing that might have consequences elsewhere.
why don't you simply use a force-action command with a skill that applies the state? that should have the skill working normally even if the force action overrides all skill requirements.
why don't you simply use a force-action command with a skill that applies the state? that should have the skill working normally even if the force action overrides all skill requirements.
I also tried using the 'Force Action' command, but that one has other issues - namely that it doesn't work before the first turn of combat, and there's no option to have it force an action without using up the actor's turn.
Currently I've been trying to edit the 'Change Enemy State' script in Interpreter 7 and I'm stuck. I mostly don't know how scripting works, but I've added a bit from Game_Battler 2 that references enemy state effectiveness.
Unfortunately the little "i" in there should reference which state is being applied, but doesn't (it does do that in Game_Battler 2, but I can't figure out which part of the code makes it do that or how I'd bring it over to Interpreter 7). If I change to a specific number, it actually works just fine, but only with that specific state (i.e. changing it to [3] references the 3rd listed state).
All I need to figure out is how to make "i" reference the state being applied and the script will work just fine, so if anyone could help me with that I'd really appreciate it.
Ruby:
#--------------------------------------------------------------------------
# * Change Enemy State
#--------------------------------------------------------------------------
def command_333
# Process with iterator
iterate_enemy(@parameters[0]) do |enemy|
# If [regard HP 0] state option is valid
if $data_states[@parameters[2]].zero_hp
# Clear immortal flag
enemy.immortal = false
end
# Change
if @parameters[1] == 0 and rand(100) < [0,100,80,60,40,20,0][enemy.state_ranks[i]]
enemy.add_state(@parameters[2])
else
enemy.remove_state(@parameters[2])
end
end
# Continue
return true
end
Unfortunately the little "i" in there should reference which state is being applied, but doesn't (it does do that in Game_Battler 2, but I can't figure out which part of the code makes it do that or how I'd bring it over to Interpreter 7). If I change to a specific number, it actually works just fine, but only with that specific state (i.e. changing it to [3] references the 3rd listed state).
All I need to figure out is how to make "i" reference the state being applied and the script will work just fine, so if anyone could help me with that I'd really appreciate it.
Ruby:
# * Enemies, Resist State Changes! XP
# Overwritten Method: Interpreter#command_333
# * Toggle a given Game Switch to activate / deactivate this feature in game.
class Interpreter
USE_ENEMY_STATE_RANKS_SWID = 1 # You can change the Switch ID!
# * Change Enemy State
def command_333
iterate_enemy(@parameters[0]) do |enemy|
state_id = @parameters[2]
enemy.immortal = false if $data_states[state_id].zero_hp
# Add State to Enemy
if @parameters[1] == 0
if $game_switches[USE_ENEMY_STATE_RANKS_SWID]
pos = enemy.state_ranks[state_id]
percent = [0,100,80,60,40,20,0][pos]
return true if rand(100) >= percent
end
enemy.add_state(state_id)
else
enemy.remove_state(state_id)
end
end
return true
end
end
I just improved the code posted above to allow people use a game switch to enable or disable the feature at any moment during gameplay.
This is fantastic, thank you so much!
Original thread: https://forums.rpgmakerweb.com/threads/xp-making-the-change-enemy-state-event-account-for-enemy-state-resistances.152316/