Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
higgle2piggle

Change Tileset Passability - Terrain Tag

Question

Hi, In RMXP I'm trying to make a situation in the game.

Find boots and (equip/or just have in inventory) to be able to walk on water.

 

The normal tileset is set to "X" on my water in the database, but when the char finds the boots I want the char 

to be able to walk on the water... or any water actually. So I think this will need to use terrain tags. But I'm not sure how to set it up. 

 

Is there a way I can do this using events, without making lots of events. Just like a Common Event system or something.

I cant find any help.

 

If anyone has any answers, it would be much appreciated.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

I made major edits to the swimming script you found. No events are required at all. All the credit still goes to who made the swimming script since all i did was make edits.

 

All you have to do is change the $boots = 32 to the id of the armor that is in the accessory slot. You can find $boots at the top of the script on line 12.

 

Once the player has that item equipped they can press enter on anything that has the terrain tag of 2

#==============================================================================
# ** Swimming System v1.0
#==============================================================================
# Author: Diagostimo
#==============================================================================
module Swim_Config
  #----------------------------------------------------------------------------
  # BEGIN CONFIGURATION
  #----------------------------------------------------------------------------
  #Terrain tag of water to swim on
  WATER_TERRAIN = 2
  $boots = 32
  #----------------------------------------------------------------------------
  # END CONFIGURATION
  #----------------------------------------------------------------------------
end
#==============================================================================
# ** Game Character
#==============================================================================
class Game_Character
  #----------------------------------------------------------------------------
  # * Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :swimming
  #----------------------------------------------------------------------------
  # * Object Initialization
  #----------------------------------------------------------------------------
  alias init_diag_swim initialize
  def initialize
    init_diag_swim
    @swimming = false
  end
  #----------------------------------------------------------------------------
  # * Passable?
  #----------------------------------------------------------------------------
  alias passable_diag_swim passable?
  def passable?(x, y, d)
    target_x = @x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    target_y = @y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return false if !@swimming && $game_map.terrain_tag(target_x, target_y) == 2
    passable_diag_swim(x, y, d)
  end
end
#==============================================================================
# ** Game Player
#==============================================================================
class Game_Player < Game_Character
  #----------------------------------------------------------------------------
  # * Frame Update
  #----------------------------------------------------------------------------
  alias update_player_diag_swim update
  def update
    if $game_actors[1].armor4_id == $boots
    if Input.trigger?(Input::C) && !@swimming
      d = @direction
      target_x = @x + (d == 6 ? 1 : d == 4 ? -1 : 0)
      target_y = @y + (d == 2 ? 1 : d == 8 ? -1 : 0)
      if $game_map.terrain_tag(target_x, target_y) == 2
        player = $game_party.actors[0]
        refresh
        @step_anime = false
        @swimming = true
        move_forward
        else
      end
      end
    end
    update_player_diag_swim
    if @swimming && $game_map.terrain_tag(@x, @y) != 2
      @swimming = false
      @step_anime = false
      player = $game_party.actors[0]
      refresh 
    end
  end
end

Share this post


Link to post
Share on other sites
  • 0

I got it to work so far but the transition to get in the water is being a problem and you can also exit at any point even if its an X tile. This is what i got so far and you can play with it. Set water to be terrain tag #1 and have a switch that is always on.

kHHC0uY.png

If i can figure out how to fix the problems i will let you know.

Share this post


Link to post
Share on other sites
  • 0

Cool, I'll reproduce the event as you have done. and work on it from there. Thanks for your help. I'll keep this post updated :)

 

 

No, I've been thinking.. Is their a way to call the Passage function from the data base. Like Row 1 Column 3 passage true or false?

I could include this call in the common event. How is the Tileset Passage coded ... therir must be a call script function to manually change the passage when desired.

 

 

Image 1 is the area where Passage is referenced in the Script Database.

Image 2 is how I would wish the call function would work.

 

Is this possible?

 

 

It shouldnt be too hard. This swimming script does something of the sort. But still not dependent on Equipped Item.

http://www.gdunlimited.net/scripts/rpg-maker-xp/environment-and-field-scripts/swimming-system

 

 

This may work. But its for VX. I dont have VX :(

http://www.rpgrevolution.com/forums/index.php?showtopic=30876

post-25787-0-26285500-1388214829_thumb.png

post-25787-0-90339400-1388214830_thumb.png

Edited by Polraudio

Share this post


Link to post
Share on other sites
  • 0

Hi, Thank you very much for helping me out.

However, I can't manage to get the script to do anything.

I've checked the terrain tag is 2, and item is equipped, but when i walk to the water and press "ok" nothing happens... am I doing something wrong?

Cheers

Share this post


Link to post
Share on other sites
  • 0

Hi Polraudio.

Thank you. I realized that the passability in the database tileset needs to be "O" not "X"...

That's what I was doing wrong.

So the script works very well :)

 

I hate to be annoying, but is it an easy task to remove the necessity to press "C" from the script? making the movement seamless from land to water?

Or is that pushing the friendship :)

 

Muchly appreciated. 

Share this post


Link to post
Share on other sites
  • 0

Its not annoying, i enjoy helping people when i can.

 

Very easy to remove. Just takes the removal of 3 lines in the script.

NEADKFT.png

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...