RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Diablo Waypoint script

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 87
this is a great code that i found on another website no credit goes to me watsoever but it is an awesome script none
the less.
Code: [Select]
#==============================================================================
#   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(act, waypoint)
#   where 'act' is the act you're in (0,1,2..) and "waypoint" is the waypoint index for the act.
#
#   If you want to activate a waypoint without "touching" it
#   call a script like this:
#   $game_system.waypoints_active[act] << 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", 2, 13, 9] # This is the first waypoint. Its added to act 1 (with index 0) and its act index is 0.
    @acts[0] << ["Forest II", 4, 5, 11] # 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[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::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
  end
  #--------------------------------------------------------------------------
end



oh and can someone tell me how to use it? i dont really understand i mean i tried out the demo game and i get how it works but i dont get how to customize it, so you tele to your set coordinates,

DEMO- http://www.megaupload.com/?d=KL4VN9F8

also campability issues i have sdk installed into my main project and it doesnt seem to be getting along very well
« Last Edit: March 21, 2007, 01:03:16 AM by astanin »

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I would say it's way easier to make that with a common event...
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*******
Rep:
Level 90
Returned from the dead.
What's a waypoint script?
Sincerely,
Your conscience.

*
A Random Custom Title
Rep:
Level 96
wah
First, there's the default waypoint that starts out turned on. Then, as you progress through the game, you activate different waypoints. From every waypoint, you can teleport to the other waypoints that you have.

Quote from: OFFTOPIC
Yay! Someone famed me from -3 to -2!

**
Rep:
Level 87
yep once u use a waypoint you activate it, but yes blizzard i agree using common events is easier, but for those who are too lazy this script is good but i dont think its very compatable it didnt work with my project

***
Rep:
Level 88
Smarter than the average bear
well, common events are 'much' easier, but consider this equation;

bored + makes something look nicer = new script!

*
A Random Custom Title
Rep:
Level 96
wah
Ack! About to post a waypoint thingy I used using events. Hope people like it XP

***
Rep:
Level 88
But in diablo, it brings up a nice neat menu, with all the other lands.
how would u do that with ce's?

*
A Random Custom Title
Rep:
Level 96
wah
Well, I guess you can't do that... XP But, using common events/regular events are more easily made and more useful for quick makings, I guess. I'm not really an expert, so don't hold my opinions in high regard.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
But in diablo, it brings up a nice neat menu, with all the other lands.
how would u do that with ce's?

Same way you do in Rm2k and Rm2k3 - - Talent...and lots of patience. :)
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

*
A Random Custom Title
Rep:
Level 96
wah
Just wanted to advertise my Waypoint demo that I made in the tutorials section. XD I guess it's relevant to this because it solves the problem, in a way.

EDIT: Just remembered that there never was a problem. XD Solve's the use of events/common events (I haven't gotten to the common events part, yet...)

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
well, common events are 'much' easier, but consider this equation;

bored + makes something look nicer = new script!

But what about RM2k3 and RM2k user? And yeah, this is pretty much how Seph does it. He merely concentrates on the thing that it looks nice. He would do great if he'd work for Microsoft. =/
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!