KStolenBGM XP
#1
KStolenBGM XP

by Kyonides

Introduction

This simple scriptlet allows you to make the game, namely the NPC or the narrator or somebody else, to refuse to play the BGM or BGS that have been stolen so far.

It includes both script calls for stealing or releasing the BGM and BGS during gameplay.

You might need to delete old saved games to prevent the game from crashing. (It won't be able to find the new variables I've created there.)

The Script

Code:
# * KStolenBGM XP * #
#   Scripter : Kyonides
#   v0.5.0 - 2026-06-19

# Let your game steal BGM and BGS from your players!
# This means that the game won't be able to play them unless they do
# something about it! Oh my!

# * Script Calls * #

# - Steal a BGM:
# $game_system.steal_bgm!(OptionalMapID)

# - Steal a BGS:
# $game_system.steal_bgs!(OptionalMapID)

# - Release a BGM:
# $game_system.free_bgm!(OptionalMapID)

# - Release a BGS:
# $game_system.free_bgs!(OptionalMapID)

class Game_System
  alias :kyon_stolen_bgm_gm_sys_init :initialize
  alias :kyon_stolen_bgm_gm_sys_bgm_play :bgm_play
  alias :kyon_stolen_bgm_gm_sys_bgs_play :bgs_play
  def initialize
    kyon_stolen_bgm_gm_sys_init
    @stolen_bgm = []
    @stolen_bgs = []
  end

  def bgm_play(bgm)
    if $game_map and @stolen_bgm.include?($game_map.map_id)
      bgm = nil
    end
    kyon_stolen_bgm_gm_sys_bgm_play(bgm)
  end

  def steal_bgm!(map_id=nil)
    map_id ||= $game_map.map_id
    @stolen_bgm |= [map_id]
    @stolen_bgm = @stolen_bgm.sort
    map_id
  end

  def free_bgm!(map_id=nil)
    map_id ||= $game_map.map_id
    @stolen_bgm.delete(map_id)
  end

  def bgs_play(bgs)
    if $game_map and @stolen_bgs.include?($game_map.map_id)
      bgm = nil
    end
    kyon_stolen_bgm_gm_sys_bgs_play(bgs)
  end

  def steal_bgs!(map_id=nil)
    map_id ||= $game_map.map_id
    @stolen_bgs |= [map_id]
    @stolen_bgs = @stolen_bgs.sort
    map_id
  end

  def free_bgs!(map_id=nil)
    map_id ||= $game_map.map_id
    @stolen_bgs.delete(map_id)
  end
  attr_reader :stolen_bgm, :stolen_bgs
end
Terms & Conditions

Under the MIT License.
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply


Messages In This Thread
KStolenBGM XP - by kyonides - 7 hours ago



Users browsing this thread: 1 Guest(s)