Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [SOLVED] Decreasing parameters by percent.
Kaleb Daub
post Jul 4 2012, 01:53 PM
Post #1


Level Up!
Group Icon

Group: Revolutionary
Posts: 299
Type: Artist
RM Skill: Beginner




I was wondering if there is a script or a way in the database to make weapons and skills decrease max parameters by a percent. I know you can boost parameters through weapon and skill traits, but don't know if there is a way to decrease them.
Any help? Thanks in advance.

UPDATE: Here is the script that fixed my problems just in case any one else needs it.

http://yanflychannel.wordpress.com/rmvxa/g...-dynamic-stats/

This post has been edited by mooshra: Jul 8 2012, 06:08 AM


__________________________
My games.
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Jul 5 2012, 03:44 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,523
Type: Scripter
RM Skill: Undisclosed




Would this work?

CODE
#==============================================================================
# ** VXAce: NR's Accurate Weapon Stats
#------------------------------------------------------------------------------
# History:
#  Date Created: 5/July/2012
#  Created for: mooshra
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=57099
#
# Description:
#  This script allows developers to set a weapons parameters as a decimal
#  integer.
#
# How to Install:
#  Copy this entire script. In your game's editor select Tools >>
#  Script Editor. Along the left hand side scroll to the bottom, right
#  click on after 'Materials' and select 'Insert'. Paste the code in the
#  blank window on the right.
#
# How to Use:
#  In the Database, look for the weapon under the 'Weapons' tab.
#  Create a Note like so:
#            [ATK=0.6]
#  to set the attack to 60%, and so on for the other parameters.
#==============================================================================



#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
#  Edited to get the parameters specified in the weapons notetag
#==============================================================================

module DataManager
  #--------------------------------------------------------------------------
  # * Alias methods
  #--------------------------------------------------------------------------
  class << self
    alias nr_AccWeaponStats_load_normal_database  load_normal_database
    alias nr_AccWeaponStats_load_battle_test_database  load_battle_test_database
  end
  #--------------------------------------------------------------------------
  # * Load Normal Database
  #--------------------------------------------------------------------------
  def self.load_normal_database(*args, &block)
    # Run the original load_normal_database
    nr_AccWeaponStats_load_normal_database
    # Update the weapons
    self.read_nr_weapons_notetags
  end
  #--------------------------------------------------------------------------
  # * Load Battle Test Database
  #--------------------------------------------------------------------------
  def self.load_battle_test_database
    # Run the original load_battle_test_database
    nr_AccWeaponStats_load_battle_test_database
    # Update the weapons
    self.read_nr_weapons_notetags
  end
  #--------------------------------------------------------------------------
  # * Read Weapons Notetags
  #--------------------------------------------------------------------------
  def self.read_nr_weapons_notetags
    # Loop through each weapon
    for weapon in $data_weapons
      # Skip if its not a weapon
      next if not weapon.is_a?(RPG::Weapon)
      # Loop through each change listed in the note
      for change in weapon.note.scan(/\[(\w{3})\=([^\]]*)\]/)
        # Get the parameter to change
        parameter = change[0].upcase
        # Get the integer value specified
        value = change[1].to_f
        # Apply the parameter change, noting its position in the @params array
        physical_parameters = ["ATK", "DEF", "MAT" "MDEF", "AGI", "LUK"]
        magical_parametrs = ["MHP", "MMP"]
        if physical_parameters.include?(paramter)
          index = physical_parameters.index(parameter) + 2
          @params[index] = value
        elsif magical_paramers.include?(parameter)
          index = magical_parametrs.index(parameter)
          @params[index] = value
        end
      end
    end
  end
end


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Kaleb Daub
post Jul 5 2012, 04:00 PM
Post #3


Level Up!
Group Icon

Group: Revolutionary
Posts: 299
Type: Artist
RM Skill: Beginner




Tried it kept getting errors when I start the project.Around the bottom It appears you have spelled parameter wrong a few times around I believe lines 77-80 I think the "if" variable I believe is what it us called is spelled wrong you have "elsif" in its place. I fixed some spelling then it stopped giving me errors when I used the MHP tag but it didn't work. So I tried the other notes , but, when its not MHP it stops working. Its weird it keeps giving me a variable or method error and I tried it in a blank project and it still gave me the same error.
So over all this script isn't functional as is. Unless I don't understand something.

