Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Fantasist on January 08, 2008, 01:39:05 pm

Title: [XP] Multiple Starting Points
Post by: Fantasist on January 08, 2008, 01:39:05 pm
Multiple Starting Points
Authors: Fantasist
Version: 1.1
Type: Game mode enhancement
Key Term: Misc Add-on



Introduction

When 'New Game' option is selected, a new sub-menu is opened, where the player can choose from different modes. Each mode starts in a different map.


Features




Screenshots

Just try it out, It comes with example config (starts the game in the same map at 2 different positions).


Demo

http://www.sendspace.com/file/fpsy0q


Script

Place this script above 'Main'. If you're using any other scripts, all of them should come BELOW this script.

#==============================================================================
# ** Multiple Starting Points
#------------------------------------------------------------------------------
# by Fantasist
# Version 1.1
# 3-July-2009
#------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First release
#   1.1 - Improved compatibility and fixed off-screen window
#------------------------------------------------------------------------------
# Description:
#
#           When 'New Game' option is selected, a new sub-menu is
#   opened, where the player can chose from different modes. Each
#   mode starts in a different map.
#------------------------------------------------------------------------------
# Compatibility:
#
#           There might be issues with other scripts which modify Scene_Title.
#   This script should be placed ABOVE any other custom scripts if used.
#------------------------------------------------------------------------------
# Instructions:
#
#           Place this script above 'Main'. If you're using any other
#   scripts, all of them should come BELOW this script.
#------------------------------------------------------------------------------
# Configuration:
#
#   Scroll down a bit and you will find the configuration options. They are
#   already set to example values so you understand how to use them.  
#
#   GameModes: GameModes is an array of names of all the gamemodes you use.
#              Name of each mode should be enclosed in quotes ("like this").
#              Different modes should be seperated by commas.
#
#   MapIDs: For each game mode, you should specify the starting map ID here.
#           The order of map IDs match the order of the GameModes defined.
#
#   MapPos: For each mode, you should set the starting point on the map.
#           This is similar to 'Set Start Position' command. To know the
#           coordinates, go to the required map and use the event command
#           'Teleport'. After chosing the start position on the required map,
#           two numbers will be displayed on the top-right corner of the
#           window. These numbers are your starting positions.
#
#   MaxModes: This setting limits the size of the mode selection window.
#             For example, if there are 5 modes and you only want to display
#             3 at a time, you set MaxModes to 3.
#------------------------------------------------------------------------------
# Issues:
#
#    - DO NOT leave the above three arrays empty (none should be []). Just
#      don't use this script if you want to disable it, this won't work with
#      0 modes.
#------------------------------------------------------------------------------
# Credits and Thanks:
#
#    Credit me (Fantasist) for making this, IF you want to.
#------------------------------------------------------------------------------
# Notes:
#
#    If you have a problem or suggestion, you can find me at
#    www.chaos-project.com
#    Enjoy ^_^
#==============================================================================

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
 
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # Configuration Begin
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
 GameModes = ['Map-1', 'Map-2', 'Map-3', 'Map-4', 'Map-5']
 
 MapIDs = [1, 2, 3, 4, 5]
 
 MapPos = [ [5, 10], [7, 10], [9, 10], [11, 10], [13, 10] ]
 
 MaxModes = 3
 
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # Configuration End
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
 alias fts_MSP_title_main main
 def main
   if $BTEST
     battle_test
     return
   end
   # Load required stuff for window
   $data_system = load_data('Data/System.rxdata')
   $game_system = Game_System.new
   # Determine window width
   b = Bitmap.new(1, 1)
   w = 0
   for string in GameModes
     tmp = b.text_size(string).width + 32
     w = tmp if tmp > w
   end
   b.dispose
   w = [w, 192].max
   # Make window
   @mode_win = Window_Command.new(w, GameModes)
   @mode_win.height = [32 + MaxModes * 32, 32 + GameModes.size * 32].min
   @mode_win.back_opacity = 160
   @mode_win.x, @mode_win.y = 320 - @mode_win.width / 2, 288
   @mode_win.active = @mode_win.visible = false
   # Execute normal
   fts_MSP_title_main
   # Dispose window
   @mode_win.dispose
 end
 
 def update
   if @command_window.active
     update_command
   elsif @mode_win.active
     update_mode
   end
 end
 
 def update_command
   @command_window.update
   if Input.trigger?(Input::C)
     case @command_window.index
     when 0
       Graphics.freeze
       @command_window.visible = @command_window.active = false
       @mode_win.active = @mode_win.visible = true
       Graphics.transition(5)
     when 1
       command_continue
     when 2
       command_shutdown
     end
   end
 end
 
 def update_mode
   @mode_win.update
   if Input.trigger?(Input::C)
     i = @mode_win.index
     start(MapIDs[i], MapPos[i][0], MapPos[i][1])
   elsif Input.trigger?(Input::B)
     Graphics.freeze
     @mode_win.visible = @mode_win.active = false
     @command_window.active = @command_window.visible = true
     Graphics.transition(5)
   end
 end
 
 def start(id, x, y)
   $game_system.se_play($data_system.decision_se)
   Audio.bgm_stop
   Graphics.frame_count = 0
   $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
   $game_party.setup_starting_members
   $game_map.setup(id)
   $game_player.moveto(x, y)
   $game_player.refresh
   $game_map.autoplay
   $game_map.update
   $scene = Scene_Map.new
 end
 
