How do I make skills like Sleep have 100% accuracy?

gman

Villager
Member
Joined
Jul 22, 2021
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMXP
The hit-rate for a skill that is non-physical (0 ATK-F) can be completely guaranteed at 100% if EVA-F is 0. This is what the formula says but not what is seen in practice. The skill Sleep for example does miss and not land its effect UNLESS the enemy is completely vulnerable to the state "Sleep" (State Efficiency).
Is it just me who gets these results? Is this intentional or a bug? How could I ignore state efficiency when calculating skill hit-rate?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
899
Reaction score
386
First Language
english
Primarily Uses
RMMV
luck has an effect on state rate in the default engine. it very minor but it exists.
(i use yanfly plugins to remove 'luck effect' so it just uses apply vs resist rates)
you can make sleep 500% success rate, your not capped to 100%.
also Certain hit attack types ignore state/hit/evasion rates
 

gman

Villager
Member
Joined
Jul 22, 2021
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMXP
luck has an effect on state rate in the default engine. it very minor but it exists.
(i use yanfly plugins to remove 'luck effect' so it just uses apply vs resist rates)
you can make sleep 500% success rate, your not capped to 100%.
also Certain hit attack types ignore state/hit/evasion rates
correct me if im wrong but yanfly are plugins for RPG Maker MV, not XP...
Do you know where I edit the script in XP to edit resist rates mid-battle?
 

gman

Villager
Member
Joined
Jul 22, 2021
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMXP
Btw, is there a reason why theres so much less support for RPG Maker XP? It's existed way longer than VX and MV and looks so much better :D I don't understand the hate...
 

Wecoc

Veteran
Veteran
Joined
Jul 4, 2021
Messages
79
Reaction score
216
First Language
Catalan
Primarily Uses
RMXP
I believe it's because the actor's evasion is also involved.

For skills (or items) that do things that are not available on the Database (which is something pretty common) I recommend including a little "AddOns compilation" script above the script Main and put there some custom effects based on Skill ID. They almost always modify only the methods :skill_effect and :item_effect of Game_Battler.

Here's how to set a skill that always applies or removes states.
At least I believe it should work...

Ruby:
#------------------------------------------------------------------------------
# ** Skill that always applies or removes states
#------------------------------------------------------------------------------

class Game_Battler
 
  # Skills that always apply or remove states
  Always_State_Skills = [41, 42]
 
  alias skill_effect_always_state skill_effect unless $@
  def skill_effect(user, skill)
    if Always_State_Skills.include?(skill.id)
      self.critical = false
      self.damage = ""
      @state_changed = false
      for i in skill.plus_state_set
        @state_changed = true
        add_state(i)
      end
      for i in skill.minus_state_set
        @state_changed = true
        remove_state(i)
      end    
      return @state_changed
    else
      return skill_effect_always_state(user, skill)
    end
  end
end
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,765
Reaction score
902
First Language
English
Primarily Uses
RMMV
Btw, is there a reason why theres so much less support for RPG Maker XP? It's existed way longer than VX and MV and looks so much better :D I don't understand the hate...
Who has said they hated it?

For me, I wouldn't consider it because:
1 - It's four versions and 17 years old, why choose to pick that up instead of something that will have at least more refined features, if not more of them?
2 - I disagree that it looks so much better. I do like the style of the tall characters that are included better than the chibis in the newer engines, but that's completely counteracted by the fact that there's no character generator. So unless you're just using the default sprites, you have to create or purchase artwork. A default play size of 640x480 with tiles of 32x32 looks worse to me.
3 - If you're using any included music, the XP sound quality is distinctly dated.

I don't know if there's anything pertaining to the format of the assets that makes them less popular to work with, but just the sheer age of it means many of the old Web sites that might have hosted such materials would be gone by now. And because most new users are going to be purchasing newer engines, there's not much reason to continue creating new content for the old ones as existing repositories die off.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
374
Reaction score
146
First Language
English
Primarily Uses
RMXP
Is it just me who gets these results? Is this intentional or a bug?
It's intentional. The skill Sleep will always 100% hit the target, but it's the state efficiency that determines whether the target is susceptible or not.

What Wecoc provided will pretty much ignore that, though it doesn't handle if your skill were to do damage and apply a state. I'd instead alias states_plus.
 

Wecoc

Veteran
Veteran
Joined
Jul 4, 2021
Messages
79
Reaction score
216
First Language
Catalan
Primarily Uses
RMXP
I didn't do it with states_plus because its argument is skill.plus_state_set instead of skill, so you can't get the skill ID from there directly.

But you're right, I didn't think about skills with multiple effects, I hope that's not a problem in this case.

I guess doing it on states_plus and by state ID instead of by skill ID may be close enough. That would mean some states are added always, regardless of the skill, item or attacker that is causing them.

Ruby:
#------------------------------------------------------------------------------
# ** States that are always added
#------------------------------------------------------------------------------

class Game_Battler
  
  # Set here the state IDs
  Always_Added_States = [7]
    
  alias always_added_states_plus states_plus unless $@
  def states_plus(plus_state_set)
    effective = false
    for i in plus_state_set
      if Always_Added_States.include?(i)
        if self.state_full?(i) == false
          @state_changed = true
          add_state(i)
          effective = true
        end
      end
    end
    effective |= always_added_states_plus(plus_state_set)
    return effective
  end
end

@gman use whatever script version that works best for you. No credits needed.
 

gman

Villager
Member
Joined
Jul 22, 2021
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMXP
Gotta say im rly positively surprised by all of these replies. Didnt expect a single answer honestly :D

People could also just simply check the "Nonresistance" box for a state that should always inflict. And so if you only want a certain skill with the, say sleep, effect to always inflict, you create your own new sleep state with nonresistance and set your skill to inflict that custom state. Skill EVA-F:0 plus a State with "Nonresistance" = always hit and inflict.

What everyone should do for their games however is to script states that hit but are not inflicted to say "resisted" instead of "miss".
Game_Battler 3, row 187:

Code:
unless @state_changed
          # Set damage to "Miss"
          self.damage = "Resisted" #changed from "Miss"
        end
 
Last edited:

Latest Threads

Latest Profile Posts

My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...
Terribly depressed. Worst birthday I've had in years, no motivation to work on anything. Still no income. At least I've got my computer running again.
Doing RPG Maker News for 19th September 2021

Stream will be live with some Dark Souls 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
115,205
Messages
1,088,026
Members
149,781
Latest member
delwin
Top