• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Resource Flexible ladders 2023-03-30

SunriseStudios

Novice
Member
Joined
Aug 10, 2022
Posts
21
Dracarys submitted a new resource:

Flexible ladders - Transfer without specifying the location!

The issue at hand
You're creating a cave and letting the player transfer to another area using a ladder. Then you change your map including the location of the ladders and... oops, now you have to adapt all the transfer events.

What it does
Using this, you can easily transfer the player between two "paired" events without having to specify where you want the player to go (so no "Transfer Player" event command or similar). It makes transfers more flexible because you can simply...

Read more about this resource...
 

Vendily

Elite Trainer
Member
Hey, do you mind if I make a code suggestion? This will let you get around that max 10 ladder limit, and all it requires is a slight format change.
All it needs is the power of regular expressions!
Ruby:
Expand Collapse Copy
def pbLadder
  # Identify name and number of ladder event the player is touching
  interp = pbMapInterpreter
  this_event = interp.get_self
  this_event.name[/Ladder\((\d+),(up|do)\)/i]
  no = $~[1].to_i
  corr = $~[2].downcase.include?("do") ? "up" : "do"

  # Search for the corresponding ladder on map
  event = $game_map.events.values.find { |e|
    e.name[/Ladder\(#{no},#{corr}\)/]
  }
 
  # Transfer to corresponding ladder
  if event
    pbSEPlay("Door exit", 100)
    pbFadeOutIn {
      $game_temp.player_new_map_id    = $game_map.map_id # Stay on the same map
      $game_temp.player_new_x         = event.x
      $game_temp.player_new_y         = event.y + 1
      $game_temp.player_new_direction = 2
      $scene.transfer_player
      $game_map.autoplay
      $game_map.refresh
    }
  end
end

I tested it with a Ladder 1 and Ladder 10 pair on the same map.
 
Back
Top