end



Instructions

GameModes:
  GameModes is an array of names of all the gamemodes you use. Name of each mode should be enclosed in quotes ("like this"). Different modes should be seperated by commas.

MapIDs:
  For each game mode, you should specify the starting map ID here. The order of map IDs match the order of the GameModes defined.

MapPos:
  For each mode, you should set the starting point on the map. This is similar to 'Set Start Position' command. To know the coordinates, go to the required map and use the event command 'Teleport'. After chosing the start position on the required map, two numbers will be displayed on the top-right corner of the window. These numbers are your starting positions.

MaxModes:
  This setting limits the size of the mode selection window. For example, if there are 5 modes and you only want to display 3 at a time, you set MaxModes to 3.


Issues



Compatibility

There might be issues with other scripts which tamper Scene_Title. This script should be placed ABOVE any other custom scripts if used.


Credits and Thanks

Credit me (Fantasist) for making this, IF you want to.



Author's Notes

This can be very easily done with events, but for those who wanted the mode selection in the title screen, this is the script.

If you have a problem or suggestion, you can find me at:

- www.chaos-project.com

Enjoy ^_^
Title: Re: Multiple Starting Points
Post by: shdwlink1993 on January 19, 2008, 11:00:33 pm
Hello. First of all, Fantasist, I have to say that this is a really good script. I'm just having a bit of a problem with it. Whenever I try loading a character (any character), it says that the map in question does not exist.

Here's the information on what I have in:

Script Customization
GameModes = ['Player1', 'Player2']
MapIDs = [003, 10]
MapPos = [ [0, 16], [0, 1] ]

Error message is: Unable to find file Data/Map  3.rxdata. (Yes, there were several spaces between Map and 3)

I've checked the folder, and I can see the file is called Map003.rxdata. Can you help me with this?
Title: Re: Multiple Starting Points
Post by: Sally on January 19, 2008, 11:17:36 pm
this is an awsome script, i will make a demo!

ad maby you should make it so a mode can be unlocked like an extra mode? only can be played after u ge tot chapter 4 in the story mode? gl ^^

@shdwlink1993: i will look into it but dont expect much from me im not a scripter.

EDIT:
AHAH! i found out ur problem!

i think...


from:
Script Customization
GameModes = ['Player1', 'Player2']
MapIDs = [003, 10]
MapPos = [ [0, 16], [0, 1] ]


to

Script Customization
GameModes = ['Player1', 'Player2']
MapIDs = [3, 10]
MapPos = [ [0, 16], [0, 1] ]


try that and see if it works :)

EDIT2:

if that dosent work try replaceing the script and make sure it is right abuv main.

EDIT3:

i was just looking at the script...

check this out

#           Place this script above 'Main'. If you're using any other
# scripts, all of them should come BELOW this script.


EDIT4:

Okay demo made! it works fine!!! :) gotta say fant awsome script.

download:
http://files.filefront.com/Multiple+Starting+Pointsrar/;9468412;/fileinfo.html
Title: Re: Multiple Starting Points
Post by: shdwlink1993 on January 19, 2008, 11:38:08 pm
Sorry about that. The problem was that the game couldn't run a different script called Tileset Swap. A shame too. Oh well. I have too many scripts in this thing, so one less will make it easier to work with.

@Susys: Thanks for helping. It's so nice when you make one post (your first) in a forum and someone helps you out in 20 minutes.
Title: Re: Multiple Starting Points
Post by: Sally on January 19, 2008, 11:39:49 pm
hehe, im always up for helping someone ^^
Title: Re: Multiple Starting Points
Post by: Fantasist on January 20, 2008, 12:50:00 pm
@shdwlink: Thanks that you think this script is good :) On to your problem:

1. Yeah, map name 003 won't work but just 3 does, Susys took care of thet  ^_^
2. As far as I know, this should work with a Tileset Swap script. You DID place this script above that one, didn't you?

@Susys: Thanks, and about the 'unlocking' thing, I've planned on doing it but sometime later I guess. And thanks for the demo Susys, checking it out now :)
Title: Re: Multiple Starting Points
Post by: Sally on January 20, 2008, 06:48:58 pm
hehe fant i bacually said all of that in my post :P with my edits :)

glad u like the demo! :) i liek to help ppl
Title: Re: [XP] Multiple Starting Points
Post by: Fantasist on July 05, 2009, 01:57:03 pm
Updated to v1.1
Title: Re: [XP] Multiple Starting Points
Post by: G_G on July 05, 2009, 02:26:17 pm
FANTASIST YOU'RE BACK!!! (somewhat xD)
Title: Re: [XP] Multiple Starting Points
Post by: Fantasist on July 05, 2009, 02:36:35 pm
More or less, yeah :D
Title: Re: [XP] Multiple Starting Points
Post by: Juan on July 05, 2009, 09:06:18 pm
Welcome Back Bud. I'll go test this. Mind telling me what was changed?
Title: Re: [XP] Multiple Starting Points
Post by: G_G on July 05, 2009, 10:29:49 pm
#------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First release
#   1.1 - Improved compatibility and fixed off-screen window

Its in the script
Title: Re: [XP] Multiple Starting Points
Post by: Fantasist on July 06, 2009, 12:09:32 pm
Yeah, not much, but at least it's 100% working now ^.^