The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: modern algebra on January 22, 2009, 11:11:31 PM

Title: Dashing Ethereality
Post by: modern algebra on January 22, 2009, 11:11:31 PM
Dashing Ethereality
Version: 1.1
Author: modern algebra
Date: January 22, 2009

Version History



Description


 This script makes it so that you can specify, through comments, certain events to have the property that they are set to through when the player is dashing. It is a feature in Harvest Moon: Back to Nature.

Instructions

Place this script above Main and below Materials.

To set an event to have this property, place a comment in the first line of its page that says:

\ma_dash_ethereal

Only event pages with that in the first comment will have the property that they can be run through when the player dashes.

Script


Code: [Select]
#==============================================================================
#  Dashing Ethereality
#  Version: 1.1
#  Author: modern algebra (rmrk.net)
#  Date: January 25, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#    Place this script above Main and below Materials.
#
#  To set an event to have this property, place a comment in the first line of
# its page that says:
#
#        \ma_dash_ethereal
#
#  Only event pages with that in the first comment will have the property that
# they can be run through when the player dashes.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#    This script makes it so that you all events are set to through when the
#   player is dashing. It is a feature in Harvest Moon: Back to Nature
#==============================================================================
# ** Game Event
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - steup, through
#==============================================================================

class Game_Event < Game_Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * MA Check First Comment
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def ma_get_first_comment
    # Compose first comment into a single string
    indx = 0
    comment = ""
    # Check Comments
    while @page.list[indx] != nil && (@page.list[indx].code == 108 ||
        @page.list[indx].code == 408)
      # Add line to comment
      comment += @page.list[indx].parameters[0] + " "
      indx += 1
    end
    # Check full comment for the code
    return comment
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modlg_dsh_ethr_stup_cmmt_check_94n5 setup
  def setup (*args)
    # Run Original Method
    modlg_dsh_ethr_stup_cmmt_check_94n5 (*args)
    # Check First Comment
    comment = ma_get_first_comment
    @ma_ethrl_evnt = comment[/\\MA_DASH_ETHEREAL/i] == nil ? false : true
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Through
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias rendy_modalg_8f2e_thru_ethrdash through
  def through
    return rendy_modalg_8f2e_thru_ethrdash unless @ma_ethrl_evnt
    return $game_player.evnt_priority_override ? true : rendy_modalg_8f2e_thru_ethrdash
  end
end
#==============================================================================
# ** Game_Player
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new instance variable - evnt_priority_override
#    aliased methods - initialize, passable?
#==============================================================================

class Game_Player
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :evnt_priority_override # When true, event priority not affect pass
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_ethrel_dash_rndy_init_priovrd_4h5 initialize
  def initialize
    # Run Original Method
    ma_ethrel_dash_rndy_init_priovrd_4h5
    # Initialize Priority Override
    @evnt_priority_override = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Passable?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_rndy_etherl_dshing_pass_9fn4 passable?
  def passable? (*args)
    @evnt_priority_override = true if dash?
    rslt = ma_rndy_etherl_dshing_pass_9fn4 (*args)
    @evnt_priority_override = false
    return rslt
  end
end

Credit


No credit required for such a small script.

Thanks


Support


Just reply to this topic

Known Compatibility Issues

None known.

Author's Notes


Yeah, I think this script is useless too. I'm also annoyed that I am filling in this template for something so small. I need my Useful Scriptlets topic back. Except then this one wouldn't apply, because it is still useless.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
Title: Re: Dashing Ethereality
Post by: Grafikal on January 22, 2009, 11:59:00 PM
What does this even do that is useful at all?
Title: Re: Dashing Ethereality
Post by: modern algebra on January 23, 2009, 12:14:29 AM
It fulfills a request. Go away.
Title: Re: Dashing Ethereality
Post by: Grafikal on January 23, 2009, 12:27:04 AM
Lol. BE THAT WAYYYY
Title: Re: Dashing Ethereality
Post by: rendy1287 on January 24, 2009, 12:03:35 PM
Thanks modern algebra :)
Title: Re: Dashing Ethereality
Post by: rendy1287 on January 25, 2009, 08:22:41 AM
Can you make it for some certain events which can be throughed while we are running?

Just like characters or people

NOT door events, boxes item, trees, and fences, et cetera <== events cannot be throughed

hmm, modern, maybe you can certain what events can be throughed from the comment in page of Event Commands? Or better method (i'm just to suggest) :)

eg: @>Comment: ETHEREALITY

(or name it in better, my english is poor) :(

Thanks modern algebra..
Title: Re: Dashing Ethereality
Post by: modern algebra on January 26, 2009, 04:16:43 PM
OK, it's done. A little different from what you requested for naming purposes: Just place in the first ine of the event page a comment that says: \ma_dash_ethereal