Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Needing a script convertion

I found an exact script I'm looking for. Unfortunately it is for VX and I'm working in XP. I know very little scripting. I'm hoping that one of you awesome scripters can write a conversion for me. It isn't that big of a script either.

Code:
#-------------------------------------------------------------------------------

#                        :..: Scene Teleport FFXII

#                              by: Master I

#-------------------------------------------------------------------------------

module Pernalonga

Teleport_data = []

#===============================================================================

# Fonte, Tamanho, ID_Item, Tempo, Animação,  Sons, Efeito do Tremor, 

# Largura & Altura, Windowskin

#-------------------------------------------------------------------------------

Teleport_font = ["Arial Narrow", 16]

Teleport_item = 21

Teleport_time = 250

Teleport_animation = 80

Teleport_sons = ["Teleport IN", "Teleport OUT"]

Teleport_tremor = [5,3]

Teleport_LG = [150,150]

Teleport_windowskin = "vx-sepia01"

#===============================================================================

#Teleport_data[Ordem] = [ID do Mapa, Posx, Posy1, Swtich]

#-------------------------------------------------------------------------------

Teleport_data[0] = [3, 18, 29, 1] #Town

Teleport_data[1] = [11, 10, 10, 1] #Village

Teleport_data[2] = [12, 14, 27, 2] #Village |snow|

Teleport_data[3] = [2, 13, 19, 3]  #Desert Town

Teleport_data[4] = [4, 15, 18, 6]  #Castle 

Teleport_data[5] = [10, 41, 19, 4] #Field

Teleport_data[6] = [1, 18, 41, 5]  #Dugeon

end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#                            Fim das Configurações

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

#===============================================================================

# Window Teleport

#-------------------------------------------------------------------------------

class Window_Teleport < Window_Selectable

  include Pernalonga

  def initialize(x, y, width, height)

    super(x, y, width, height)

    @column_max = 1

    self.index = 0

    self.windowskin = Cache.system(Teleport_windowskin)

    refresh

  end

 

  def teleport

    return @data[index]

  end

 

  def refresh

    @data = []

    for i in 0...Teleport_data.size

      if $game_switches[Teleport_data[i][3]] and not Teleport_data[i][0] == $game_map.map_id

      @data.push(Teleport_data[i])

      end

    end

    @item_max = @data.size

    create_contents

    for i in 0...@item_max

      draw_item(i)

    end

  end

  

  def draw_item(index)

    self.contents.font.name = Teleport_font[0]

    self.contents.font.size = Teleport_font[1]

    nome = load_data("Data/MapInfos.rvdata")[@data[index][0]].name

    self.contents.draw_text(0, 24 * index, 100, WLH, nome)

  end

end

 

#===============================================================================

# Scene Teleport

#-------------------------------------------------------------------------------

class Scene_Teleport < Scene_Base

  include Pernalonga

  def start

    super

    @guardar = []

    @mapa = Spriteset_Map.new

    y = $game_player.screen_y - Teleport_LG[0] / 2 if $game_player.screen_y <= 304

    y = $game_player.screen_y / 2 if $game_player.screen_y > 305

    x = $game_player.screen_x + 20 if $game_player.screen_x <= 300

    x = $game_player.screen_x - Teleport_LG[1] / 2 if $game_player.screen_x >= 301

@teleport = Window_Teleport.new(x, y, Teleport_LG[0], Teleport_LG[1])

    @animação = Sprite_Base.new

    @teleport.active = true

    @sair = 0

    @p_sair = false

  end

  

  

  def update

    super

    @teleport.update

    @mapa.update

    @animação.update

    $game_map.interpreter.update 

    $game_system.update

    $game_map.update

    @sair += 1 if @p_sair

    saida

    udpate_selection

  end

  

  def terminate

    super

    @teleport.dispose

    @mapa.dispose

    @animação.dispose

    @sair = 0

    @p_sair = false

  end

  

  def udpate_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      $scene = Scene_Map.new

    elsif Input.trigger?(Input::C)

      item = $data_items[Teleport_item]

      item_número = $game_party.item_number(item)

       if @teleport.teleport != nil and item_número > 0

      @animação.start_animation($data_animations[Teleport_animation])

      Audio.se_play("Audio/ME/" + Teleport_sons[0], 100)

      $game_party.lose_item(item, 1)

      @teleport.visible = false

      tone = Tone.new(255,255,255,255)

      $game_map.screen.start_tone_change(tone, 120)

      $game_map.screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)

      RPG::BGM.fade(1500)

      @p_sair = true

     # Graphics.wait(60)

    else

      Sound.play_buzzer

      end

  end

 end

 

 def saida

   if @sair == Teleport_time - 80

     $game_map.setup(@teleport.teleport[0])

     $game_map.autoplay

   elsif @sair == Teleport_time

     #@sair = 300

     pode_sair

     @p_sair = false

   end

 end

 

 def pode_sair

   # $game_map.setup(@teleport.teleport[0])

   # $game_map.autoplay

   Audio.se_play("Audio/ME/" + Teleport_sons[1], 100)

   tone = Tone.new(0,0,0,0)

   $game_map.screen.start_tone_change(tone, 120)

   $game_map.screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)

   $game_player.moveto(@teleport.teleport[1],@teleport.teleport[2])

   Graphics.wait(60)

   @animação.start_animation($data_animations[Teleport_animation])

   $scene = Scene_Map.new

 end

end

$pernalonga = {} if $pernalonga == nil

$pernalonga = {"Teleport_FFXII" => true} 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#                             Fim do Script

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      

      

  

   
 
Please post the code using an [rgss] tag instead of a
tag. After that I may do the conversion for you. Although it looks to me like all it needs is for you to include Scene_Base from RMVX in your RMXP project above this script, and also to replace "MapInfos.rvdata" in the script with "MapInfos.rxdata".
 
Here, I fixed the post for you.

Code:
#-------------------------------------------------------------------------------

#                        :..: Scene Teleport FFXII

#                              by: Master I

#-------------------------------------------------------------------------------

module Pernalonga

Teleport_data = []

#===============================================================================

# Fonte, Tamanho, ID_Item, Tempo, Animação,  Sons, Efeito do Tremor, 

# Largura & Altura, Windowskin

#-------------------------------------------------------------------------------

Teleport_font = ["Arial Narrow", 16]

Teleport_item = 21

Teleport_time = 250

Teleport_animation = 80

Teleport_sons = ["Teleport IN", "Teleport OUT"]

Teleport_tremor = [5,3]

Teleport_LG = [150,150]

Teleport_windowskin = "vx-sepia01"

#===============================================================================

#Teleport_data[Ordem] = [ID do Mapa, Posx, Posy1, Swtich]

#-------------------------------------------------------------------------------

Teleport_data[0] = [3, 18, 29, 1] #Town

Teleport_data[1] = [11, 10, 10, 1] #Village

Teleport_data[2] = [12, 14, 27, 2] #Village |snow|

Teleport_data[3] = [2, 13, 19, 3]  #Desert Town

Teleport_data[4] = [4, 15, 18, 6]  #Castle 

Teleport_data[5] = [10, 41, 19, 4] #Field

Teleport_data[6] = [1, 18, 41, 5]  #Dugeon

end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#                            Fim das Configurações

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

#===============================================================================

# Window Teleport

#-------------------------------------------------------------------------------

class Window_Teleport < Window_Selectable

  include Pernalonga

  def initialize(x, y, width, height)

    super(x, y, width, height)

    @column_max = 1

    self.index = 0

    self.windowskin = Cache.system(Teleport_windowskin)

    refresh

  end

 

  def teleport

    return @data[index]

  end

 

  def refresh

    @data = []

    for i in 0...Teleport_data.size

      if $game_switches[Teleport_data[i][3]] and not Teleport_data[i][0] == $game_map.map_id

      @data.push(Teleport_data[i])

      end

    end

    @item_max = @data.size

    create_contents

    for i in 0...@item_max

      draw_item(i)

    end

  end

  

  def draw_item(index)

    self.contents.font.name = Teleport_font[0]

    self.contents.font.size = Teleport_font[1]

    nome = load_data("Data/MapInfos.rvdata")[@data[index][0]].name

    self.contents.draw_text(0, 24 * index, 100, WLH, nome)

  end

end

 

#===============================================================================

# Scene Teleport

#-------------------------------------------------------------------------------

class Scene_Teleport < Scene_Base

  include Pernalonga

  def start

    super

    @guardar = []

    @mapa = Spriteset_Map.new

    y = $game_player.screen_y - Teleport_LG[0] / 2 if $game_player.screen_y <= 304

    y = $game_player.screen_y / 2 if $game_player.screen_y > 305

    x = $game_player.screen_x + 20 if $game_player.screen_x <= 300

    x = $game_player.screen_x - Teleport_LG[1] / 2 if $game_player.screen_x >= 301

@teleport = Window_Teleport.new(x, y, Teleport_LG[0], Teleport_LG[1])

    @animação = Sprite_Base.new

    @teleport.active = true

    @sair = 0

    @p_sair = false

  end

  

  

  def update

    super

    @teleport.update

    @mapa.update

    @animação.update

    $game_map.interpreter.update 

    $game_system.update

    $game_map.update

    @sair += 1 if @p_sair

    saida

    udpate_selection

  end

  

  def terminate

    super

    @teleport.dispose

    @mapa.dispose

    @animação.dispose

    @sair = 0

    @p_sair = false

  end

  

  def udpate_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      $scene = Scene_Map.new

    elsif Input.trigger?(Input::C)

      item = $data_items[Teleport_item]

      item_número = $game_party.item_number(item)

       if @teleport.teleport != nil and item_número > 0

      @animação.start_animation($data_animations[Teleport_animation])

      Audio.se_play("Audio/ME/" + Teleport_sons[0], 100)

      $game_party.lose_item(item, 1)

      @teleport.visible = false

      tone = Tone.new(255,255,255,255)

      $game_map.screen.start_tone_change(tone, 120)

      $game_map.screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)

      RPG::BGM.fade(1500)

      @p_sair = true

     # Graphics.wait(60)

    else

      Sound.play_buzzer

      end

  end

 end

 

 def saida

   if @sair == Teleport_time - 80

     $game_map.setup(@teleport.teleport[0])

     $game_map.autoplay

   elsif @sair == Teleport_time

     #@sair = 300

     pode_sair

     @p_sair = false

   end

 end

 

 def pode_sair

   # $game_map.setup(@teleport.teleport[0])

   # $game_map.autoplay

   Audio.se_play("Audio/ME/" + Teleport_sons[1], 100)

   tone = Tone.new(0,0,0,0)

   $game_map.screen.start_tone_change(tone, 120)

   $game_map.screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)

   $game_player.moveto(@teleport.teleport[1],@teleport.teleport[2])

   Graphics.wait(60)

   @animação.start_animation($data_animations[Teleport_animation])

   $scene = Scene_Map.new

 end

end

$pernalonga = {} if $pernalonga == nil

$pernalonga = {"Teleport_FFXII" => true} 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#                             Fim do Script

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      

      

  

   
 
OK i been tinkering with this. i have it working except the screen tone isn't turning black.

[rgss]  def udpate_selection
    if Input.trigger?(Input::B)
      Audio.se_play("Audio/SE/Cancel.ogg", 100)
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      item = $data_items[Teleport_item]
      item_número = $game_party.item_number(item)
       if @teleport.teleport != nil and item_número > 0
      $game_player.animation_id = 105
      Audio.se_play("Audio/ME/" + Teleport_sons[0], 100)
      $game_party.lose_item(item, 1)
      @teleport.visible = false
      tone = Tone.new(255,255,255,255)
      $game_screen.start_tone_change(tone, 120)
      $game_screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)
      Audio.bgm_fade(1500)
      @p_sair = true
     # Graphics.wait(60)
    else
      Audio.se_play("Audio/SE/Buzzer1.ogg", 100)
      end
  end
 
[/rgss]

This is the code section with that changes the tone. I have the main function of the entire script working. of needing an item to teleport and then only teleporting to places you been to. but i can't seem to get the screen tone to fade to black and back. Well i dunno about back it just doesn't fade to know if it goes back.

Update:

ok I figured out that the duration time isn't working in the first

$game_screen.start_tone_change(Tone.new(255,255,255,255),120)

but when i set the duration time to 0 like so

$game_screen.start_tone_change(Tone.new(255,255,255,255),0)

it jumps right to white.
 
In Scene_Teleport#update add this line after "$game_map.update":

[rgss] 
    $game_map.update
    $game_screen.update # <== Add this line
    @sair += 1 if @p_sair
 
[/rgss]

I haven't tested it but I think it should solve your problem as the script was assuming that the instance of Game_Screen was being updated with "$game_map.update". While RMXP has a $game_screen object, in RMVX that object belongs to Game_Map instead and is accessed by $game_map.screen (and $game_map.update updates the screen).

P.S. Good job getting it to work this far by yourself. Sorry I forgot I was planning to help you sooner.
 
If anyone is interested here is the XP converted script.

[rgss] 
#-------------------------------------------------------------------------------
#                        :..: Scene Teleport FFXII
#                              by: Master I
#-------------------------------------------------------------------------------
module Pernalonga
Teleport_data = []
#===============================================================================
# Fonte, Tamanho, ID_Item, Tempo, Animação,  Sons, Efeito do Tremor,
# Largura & Altura, Windowskin
#-------------------------------------------------------------------------------
Teleport_font = ["Arial Narrow", 16]
Teleport_item = 50
Teleport_time = 250
Teleport_animation = 80
Teleport_sons = ["Teleport IN", "Teleport OUT"]
Teleport_tremor = [5,3]
Teleport_LG = [150,150]
Teleport_windowskin = "ffixxpws"
#===============================================================================
#Teleport_data[Order] = [Map ID, Posx, Posy1, Swtich]
#-------------------------------------------------------------------------------
Teleport_data[0] = [10, 7, 13, 151] #Greylea
Teleport_data[1] = [9, 28, 12, 152] #test
Teleport_data[2] = [12, 14, 27, 153] #Ester Woods Town/South
Teleport_data[3] = [7, 13, 19, 154]  #Desert Town
Teleport_data[4] = [8, 15, 18, 155]  #Castle
Teleport_data[5] = [10, 41, 19, 156] #Field
Teleport_data[6] = [1, 18, 41, 157]  #Dugeon
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#                            Fim das Configurações
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
#===============================================================================
# Window Teleport
#-------------------------------------------------------------------------------
class Window_Teleport < Window_Selectable
  include Pernalonga
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @column_max = 1
    self.index = 0
    self.windowskin = RPG::Cache.windowskin(Teleport_windowskin)
    refresh
  end
 
  def teleport
    return @data[index]
  end
 
  def refresh
    @data = []
    for i in 0...Teleport_data.size
      if $game_switches[Teleport_data[3]] and not Teleport_data[0] == $game_map.map_id
      @data.push(Teleport_data)
      end
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
 
  def draw_item(index)
    self.contents.font.name = "Arial Narrow"
    self.contents.font.size = 16
    nome = load_data("Data/MapInfos.rxdata")[@data[index][0]].name
    self.contents.draw_text(0, 24 * index,100, 24, nome)
  end
end
 
#===============================================================================
# Scene Teleport
#-------------------------------------------------------------------------------
class Scene_Teleport < Scene_Base_a
  include Pernalonga
  def start
    super
    @guardar = []
    @mapa = Spriteset_Map.new
    y = $game_player.screen_y - Teleport_LG[0] / 2 if $game_player.screen_y <= 304
    y = $game_player.screen_y / 2 if $game_player.screen_y > 305
    x = $game_player.screen_x + 20 if $game_player.screen_x <= 300
    x = $game_player.screen_x - Teleport_LG[1] / 2 if $game_player.screen_x >= 301
@teleport = Window_Teleport.new(x, y, Teleport_LG[0], Teleport_LG[1])
    @animação = Sprite_Base.new
    @teleport.active = true
    @sair = 0
    @p_sair = false
  end
 
 
  def update
    super
    @teleport.update
    @mapa.update
#    @animação.update
    $game_map.update
    $game_system.update
    $game_map.update
    $game_screen.update
    @sair += 1 if @p_sair
    saida
    udpate_selection
  end
 
  def terminate
    super
    @teleport.dispose
    @mapa.dispose
    @animação.dispose
    @sair = 0
    @p_sair = false
  end
 
  def udpate_selection
    if Input.trigger?(Input::B)
      Audio.se_play("Audio/SE/Cancel.ogg", 100)
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      item = $data_items[Teleport_item]
      item_número = $game_party.item_number(item)
       if @teleport.teleport != nil and item_número > 0
      $game_player.animation_id = 105
      Audio.se_play("Audio/ME/Teleport OUT", 100)
      $game_party.lose_item(item, 1)
      @teleport.visible = false
#      tone = Tone.new(255,255,255,255)
      $game_screen.start_tone_change(Tone.new(255,255,255,255),120)
      $game_screen.start_shake(Teleport_tremor[0],Teleport_tremor[1],120)
#      Audio.bgm_fade(1500)
      @p_sair = true
#      @write_wait = 120
    else
      Audio.se_play("Audio/SE/Buzzer1.ogg", 100)
      end
  end
 end
 
 def saida
   if @sair == Teleport_time - 80
     $game_map.setup(@teleport.teleport[0])
     $game_map.autoplay
   elsif @sair == Teleport_time
     #@sair = 300
     pode_sair
     @p_sair = false
   end
 end
 
 def pode_sair
   # $game_map.setup(@teleport.teleport[0])
   # $game_map.autoplay
   Audio.se_play("Audio/ME/Teleport IN", 100)
   tone = Tone.new(0,0,0,0)
   $game_screen.start_tone_change(tone, 120)
   $game_screen.start_shake(Teleport_tremor[0],Teleport_tremor[1], 120)
   $game_player.moveto(@teleport.teleport[1],@teleport.teleport[2])
#   Graphics.wait(60)
   $game_player.animation_id = 105
   $scene = Scene_Map.new
 end
end
$pernalonga = {} if $pernalonga == nil
$pernalonga = {"Teleport_FFXII" => true}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#                             Fim do Script
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
     
 
   
 
[/rgss]
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top