This post has been edited by mooshra: Jul 5 2012, 04:02 PM


__________________________
My games.
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Jul 7 2012, 06:12 AM
Post #4


Level 50
Group Icon

Group: +Gold Member
Posts: 1,523
Type: Scripter
RM Skill: Undisclosed




Wow, that's embarrassing...

Attempt 2:
CODE
#==============================================================================
# ** VXAce: NR's Accurate Weapon Stats
#------------------------------------------------------------------------------
# History:
#  Date Created: 5/July/2012
#  Created for: mooshra
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=57099
#
# Description:
#  This script allows developers to set a weapons parameters as a decimal
#  integer
#
# How to Install:
#  Copy this entire script. In your game's editor select Tools >>
#  Script Editor. Along the left hand side scroll to the bottom, right
#  click on after 'Materials' and select 'Insert'. Paste the code in the
#  blank window on the right.
#
# How to Use:
#  In the Database, look for the weapon under the 'Weapons' tab.
#  Create a Note like so:
#            [ATK=0.6]
#  (case insensitive), to set the attack to 60%
#==============================================================================



#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
#  Edited to get the parameters specified in the weapons notetag
#==============================================================================

module DataManager
  #--------------------------------------------------------------------------
  # * Alias methods
  #--------------------------------------------------------------------------
  class << self
    alias nr_AccWeaponStats_load_normal_database       load_normal_database
    alias nr_AccWeaponStats_load_battle_test_database  load_battle_test_database
  end
  #--------------------------------------------------------------------------
  # * Load Normal Database
  #--------------------------------------------------------------------------
  def self.load_normal_database(*args, &block)
    # Run the original load_normal_database
    nr_AccWeaponStats_load_normal_database
    # Update the weapons
    self.read_nr_weapons_notetags
  end
  #--------------------------------------------------------------------------
  # * Load Battle Test Database
  #--------------------------------------------------------------------------
  def self.load_battle_test_database
    # Run the original load_battle_test_database
    nr_AccWeaponStats_load_battle_test_database
    # Update the weapons
    self.read_nr_weapons_notetags
  end
  #--------------------------------------------------------------------------
  # * Read Weapons Notetags
  #--------------------------------------------------------------------------
  def self.read_nr_weapons_notetags
    # Loop through each weapon
    for weapon in $data_weapons
      # Skip if its not a weapon
      next if not weapon.is_a?(RPG::Weapon)
      # Loop through each change listed in the note
      changes = weapon.note.scan(/\[(\w{3})\=([^\]]*)\]/)
      for change in changes
        # Get the parameter to change
        parameter = change[0].upcase
        # Get the integer value specified
        value = change[1].to_f
        # Apply the parameter change, noting its position in the @params array
        physical_parameters = ["ATK", "DEF", "MAT", "MDEF", "AGI", "LUK"]
        magical_parameters = ["MHP", "MMP"]
        if physical_parameters.include?(parameter)
          index = physical_parameters.index(parameter) + 2
          weapon.params[index] = value
        elsif magical_parameters.include?(parameter)
          index = magical_parameters.index(parameter)
          weapon.params[index] = value
        end
      end
    end
  end
end


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Kaleb Daub
post Jul 7 2012, 01:16 PM
Post #5


Level Up!
Group Icon

Group: Revolutionary
Posts: 299
Type: Artist
RM Skill: Beginner




I didn't see any script errors you made well I am a newbie to scripting, but when I test it the errors stop,but the stats wont decrease. In fact it wont increase either. Sorry if its a hassle.


__________________________
My games.
Go to the top of the page
 
+Quote Post
   
Kaleb Daub
post Jul 8 2012, 06:02 AM
Post #6


Level Up!
Group Icon

Group: Revolutionary
Posts: 299
Type: Artist
RM Skill: Beginner




Hey i have figured this out sorry for taking your time, This script already exists its Yanfly's Equip Dynamic Stats here.
http://yanflychannel.wordpress.com/rmvxa/g...-dynamic-stats/
Just letting yah know in case others need this, but thank you so much for trying. I am really grateful.

This post has been edited by mooshra: Jul 8 2012, 06:08 AM


__________________________
My games.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 08:12 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker