Main Menu
  • Welcome to The RPG Maker Resource Kit.

Falcon's Small Scripts

Started by Falcon, August 26, 2007, 10:31:52 PM

0 Members and 1 Guest are viewing this topic.

Falcon

Well, I'll be stealing Modern's idea of posting simple scripts in one topic, so here are my simple scripts.

[spoiler=Experience Boosting Potions]Demo: http://www.mediafire.com/?6yxlyzyxi43
Paste this above main:#==============================================================================
# Experience Boosting Potions
#------------------------------------------------------------------------------
# By The_Falcon
# Requested by doodley at rmrk.net
#------------------------------------------------------------------------------
# This script should only be found at the following places:
# rmrk.net
# rmrevolution.rmrk.net
# hbgames.org
#==============================================================================
class Game_System
  attr_accessor   :experience_boost      # how much the exp increases
  attr_accessor   :exp_boost_turns       # how many battles the boost will last
  # Alias the initialize method
  alias exp_boost_initialize initialize
  def initialize
    # Use the old method
    exp_boost_initialize
    # Set both new variables
    @experience_boost = 0.0
    @exp_boost_turns = 0
  end
end

Now, replace this in Scene_Battle 2:    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
With this:    #-----------------------------------------
    # Experience Potion Additions
    #-----------------------------------------
    if $game_system.exp_boost_turns > 0
      exp += Integer(exp * $game_system.experience_boost)
      exp.round
      $game_system.exp_boost_turns -= 1
    end
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
Then make common events which the experience potions call. The common events should have the following:$game_system.experience_boost = X
$game_system.exp_boost_turns = Y
Where X is the percent (be sure to have a 0 in front of the percent decimals) and Y is the turns the boost will last.
Free to use in any project, as long as I am credited.[/spoiler]
[spoiler=Map BGM carry through battle]
Replace the battle call method with this in Scene_Map. Change the switch to whatever switch you want to trigger then BGM.
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    if $game_switches[1] == false
      # Memorize map BGM and stop BGM
      $game_temp.map_bgm = $game_system.playing_bgm
      $game_system.bgm_stop
      # Play battle start SE
      $game_system.se_play($data_system.battle_start_se)
      # Play battle BGM
      $game_system.bgm_play($game_system.battle_bgm)
    else
      # Play battle start SE
      $game_system.se_play($data_system.battle_start_se)
      $game_temp.map_bgm = $game_system.playing_bgm
    end
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end

Free to use in any project without giving me credit.[/spoiler]
[spoiler=Skill Overwrite System]
To use this, just set a bunch of skills to have the same name, whenever the actor learns one of the skills, the other ones with the same name will be deleted from their skill array.
http://falcon.rmrk.net/skilloverwrite.txt
Free to use in any project, as long as I am credited.
[/spoiler]

modern algebra

Thief :P

I like that little script. It's an interesting type of item. It allows for some neat stuff. Good job.

Falcon

*picks Modern's pocket*

Now....what to do for the next script....

:)

sweet.  :D
can't wait to see more!

Watch out for: HaloOfTheSun

Falcon


ChaosSpartan28

#5
Quote from: Falcon on August 26, 2007, 10:31:52 PM
Well, I'll be stealing Modern's idea of posting simple scripts in one topic, so here are my simple scripts.


[spoiler=Map BGM carry through battle]
Replace the battle call method with this in Scene_Map. Change the switch to whatever switch you want to trigger then BGM.
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    if $game_switches[1] == false
      # Memorize map BGM and stop BGM
      $game_temp.map_bgm = $game_system.playing_bgm
      $game_system.bgm_stop
      # Play battle start SE
      $game_system.se_play($data_system.battle_start_se)
      # Play battle BGM
      $game_system.bgm_play($game_system.battle_bgm)
    else
      # Play battle start SE
      $game_system.se_play($data_system.battle_start_se)
      $game_temp.map_bgm = $game_system.playing_bgm
    end
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end

Free to use in any project without giving me credit.[/spoiler]



Nice. I think I requested something like this either last year or sometime around january but no one could figure it out.
When you say "carry through" do you mean that the Map BGM will play through the fight as well or it will pick-up where it left off before the fight.

Either way, thanks Falcon. I needed this for a game I am working on for my senior project at school.
Sig by MacGravel

Falcon

Pick-up where it left is not possible. If Blizzard couldn't do it, there's no way no one else would.

ChaosSpartan28

Quote from: Falcon on September 15, 2008, 12:08:37 AM
Pick-up where it left is not possible. If Blizzard couldn't do it, there's no way no one else would.

...appearantly, it is now.

http://www.hbgames.org/forums/index.php?topic=55486.0
Sig by MacGravel

Falcon

Yeah, someone posted that like, the day I said that, lol.

tSwitch

#9
Irony

edit: doesn't RMXP already support .ogg files?
nvm, fancy looping


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

Falcon


odomajiwuqi