Status
Not open for further replies.

TheDrifter

Veteran
Veteran
Joined
Apr 18, 2012
Messages
124
Reaction score
7
First Language
English
Primarily Uses
Greetings,

I have this Sprain state that makes it unable for the player to dash or run if one of the party members has it.

However, I want to disable dashing only when it's the party leader who has it.

I still want to be able to dash if I switch him out with another party member who isn't affected by a sprain.

Here's the short script I've been using up until now:



Code:
#==============================================================================
# Disable Dash States
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: September 6, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place above Main and below other custom scripts in the Script Editor (F11)
#
# To set a state to disable dashing, put this code in the notebox of the
# state:
#
# \Disable_Dash
#
# Dashing will be disabled if ANY party member possesses this state.
#==============================================================================

#==============================================================================
# ** RPG::State
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - disable_dash?
#==============================================================================

class RPG::State
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Check if dash disabled
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def disable_dash?
return self.note[/\\DISABLE_DASH/i] != nil
end
end

#==============================================================================
# ** Game Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - disable_dash?
#==============================================================================

class Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Check if dash enabled
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_dash_states_disble_8kb3 disable_dash?
def disable_dash?
# Check if a state is possessed that disables dashing
for actor in $game_party.members
actor.states.each { |state| return true if state.disable_dash? }
end
# Run Original Method
return ma_dash_states_disble_8kb3
end
end
Thank you for your help!
 
Last edited by a moderator:

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
164
Change the disable_dash method to:



Code:
class Game_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check if dash enabled
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_dash_states_disble_8kb3 disable_dash?
  def disable_dash?
	# Check if a state is possessed that disables dashing
	$game_party.leader.states.each { |state| return true if state.disable_dash? }
	# Run Original Method
	return ma_dash_states_disble_8kb3
  end
end
This is untested, but I believe it should work
 
Last edited by a moderator:

TheDrifter

Veteran
Veteran
Joined
Apr 18, 2012
Messages
124
Reaction score
7
First Language
English
Primarily Uses
It works awesomely well! Thank you very much!
 

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
164
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Making games is the only thing I'm good at. Real talk.
So, uh... where's the RPG Maker MZ update with the MV animation system? Is there a release date confirmed?
Also I'm kind of brave enough to admit this. I... I have a crush on Sephiroth.
Please don't call me anything offensive. I'm naturally crazy.
thanks to a lot of lunatic coding... my game finally has a stun mechanic that I feel really good about. damage enemy's mental psyche (mp), and once empty, hitting with certain attacks trigger combos that can stack the damage.
Waiting for the 1.40 update before testing out my copy of MZ so that I don't end up adding unnecessary work to my plate. Meanwhile the current fourth draft for my story is taking shape, and I'm fleshing out the lore as I realize how things would make better sense here and there for the world that I'm building.
Sword_of_Dusk wrote on BCj's profile.
Just found out about your complications. I'm so sorry that you're going through this. I wish I could do something substantial for you, but our distance from each other makes that an impossibility. Still, if you ever need to talk or vent, I'm here.

Forum statistics

Threads
117,112
Messages
1,104,672
Members
153,146
Latest member
42ndPotato
Top