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.

[VX] Zelda LTTP Warp Script

Slipknot made a warp script like this for XP over at Creation Asylum.
(http://www.creationasylum.net/index.php?s=3dde3cb9b9f1459f0c4b94437b467b8d&showtopic=12181

Code:
#============================================================
# ** Warp Script
#------------------------------------------------------------------------------
# Sheol / Slipknot (www.creationasylum.net)
# Version 1.2
# Jenuary 28, 2008
#============================================================

module Warp
  #--------------------------------------------------------------------------
  # * Maps
  #--------------------------------------------------------------------------
  Maps = {
    1 => 2,
    2 => 1
  }
  #--------------------------------------------------------------------------
  # * Transition
  #--------------------------------------------------------------------------
  Transition = 48
  File = '007-Line01' # nil = normal transition
  #--------------------------------------------------------------------------
  # * Variable ID
  #--------------------------------------------------------------------------
  Variable = nil
  #--------------------------------------------------------------------------
  # * Can Warp?
  #--------------------------------------------------------------------------
  def Warp.can?
    Maps[$game_map.map_id] != nil
  end
  #--------------------------------------------------------------------------
  # * Transition
  #--------------------------------------------------------------------------
  def Warp.transition
    File ? Graphics.transition(Transition, 'Graphics/Transitions/'+File) :
      Graphics.transition(Transition)
  end
end

#============================================================
# ** Game_Temp
#============================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :warp
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_warp_init initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    slipknot_warp_init
    @warp = false
  end
end

#============================================================
# ** Interpreter
#============================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias slipknot_warp_upd update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if $game_temp.warp
      Graphics.freeze
      $game_map.setup($game_temp.warp)
      $game_player.center($game_player.x, $game_player.y)
      $game_temp.warp = false
      $scene.warp_spriteset_refresh
          $game_map.autoplay
      Warp.transition
    else
      slipknot_warp_upd
    end
  end
  #--------------------------------------------------------------------------
  # * Warp
  #--------------------------------------------------------------------------
  def warp
    return true if ! $scene.is_a?(Scene_Map) || ! Warp.can?
    map = $game_map.map_id
    Graphics.freeze
    $game_map.setup(Warp::Maps[map])
    $game_player.center($game_player.x, $game_player.y)
    $game_temp.warp = $game_map.passable?($game_player.x, $game_player.y, 0) ?
      false : map
    $game_variables[Warp::Variable] += 1 if Warp::Variable && ! $game_temp.warp
    $scene.warp_spriteset_refresh
    Warp.transition
        $game_map.autoplay
    return true
  end
end

#============================================================
# ** Scene_Map
#============================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Warp: Spriteset Refresh
  #--------------------------------------------------------------------------
  def warp_spriteset_refresh
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
  end
end

It teleports to the same x and y on a different map, and returns to the previous map if the hero's standing on an impassible area.

Edit: Whoops, I was requesting a similar script for VX, with this script as reference, as this is an XP script o.O It wasn't clear enough o.O
 
King Red Of Pancakes":16fkh2q1 said:
I'm not quite sure I understand. Also, I've never heard of the month "Jenuary". :tongue:
Have you ever played the gameboy zelda games?

Specifically, there was a dark world and a light world, and for example, you would have to switch back and forth with an item, but if where you warped was unpassable, then you would be warped back.  You needed to use this to get around the mountain areas (if i remember), where you would have to warp from light to dark and stuff to pass through them.
 
psymastr":3pwldg2f said:
King Red Of Pancakes":3pwldg2f said:
I'm not quite sure I understand. Also, I've never heard of the month "Jenuary". :tongue:
Have you ever played the gameboy zelda games?

Specifically, there was a dark world and a light world, and for example, you would have to switch back and forth with an item, but if where you warped was unpassable, then you would be warped back.  You needed to use this to get around the mountain areas (if i remember), where you would have to warp from light to dark and stuff to pass through them.

Actually, it would be useful in mimicking most zelda games. Most of them have some form of an alternate world. Aside from the classic dark and light world, there was the past and future in Ocarina of Time (although that doesn't really apply, as you could only go between them from the temple of time), the different seasons of Oracle of Seasons, (although that also had semi-fixed warp points), and the past and present of Oracle of Ages.
 

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