Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> Request: Travel Menu for XP
VEE99
post Jan 16 2012, 12:14 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 6
Type: Developer
RM Skill: Skilled




I was wondering if there was a script for XP that allowed me to make warp points from which the player can travel. As in, from one warp point to another, in a manner similar to Fly in pokemon or the Song of Soaring in Zelda majoras mask. preferrably if the player has already been to said warp point.
Ps: i tried Trickster's travel menu. It is just what i needed, but unfortunately it's incompatible with other scripts already in my game.
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Jan 16 2012, 12:48 PM
Post #2


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




You could try this...

CODE
#--------------------------------------------------------------------------
#-#------------------------------------------------------------------------
# #   Jens of Zanicuud teleport scene v 1.0
# #   -free use, just credit
# #   -free customization, however, posting on RRR the modified version is
# #    mandatory
# #   -you can find me on www.rpgrevolution.com
#-#------------------------------------------------------------------------
#--------------------------------------------------------------------------

TELEPORT_SE = "143-Support01" #teleport sound effect (should be a file in Audio/SE folder)

MAPS_H = {
9 => [26,11],  
31 => [11,5] ,
56 => [33,15],
97 =>[24,24],  
}    

#==============================================================================
# # Game_System
#------------------------------------------------------------------------------
#==============================================================================
class Game_System
  attr_accessor :maps_visited
  alias joz3_initialize initialize
  def initialize
    @maps_visited = []
    joz3_initialize
  end
end

#==============================================================================
# # Game_Map
#------------------------------------------------------------------------------
#==============================================================================
class Game_Map
  alias joz3_setup setup
  def setup(map_id)
    if not $game_system.maps_visited.include?(map_id)
    $game_system.maps_visited.push(map_id)
    end
    joz3_setup(map_id)
  end
end
#==============================================================================
## Window_Teleport
#------------------------------------------------------------------------------
#==============================================================================

class Window_Teleport < Window_Selectable
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 368, 416)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for map in MAPS_H.keys
      @data.push(map) if (map != $game_map.map_id and  $game_system.maps_visited.include?(map))
  end

    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  #draw_item
  #    
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
     self.contents.font.color = normal_color
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    map_name = load_data('Data/MapInfos.rxdata')[item].name
    self.contents.draw_text(x + 28, y, 212, 32, map_name, 0)
  end
  def update_help
    end
end

class Teleport
  #--------------------------------------------------------------------------
  # class Teleport
  #--------------------------------------------------------------------------
  def main
    
    @help_window = Window_Help.new

    @dummy_window = Window_Base.new(368, 64, 272, 416)
  
    @teleport_window = Window_Teleport.new
    @teleport_window.active = true
    @teleport_window.visible = true
    @teleport_window.help_window = @help_window
    @wait = 0
  
    @help_window.set_text("Where do you want to go?")
  Graphics.transition
  
    loop do
    
      Graphics.update
    
      Input.update
    
      update
    
      if $scene != self
        break
  end
  
    end

    Graphics.freeze
    
    @help_window.dispose
    @dummy_window.dispose
    @teleport_window.dispose
  end
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    # windows update
    @help_window.update
    @dummy_window.update
    @teleport_window.update
     update_teleport
  end
  #--------------------------------------------------------------------------
  # update_choice
  #--------------------------------------------------------------------------
  def update_teleport
    #input_update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    # input decision
    if Input.trigger?(Input::C)
      Audio.se_play("Audio/SE/" + TELEPORT_SE)
      @teleport_window.active = false
      @teleport_window.visible = true
      $game_map.need_refresh = true
      $game_map.setup(@teleport_window.item)
      item = @teleport_window.item
      $game_player.moveto(MAPS_H[item][0], MAPS_H[item][1])
      $game_player.straighten
      $game_player.turn_down
      $game_map.update
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      Graphics.transition(20)
    end
    $game_map.autoplay
    Graphics.frame_reset
    Input.update
    $scene = Scene_Map.new
    end
  end
end


HOW TO USE IT:

MAPS_H is the main array you need.
It's structured in this way:

MAPS_H = {
map_id => [teleport x coordinate, teleport y coordinate],
map_id => [teleport x coordinate, teleport y coordinate],
map_id => [teleport x coordinate, teleport y coordinate],
}

TELEPORT_SE is the sound effect you want to hear when teleporting.
It should be a sound file placed in Audio/SE folder.

