Help - Search - Members - Calendar
Full Version: 2 small questions
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
MEands
1. Is there a way to set it so that when I start a new game, the title music continues playing through the opening cutscene? If I set the first stage to the same music, it just starts the song over.
2. Can I set the player's speed to slower than the normal speed without making an event?

Oh wait, I have one more question.
3. Is there a way to make your character's steps make noise?

Please do not double post, use the edit button instead. ~Redd
Penguin
1. Script.
2. Probably not.
3. Script.

I think you should look in the master script list for this stuff, because you can't do any of these things easily, normally.
MEands
Well of course it's script. I was hoping somebody with actual scripting knowledge could help me out...
The Law G14
1. Is the intro in its own map? I'll need to know that when making the script.

2. Here's the script I made for it, instructions at the top:

Move Speed Script
CODE
#==============================================================================
# Title: Move Speed | Version 1.0
# Author: TheLawG14 [aka. TheScripter]
# Requester: MEands
#==============================================================================


#==============================================================================
# ** Move_Speed_Custom [CUSTOMIZATION WITHIN THIS MODULE]
#------------------------------------------------------------------------------
#  This module contains the main customization within the script
#==============================================================================

module Move_Speed_Custom

  # Change speed of character HERE, 1 = lowest, 6 = highest
  Speed = 3
  
end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias scripter_game_character_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Call original method
    scripter_game_character_initialize
    # Move Speed of character
    @move_speed = Move_Speed_Custom::Speed
  end
end



3. Instructions in the script:

Character Steps
CODE
#==============================================================================
# Title: Character Steps | Version 1.0
# Author: TheLawG14 [aka. TheScripter]
# Requester: MEands
#==============================================================================

#==============================================================================
# ** Steps_Custom [CUSTOMIZATION WITHIN THIS MODULE]
#------------------------------------------------------------------------------
#  This module contains the main customization within the script
#==============================================================================

module Steps_Custom

  # SE file (Change "001-System01" to whatever SE file you'd like)
  File = "001-System01"
  
  # If this value is set to true, then only the main character will get a
  # SE while walking
  Only_Player = false
  
end


#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias scripter_game_player_move_down move_down
  alias scripter_game_player_move_left move_left
  alias scripter_game_player_move_right move_right
  alias scripter_game_player_move_up move_up
  #--------------------------------------------------------------------------
  # * Play Sound Effect
  #--------------------------------------------------------------------------
  def play_sound_effect
    $game_system.se_play(RPG::AudioFile.new(Steps_Custom::File, 100, 100))
  end
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_down(turn_enabled = true)
    # Call original method
    scripter_game_player_move_down(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect
      end
    else
      play_sound_effect
    end
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_left(turn_enabled = true)
    # Call original method
    scripter_game_player_move_left(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect
      end
    else
      play_sound_effect
    end
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_right(turn_enabled = true)
    # Call original method
    scripter_game_player_move_right(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect
      end
    else
      play_sound_effect
    end
  end
  #--------------------------------------------------------------------------
  # * Move up
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_up(turn_enabled = true)
    # Call original method
    scripter_game_player_move_up(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect
      end
    else
      play_sound_effect
    end    
  end
end

      
#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================

MEands
The game just begins in the first level, no cutscene or anything, I just want the music from the menu to continue playing when you enter.

Also, these scripts are great, the only problems is have are that when I run into a wall it repeatedly plays the stepping sound, and with the slower speed of the character, the steps don't match the player walking.
The Law G14
Oh, my bad about the wall thing and the bad timing of the SE, here's the fixed (should be fixed) version of the Character Steps Script:

Fixed Character Steps
CODE
#==============================================================================
# Title: Character Steps | Version 1.0
# Author: TheLawG14 [aka. TheScripter]
# Requester: MEands
#==============================================================================

#==============================================================================
# ** Steps_Custom [CUSTOMIZATION WITHIN THIS MODULE]
#------------------------------------------------------------------------------
#  This module contains the main customization within the script
#==============================================================================

module Steps_Custom

  # SE file (Change "001-System01" to whatever SE file you'd like)
  File = "001-System01"
  
  # If this value is set to true, then only the main character will get a
  # SE while walking
  Only_Player = true
  
end


#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias scripter_game_player_move_down move_down
  alias scripter_game_player_move_left move_left
  alias scripter_game_player_move_right move_right
  alias scripter_game_player_move_up move_up
  #--------------------------------------------------------------------------
  # * Play Sound Effect
  #--------------------------------------------------------------------------
  def play_sound_effect
    $game_system.se_play(RPG::AudioFile.new(Steps_Custom::File, 100, 100))
  end
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_down(turn_enabled = true)
    # Call original method
    scripter_game_player_move_down(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect if self.moving?
      end
    else
      play_sound_effect if self.moving?
    end
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_left(turn_enabled = true)
    # Call original method
    scripter_game_player_move_left(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect if self.moving?
      end
    else
      play_sound_effect if self.moving?
    end
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_right(turn_enabled = true)
    # Call original method
    scripter_game_player_move_right(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect if self.moving?
      end
    else
      play_sound_effect if self.moving?
    end
  end
  #--------------------------------------------------------------------------
  # * Move up
  #     turn_enabled : a flag permits direction change on that spot
  #--------------------------------------------------------------------------
  def move_up(turn_enabled = true)
    # Call original method
    scripter_game_player_move_up(turn_enabled = true)
    # Play sound effect with move animation
    if Steps_Custom::Only_Player == true
      if @character_name == $game_player.character_name
        play_sound_effect if self.moving?
      end
    else
      play_sound_effect if self.moving?
    end    
  end
end

      
#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================



And this script below makes it so that when you press New Game, the title BGM keeps playing.

Title BGM Edit
CODE
#==============================================================================
# Title: Title BGM Edit | Version 1.0
# Author: TheLawG14 [aka. TheScripter]
# Requester: MEands
#==============================================================================

#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  def command_new_game
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position
    $game_map.setup($data_system.start_map_id)
    # Move player to initial position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new
  end
end

#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================


MEands
Ooh, thanks. This helps, the steps aren't all the way in sync, but that's okay.
Thanks a lot for the help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.