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
> Drum Script, This is a drum set that enables you to play a drum!
Sniper308
post Aug 23 2008, 12:14 PM
Post #1


Level 5
Group Icon

Group: Member
Posts: 71
Type: Artist
RM Skill: Advanced




Hello! I am releasing a script that is pretty new and is easy to use! THIS IS NOT MY SCRIPT! READ THE "CREDIT AND THANKS".
If you have trouble with the link somehow, look below!


Link: Beran's Interactive Drumkit Script
Features:
* Easy to set up
* Can customize drum-sounds however you like
* Graphics included
* Fully lagfree
Screenshot:
[Show/Hide] Screenshot

Demo: Here
Version: v1.00
Instructions: In the script. NOTE: Audiofiles and images can be obtained in the demo, this script won't function properly without them.
Compatibility: This script does not rewrite any standard methods and does not make use of its own global variables. It should be compatible with anything out there, including the SDK
Credits and Thanks:
* Berans - Creating the script and demo
* Sniper308 - For Providing the graphics for the script
Script:
CODE
#==============================================================================
#==============================================================================
#Berans' "Interactive drumkit" script v1.00
#Last edited: 21 August 2008
#
#------------------------------------------------------------------------------
#
#This script creates an "interactive drumkit" allowing you to play some nice
#beats within your game. It's easy to adapt to your own liking to create
#many different sounds
#
#Credits: Berans    - Making the script
#         Sniper308 - Providing the graphics and idea for the script
#------------------------------------------------------------------------------
#Features
#------------------------------------------------------------------------------
# -Easy set-up
# -Can change drum sounds to anything you like
# -comes with nice graphics
# -Fully lagfree
#------------------------------------------------------------------------------
#Compatibility
#------------------------------------------------------------------------------
#This script does not rewrite any standard methods and does not use any global
#variables. Should be compatible with anything, including the SDK
#
#==============================================================================
#Instructions
#==============================================================================
#
#------------------------------------------------------------------------------
#Setup
#------------------------------------------------------------------------------
# -Download the demo if the script was obtained separately
# -Copy the Audio files in Audio/SE to your own project, and make sure the names
#  stay the same. You can provide your own Audio files, but they must be called
#  "Tom-1","Tom-2","Tom-3","Hi-Hat" and "Bassdrum" respectively
# -Copy the picture files in Graphics/Pictures to your own project, making sure
#  the names stay the same. You can easily change the color of the "lighting"
#  effect by changing the color of the objects in "DrumsLights"
# -Import the picture files into your game, making white transparant in both
#  files, clearing the semi-transparant color for "Rock Band Drums" and making
#  the color of the main objects in "DrumsLights" semi-transparant
#
#------------------------------------------------------------------------------
#Using the script
#------------------------------------------------------------------------------
#To call the script, use the "script" command within any event.
#In the script write "$scene = Scene_Drums.new", without the quotes
#==============================================================================
#==============================================================================

#==============================================================================
#**Scene_Drums
#------------------------------------------------------------------------------
#This class handles processing for the drums screen
#==============================================================================
class Scene_Drums
  
  #----------------------------------------------------------------------------
  #*Main processing
  #----------------------------------------------------------------------------
  def main
    #Memorize Map/Menu BGM
    $game_system.bgm_memorize
    #Fade out BGM
    $game_system.bgm_fade(2)
    #Memorize Map/Menu BGS
    $game_system.bgs_memorize
    #Fade out BGS
    $game_system.bgs_fade(2)
    #This keeps track of the animation frames for the drum's lighting effects
    @animation = []
    #create a value for @animation for each drum
    for i in 0...5
      @animation.push(-1)
    end
    #Create spritesets
    @spriteset = Spriteset_Map.new
    @drums = Spriteset_Drums.new
    #Create windows
    @help_window = Window_Drumshelp.new
    @drumdummy = Drum_Dummy.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @spriteset.dispose
    @drums.dispose
    @drumdummy.dispose
    #Restore Map/Menu BGM
    $game_system.bgm_restore
    #Restore Map/Menu BGS
    $game_system.bgs_restore
  end
  
  #----------------------------------------------------------------------------
  #*Frame update
  #----------------------------------------------------------------------------
  def update
    if Input.trigger?(Input::B)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::F5)
      Audio.se_play("Audio/SE/Tom-1",100,100)
      @animation[0] = 0
      @drumdummy.refresh(0)
    end
    if Input.trigger?(Input::F6)
      Audio.se_play("Audio/SE/Tom-2",100,100)
      @animation[1] = 0
      @drumdummy.refresh(1)
    end
    if Input.trigger?(Input::F7)
      Audio.se_play("Audio/SE/Tom-3",100,100)
      @animation[2] = 0
      @drumdummy.refresh(2)
    end
    if Input.trigger?(Input::F8)
      Audio.se_play("Audio/SE/Hi-Hat",100,100)
      @animation[3] = 0
      @drumdummy.refresh(3)
    end
    if Input.trigger?(Input::C)
      Audio.se_play("Audio/SE/Bassdrum",100,100)
      @animation[4] = 0
      @drumdummy.refresh(4)
    end
    #update lighting effects
    animation
  end
  
  #----------------------------------------------------------------------------
  #*animation
  #----------------------------------------------------------------------------
  #Takes care of animating the drum's lighting effects
  #----------------------------------------------------------------------------
  def animation
    for i in 0...@animation.size
      if @animation[i] == 0
        #Create lighting effect for the drum
        @drumdummy.refresh(i)
      end
      unless @animation[i] == -1
        #Progress a frame
        @animation[i] += 1
        if @animation[i] == 10
          #Remove lighting effect
          @drumdummy.clear(i)
          @animation[i] = -1
        end
      end
    end
  end
end


#==============================================================================
#**Window_Drumshelp
#------------------------------------------------------------------------------
#Help window displaying the different input possibilities
#==============================================================================

class Window_Drumshelp < Window_Base
  
  #----------------------------------------------------------------------------
  #*Object initialization
  #----------------------------------------------------------------------------
  def initialize
    super(0,0,640,64)
    self.contents = Bitmap.new(width - 32, height - 32)
    text = ["F5: Drum 1", "F6: Drum 2", "F7: Drum 3", "F8: Hi-Hat", "Enter: Bass"]
    w = self.contents.width/text.size
    for i in 0...text.size
      self.contents.draw_text(i * w,0,w,32,text[i],1)
    end
  end
end


#==============================================================================
#**Spriteset_Drums
#------------------------------------------------------------------------------
#This class takes care of drawing the drum's graphics onscreen
#==============================================================================

class Spriteset_Drums
  
  #----------------------------------------------------------------------------
  #*Object initialization
  #----------------------------------------------------------------------------
  def initialize
    @viewport = Viewport.new(35,95,640,480)
    @viewport.z = 5000
    @sprite = Sprite.new(@viewport)
    @drums = RPG::Cache.picture('Rock Band Drums.png')
    @sprite.bitmap = @drums
  end
  
  #----------------------------------------------------------------------------
  #*Dispose
  #----------------------------------------------------------------------------
  def dispose
    @viewport.dispose
    @sprite.dispose
  end
end


#==============================================================================
#**Drum_Dummy
#------------------------------------------------------------------------------
#This class draws the drum's lighting effects
#==============================================================================

class Drum_Dummy
  
  #----------------------------------------------------------------------------
  #*Object initialization
  #----------------------------------------------------------------------------
  def initialize
    @sprite = []
    @lights = RPG::Cache.picture('DrumsLights')
    #Create a rect for the drums and pedal
    @rect = Rect.new(1,1,130,130)
    @rect2 = Rect.new(1,134,130,130)
    #create a new bitmap for each drum's lighting effect
    for i in 0...5
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = Bitmap.new(640,480)
      @sprite[i].z = 9999
      @sprite[i].visible = false
    end
  end
  
  #----------------------------------------------------------------------------
  #*Refresh
  #----------------------------------------------------------------------------
  def refresh(drum)
    #Clear lighting effect to avoid overlap
    @sprite[drum].bitmap.clear
    case drum
    #Get coordinates based on drum
    when 0
      x = 43
      y = 198
    when 1
      x = 170
      y = 99
    when 2
      x = 335
      y = 99
    when 3
      x = 462
      y = 198
    when 4
      x = 255
      y = 371
    end
    #Create correct effect in the given bitmap
    if drum == 4 ? @sprite[drum].bitmap.blt(x,y,@lights,@rect2) :
                   @sprite[drum].bitmap.blt(x,y,@lights,@rect)
    end
    #Make lighting effect visible            
    @sprite[drum].visible = true
  end
  
  #----------------------------------------------------------------------------
  #*Dispose
  #----------------------------------------------------------------------------
  def dispose
    for i in 0...@sprite.size
      @sprite[i].dispose
    end
  end
  
  #----------------------------------------------------------------------------
  #*clear
  #----------------------------------------------------------------------------
  #Removes the specified drum's lighting effect when called
  #----------------------------------------------------------------------------
  def clear(drum)
    @sprite[drum].bitmap.clear
  end
end


All Beran requires is some feedback! So post your feedback and give credit here when using! smile.gif Enjoy!
Go to the top of the page
 
+Quote Post
   
Hairo
post Aug 30 2008, 12:24 PM
Post #2



Group Icon

Group: Member
Posts: 2
Type: Scripter
RM Skill: Advanced




That's Epic...
Go to the top of the page
 
+Quote Post
   
Omegas7
post Aug 30 2008, 03:49 PM
Post #3


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Rock... Band?


__________________________
Go to the top of the page
 
+Quote Post
   
Sniper308
post Sep 3 2008, 01:51 PM
Post #4


Level 5
Group Icon

Group: Member
Posts: 71
Type: Artist
RM Skill: Advanced




lol
Go to the top of the page
 
+Quote Post
   
GappieMikan
post Sep 7 2008, 02:34 PM
Post #5


Mistress of All Cosmos
Group Icon

Group: Revolutionary
Posts: 456
Type: Developer
RM Skill: Skilled




Looks Good for a Minigame


__________________________

Coming soon... "Katamari: The Tale of the Cosmic Realm"

Clicky!

Achievements get:
*Create a Katamari with snow
*Meet the King of All Cosmos in dreams
*Feel the Cosmos like Michiru's


Go to the top of the page
 
+Quote Post
   
Sniper308
post Sep 19 2008, 05:49 PM
Post #6


Level 5
Group Icon

Group: Member
Posts: 71
Type: Artist
RM Skill: Advanced




QUOTE (Pipokary @ Sep 7 2008, 02:56 PM) *
Looks Good for a Minigame

It's one thing that I use to keep your mind off the storyline in case the storyline does get boring! thumbsup.gif
Go to the top of the page
 
+Quote Post
   
jniblick22
post Sep 27 2008, 04:00 PM
Post #7


Level 1
Group Icon

Group: Member
Posts: 6
Type: Event Designer
RM Skill: Skilled




How would you use this kind of thing for a puzzle cause I think it would make a great puzzle.
Go to the top of the page
 
+Quote Post
   
Achilles
post Sep 27 2008, 04:32 PM
Post #8


I can (usually) answer any event based question!
Group Icon

Group: Revolutionary
Posts: 381
Type: Scripter
RM Skill: Masterful




The drum graphic is a little...MS paintish. I dont mean to slam the illustrator, but would you be interested in some more high quality graphics?


__________________________
Go to the top of the page
 
+Quote Post
   
Sniper308
post Oct 5 2008, 04:47 PM
Post #9


Level 5
Group Icon

Group: Member
Posts: 71
Type: Artist
RM Skill: Advanced




@jniblick22: Well Beran created this way that you need to call script and put in certain keys, if you press them right, it activates a switch. You're going to have to ask Beran himself on the site. wink.gif

@Achilles: Well it's a example, you can create something very similar to it and replace the original or you can just simply add more graphics to make it look non MS Paint. happy.gif
Go to the top of the page
 
+Quote Post
   
DrakeOneil
post Oct 15 2008, 03:10 PM
Post #10


Level 5
Group Icon

Group: Member
Posts: 71
Type: Developer
RM Skill: Advanced




Dude I have been looking for something like this for ages! Thnx!

_________________________________________
Play my online game!
Dragon Alliance set the Server IP to 5000 if you cannot get on.

This post has been edited by DrakeOneil: Oct 17 2008, 08:35 AM


__________________________
Time will always go on,
Will you?
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: 19th May 2013 - 06:06 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker