Main Menu
  • Welcome to The RPG Maker Resource Kit.

SP+ when Defending v1.00

Started by tSwitch, October 26, 2007, 07:57:04 PM

0 Members and 1 Guest are viewing this topic.

tSwitch

SP+ when Defending v1.00
Version: 1.00
Author: NAMKCOR
Date: October 26, 2007

Version History




  • v1.00 - completed script

Planned Future Versions


  • open to suggestions for improvement
Description



adds SP to the actor (or possibly enemy) when they defend

Features


  • easy to configure
  • percent or flat rate SP gain
  • set for actors only, or allow enemies as well

Screenshots

N/A

Instructions

simply configure the values as instructed and the script does the rest

Script




#=============================================================================
#   SP+ when Defending v1.00                                                 
#-----------------------------------------------------------------------------
#   Created By: NAMKCOR                                                                                                     
#   Created for the Websites: Chaos Project, RPG Maker Resource Kit
#                                        (www.chaosproject.co.nr; www.rmrk.net)                     
#   If this script is hosted on any other website, then it is stolen,
#   please contact me at the address given below       
#   Requested by: MrMoo (RMRK)
#-----------------------------------------------------------------------------
#   If you find any Bugs/Incompatability issues with this script, please contact
#   me at the following e-mail address: Rockman922@aol.com, and
#   please be descriptive with your e-mail subject, as I delete spam on sight.                                                                                                             
#-----------------------------------------------------------------------------
#   Function:                                                                                                                             
#    allows actors (and possibly enemies) to recover SP when defending
#                                                                         
#    Compatability:
#     most likely compatible with SDK (untested)
#     no known issues at the moment       
#
#     Instructions to modify:                                                                                                                     
#      Comments and instructions for the individual customizations will
#      be given right where they are located. 
#      Only real skills needed are reading, typing, and copy&paste
#
#     Instructions for use:
#       simply change the below values
#       as instructed and the script will do the rest
#       
#-----------------------------------------------------------------------------
#     Version History:
#     1.0 - completed system
#=============================================================================

class Scene_Battle
 
  alias make_basic_action_result_original make_basic_action_result
  def make_basic_action_result
   
    #==========================================================================
    # These values are here for you to configure :D
    #--------------------------------------------------------------------------    #
    # @SP_to_add = the number (or percent) of SP you want recovered when
    #               the actor (or possibly enemy) defends
    # @is_percent = determines if @SP_to_add is a percent or not
    # @actors_only = determines if enemies can heal SP when defending or not
    #==========================================================================
   
    @SP_to_add = 25
    @is_percent = false
    @actors_only = false
   
    #==========================================================================
    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
    #==========================================================================
    if @active_battler.current_action.basic == 1
      if @is_percent
        if @actors_only
          if @active_battler.is_a?(Game_Actor)
            recover_sp = @active_battler.maxsp * @SP_to_add / 100
          end
        end
      else
        if @actors_only
          if @active_battler.is_a?(Game_Actor)
            recover_sp = @SP_to_add
          end
        else
          recover_sp = @SP_to_add
        end
      end
      @active_battler.damage = -recover_sp
      @active_battler.sp += recover_sp
      @active_battler.damage_pop = true
    end
    make_basic_action_result_original
  end
end


Credit




  • NAMKCOR
  • MrMoo (request)

Thanks


  • MrMoo (requesting it :P)

Support



If you find any Bugs/Incompatability issues with this script, please contact me at   
the following e-mail address: Rockman922@aol.com, and please be descriptive   
with your e-mail subject, as I delete spam on sight.

Known Compatibility Issues

incompatble with RTAB

Author's Notes

yay for script requests

Restrictions

Created for the Websites: Chaos Project, RPG Maker Resource Kit
(www.chaosproject.co.nr; www.rmrk.net)                     
If this script is hosted on any other website, then it is stolen, please contact me at either of the locations given

If you use this script in your game, please link me to the topic
I love to see what my work is used for

do NOT use this script in a commercial game unless you get my permission first


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

djkdjl

that's a pretty useful script,,thx once again namkcor,,u did it again.
"If u'r about to die,,then think of how good ur life has treated u up to this point.  On the
other hand,,if life hasn't treated u good up to this point,,then take joy in the fact that
it's not going to bother u for much longer."

tSwitch



FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

modern algebra

Very nice. Another excellent script.

tSwitch

thanks, glad you like it, hope MrMoo got it


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

:)

Watch out for: HaloOfTheSun

tSwitch



FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

Leventhan

That's a very useful script!
Great Job ;D

Be kind, everyone you meet is fighting a hard battle.

MrMoo

Oh noes :(
The very first error. I didn't implement the script till today, but I'm using an RTAB Ver.1.16 by Cogwheel and I got an error whenever I try to defend. The error takes place in cogwheel's script so I dunno if you could change the script to be RTAB compatible or not.

Here's a pic of the error message.



- -

tSwitch

is my script below cogwheel's or above cogwheel's?

if the latter, put it below the RTAB
if the former, send me the scripts.rxdata so I can take a look


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

modern algebra

It likely has to do with the fact that RTAB expects an argument for self.damage. Specifically, I believe it expects the attacker (Game_Battler), but I can't remember. I haven't looked at RTAB for a long time.

tSwitch

hmm...perhaps...
I would like to see the scripts.rxdata if the first fix doesn't work
if worse comes to worse, I could just merge them


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

MrMoo

The script is below the RTAB right above main. I'll send you the rxdata through pm later today.



- -

:)

Watch out for: HaloOfTheSun

tSwitch

Quote from: MrMoo on October 29, 2007, 10:38:27 PM
The script is below the RTAB right above main. I'll send you the rxdata through pm later today.

alright, sounds good


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

tSwitch

alright, I'm having very little luck making this work with RTAB
no clue why it's not working, and RTAB is so confusing to look at that I can't figure out where to put it to merge it... :tpg:


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

MrMoo

Lol then I guess it's too much trouble  :-\
Thanks anyways, this could still be useful to other people.



- -

tSwitch

it has to be possible, I'm just unsure how to do it cuz I don't know RTAB well enough :tpg:


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon