• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Resource Flexible ladders 2023-03-30

SunriseStudios

Novice
Member
Joined
Aug 10, 2022
Posts
20
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:
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