A map will become available if and only if you have visited it before.
Unfortunately, you should start a new game, since I've modified Game_System.

To start the scene, just call a script like this:

CODE
$scene = Teleport.new


I hope this can help, ask for troubleshooting anytime.

I've not done enough testing, so there could be some bug...

EDIT: script fixed

Jens

This post has been edited by Jens of Zanicuud: Jan 17 2012, 06:01 AM


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
VEE99
post Jan 16 2012, 01:32 PM
Post #3


Level 1
Group Icon

Group: Member
Posts: 6
Type: Developer
RM Skill: Skilled




Tried it on a brand new project, with no other scripts that might mess it up. And it doesn't seem to be working...

Script 'Teleport' line 80: NoMethodError occurred.
undefined method 'include?' for nil:NilClass

By the way, what's up with the �€€�‚��ƒ��ƒƒ�?
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jan 16 2012, 01:33 PM
Post #4


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Moving to Script Requests.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
VEE99
post Jan 16 2012, 09:49 PM
Post #5


Level 1
Group Icon

Group: Member
Posts: 6
Type: Developer
RM Skill: Skilled




Solved! I found what I needed and THANK GOODNESS it's completely compatible with my game. Had to start a new save file to get it to work and I had sunk 6 hours into it, but oh well.
The script I'm talking about is Arevulopapo's Waypoint script. Easy to set up and completely compatible with Mr. Mo's ABS.
What does it do? You make an event, say, a statue. Said statue acts as a waypoint. Once you interact with it a menu opens up displaying available waypoints. If you've been to a map with said waypoint you can travel to it. The menu can even sort waypoints into cathegories. By default, Act I, Act II. and so on. I'll sort them into towns, dungeons, continents and islands, for example.

Here's said script in case anyone else is looking for it:

SCRIPT
#=========================================================================
=====
# Diablo 2 Waypoints v. 1.1
# by arevulopapo
# Mar 1st 2007
#
#
# To call the Waypoint scene use the "Call script" event command:
# $scene = Scene_Waypoint.new(parameter)
# where 'parameter' is the index of the waypoint you're using.
#
# If you want to activate a waypoint without "touching" it
# call a script like this:
# $game_system.waypoints_active << index
# where 'index' is the index of the waypoint you want to activate.
#
# See the comments in the Game_System section (right below)
# for informations on how to customize.
#
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
attr_accessor :acts
attr_accessor :act_names
attr_accessor :waypoints_active
attr_accessor :waypoint_sound
#--------------------------------------------------------------------------
alias game_system_initialize initialize
#--------------------------------------------------------------------------
def initialize
#--------------------------------------------------------------------------
# Here you can change the sound played while teleporting
#--------------------------------------------------------------------------
@waypoint_sound = "Audio/SE/020-Teleport03"
#--------------------------------------------------------------------------
@acts = []
@act_names = []
@waypoints_active = []
#--------------------------------------------------------------------------
# Here you add the names for the acts. The number of acts will be equal
# to the number of names you added.
#--------------------------------------------------------------------------
@act_names << "Act I"
@act_names << "Act II"
@act_names << "Act III"
@act_names << "Act IV"
#--------------------------------------------------------------------------
for i in 0..@act_names.size - 1
@acts << []
@waypoints_active << []
end
#--------------------------------------------------------------------------
# Here you add new waypoints. The formula is like this
# ["Name", map_id, player_x, player_y]. The number in [] of @acts is
# the index of the act you're adding a waypoint to.
#--------------------------------------------------------------------------
@acts[0] << ["Forest I", 1, 46, 37] # This is the first waypoint. Its added to act 1 (with index 0) and its act index is 0.
@acts[0] << ["Forest II", 1, 19, 13] # This is the second waypoint added to act 1. Its act index is 1.
@acts[0] << ["Forest III", 3, 15, 11]
@acts[0] << ["Forest IV", 1, 11, 2]
@acts[0] << ["Forest V", 5, 17, 6]
@acts[0] << ["Forest VI", 5, 17, 6]

@acts[1] << ["Desert I", 9, 6, 7]
@acts[1] << ["Desert II", 10, 12, 6]
@acts[1] << ["Desert II", 11, 8, 3]
@acts[1] << ["Desert IV", 12, 19, 17]

@acts[2] << ["Swamp I", 13, 3, 5]
@acts[2] << ["Swamp II", 14, 3, 9]
@acts[2] << ["Swamp III", 15, 19, 15]
@acts[2] << ["Swamp IV", 16, 3, 12]

@acts[3] << ["Mountain I", 18, 20, 4]
@acts[3] << ["Mountain II", 19, 3, 14]
@acts[3] << ["Mountain III", 20, 6, 17]
@acts[3] << ["Mountain IV", 21, 3, 11]
@acts[3] << ["Mountain V", 22, 2, 20]
#--------------------------------------------------------------------------
game_system_initialize
end
#--------------------------------------------------------------------------
end
#==============================================================================
#==============================================================================
class Window_Waypoint_Name < Window_Base
#--------------------------------------------------------------------------
def initialize(act=0)
super(0,0,320,64)
self.contents = Bitmap.new(288,32)
self.back_opacity = 160
@act = act
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0..$game_system.act_names.size - 1
self.contents.font.color = (@act == i ? normal_color : disabled_color)
cell = 288/$game_system.act_names.size
self.contents.draw_text(i * cell,0,cell,32,$game_system.act_names[i],1)
end
end
#--------------------------------------------------------------------------
end
#==============================================================================
#==============================================================================
class Window_Waypoint_List < Window_Selectable
#--------------------------------------------------------------------------
def initialize(act, target_act, waypoint)
super(0, 64, 320, 416)
self.back_opacity = 160
@act = act
@target_act = target_act
@waypoint = waypoint
refresh
self.index = 0
end
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@item_max = $game_system.acts[@target_act].size
self.contents = Bitmap.new(288, @item_max * 32)
for i in 0..@item_max - 1
draw_item(i)
end
end
#--------------------------------------------------------------------------
def draw_item(index)
x = 0
y = (index) * 32
if $game_system.waypoints_active[@target_act].include?(index)
self.contents.font.color = normal_color
text = $game_system.acts[@target_act][index][0].to_s
else
self.contents.font.color = disabled_color
text = ". . ."
end
self.contents.draw_text(x, y, 288, 32, text, 1)
end
#--------------------------------------------------------------------------
end
#==============================================================================
#==============================================================================
class Scene_Waypoint
attr_reader :act
#--------------------------------------------------------------------------
def initialize(act, waypoint)
@waypoint = waypoint
@act = act
@target_act = act
$game_system.waypoints_active[@act] << @waypoint unless $game_system.waypoints_active.include?(@waypoint)
end
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@name_window = Window_Waypoint_Name.new(@act)
@list = Window_Waypoint_List.new(@act, @target_act, @waypoint)
@list.index = @waypoint
if $game_player.screen_x < 320
@name_window.x = 320
@list.x = 320
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@name_window.dispose
@list.dispose
end
#--------------------------------------------------------------------------
def update
@list.update
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@list.dispose
@list = Window_Waypoint_List.new(@act, (@target_act - 1) % $game_system.acts.size, @waypoint)
@name_window.dispose
@name_window = Window_Waypoint_Name.new((@target_act - 1) % $game_system.acts.size)
@target_act -= 1
@target_act %= $game_system.acts.size
if $game_player.screen_x < 320
@name_window.x = 320
@list.x = 320
end
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@list.dispose
@list = Window_Waypoint_List.new(@act, (@target_act + 1) % $game_system.acts.size, @waypoint)
@name_window.dispose
@name_window = Window_Waypoint_Name.new((@target_act + 1) % $game_system.acts.size)
@target_act += 1
@target_act %= $game_system.acts.size
if $game_player.screen_x < 320
@name_window.x = 320
@list.x = 320
end
end
if Input.trigger?(Input::C)
if $game_system.waypoints_active[@target_act].include?(@list.index)
Audio.se_play($game_system.waypoint_sound)
$game_screen.start_flash(Color.new(255,255,255,160), 5)
$game_map.setup($game_system.acts[@target_act][@list.index][1])
$game_player.moveto($game_system.acts[@target_act][@list.index][2], $game_system.acts[@target_act][@list.index][3])
$game_player.straighten
$game_map.update
$game_map.autoplay
$scene = Scene_Map.new
Graphics.transition(20)
else
$game_system.se_play($data_system.buzzer_se)
end
end
if Input.trigger?(Input::cool.gif
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
#--------------------------------------------------------------------------
end


Instructions for use are in the script. I hope it was useful.
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Jan 16 2012, 11:49 PM
Post #6


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




The odd symbols mean nothing...
They were old comments already present, not recognized by this form (I assume these were japanese characters...)
I actually made a mistake...
This is the correct code:

CODE
#--------------------------------------------------------------------------
#-#------------------------------------------------------------------------
# #   Jens of Zanicuud teleport scene v 1.0
# #   -free use, just credit
# #   -free customization, however, posting on RRR the modified version is
# #    mandatory
# #   -you can find me on www.rpgrevolution.com
#-#------------------------------------------------------------------------
#--------------------------------------------------------------------------

TELEPORT_SE = "143-Support01" #teleport sound effect (should be a file in Audio/SE folder)

MAPS_H = {
9 => [26,11],  
31 => [11,5] ,
56 => [33,15],
97 =>[24,24],  
}    

#==============================================================================
# # Game_System
#------------------------------------------------------------------------------
#==============================================================================
class Game_System
  attr_accessor :maps_visited
  alias joz3_initialize initialize
  def initialize
    @maps_visited = []
    joz3_initialize
  end
end

#==============================================================================
# # Game_Map
#------------------------------------------------------------------------------
#==============================================================================
class Game_Map
  alias joz3_setup setup
  def setup(map_id)
    if not $game_system.maps_visited.include?(map_id)
    $game_system.maps_visited.push(map_id)
    end
    joz3_setup(map_id)
  end
end
#==============================================================================
## Window_Teleport
#------------------------------------------------------------------------------
#==============================================================================

class Window_Teleport < Window_Selectable
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 368, 416)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for map in MAPS_H.keys
      @data.push(map) if (map != $game_map.map_id and  $game_system.maps_visited.include?(map))
  end

    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  #draw_item
  #    
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
     self.contents.font.color = normal_color
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    map_name = load_data('Data/MapInfos.rxdata')[item].name
    self.contents.draw_text(x + 28, y, 212, 32, map_name, 0)
  end
  def update_help
    end
end

class Teleport
  #--------------------------------------------------------------------------
  # class Teleport
  #--------------------------------------------------------------------------
  def main
    
    @help_window = Window_Help.new

    @dummy_window = Window_Base.new(368, 64, 272, 416)
  
    @teleport_window = Window_Teleport.new
    @teleport_window.active = true
    @teleport_window.visible = true
    @teleport_window.help_window = @help_window
    @wait = 0
  
    @help_window.set_text("Where do you want to go?")
  Graphics.transition
  
    loop do
    
      Graphics.update
    
      Input.update
    
      update
    
      if $scene != self
        break
  end
  
    end

    Graphics.freeze
    
    @help_window.dispose
    @dummy_window.dispose
    @teleport_window.dispose
  end
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    # windows update
    @help_window.update
    @dummy_window.update
    @teleport_window.update
     update_teleport
  end
  #--------------------------------------------------------------------------
  # update_choice
  #--------------------------------------------------------------------------
  def update_teleport
    #input_update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    # input decision
    if Input.trigger?(Input::C)
      Audio.se_play("Audio/SE/" + TELEPORT_SE)
      @teleport_window.active = false
      @teleport_window.visible = true
      $game_map.need_refresh = true
      $game_map.setup(@teleport_window.item)
      item = @teleport_window.item
      $game_player.moveto(MAPS_H[item][0], MAPS_H[item][1])
      $game_player.straighten
      $game_player.turn_down
      $game_map.update
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      Graphics.transition(20)
    end
    $game_map.autoplay
    Graphics.frame_reset
    Input.update
    $scene = Scene_Map.new
    end
  end
end


This is the bugless version.
I apologise for the mistake.

Jens

This post has been edited by Jens of Zanicuud: Jan 17 2012, 06:01 AM


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
Narzew
post Jan 17 2012, 12:48 PM
Post #7


Level 2
Group Icon

Group: Member
Posts: 22
Type: Scripter
RM Skill: Skilled




It's other good script. It's Schroedinger Cat:

Schroedinger Cat by Janree Mendoza

It's can catalogue the locations.

It's works with and without XAS.

This post has been edited by Narzew: Jan 17 2012, 12:49 PM
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: 24th May 2013 - 08:18 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker