Oversized Event Support [1.1a]

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Oversized Event Support
Version: 1.1a
Author: Exhydra
Date: 6-22-2011

Version History


  • <Version 1.1a> 07.03.11 (alpha) Cleaned up code and allowed for custom event tags. Released alpha code as it was a vast improvement over the older version.
  • <Version 1.0> 06.22.2011 - Original Release

Description


Have you ever assigned large graphics to your events only to find that your huge dragon has just has one square which triggers its code? Oversized Event Support can help! You can easily assign a larger grid to your fierce dragon and allow it to become the terror it was meant to be!

Features

  • Adds additional squares to the original grid of the event to make it appear larger.

Screenshots

None

Instructions

See Script Header

Script


Code: [Select]
#===============================================================================
# Oversized Event Support
#===============================================================================
# Author       : Exhydra
# Version      : 1.1a
# Last Updated : 07/03/2011
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# » 07/03/11 Cleaned up code and allowed for custom event tags.
# » 06/22/11 Initial Release.
#===============================================================================
# Future Options
# -----------------------------------------------------------------------------
# » Fixing up the oversized passability code, though it works fairly well enough
#   at the moment.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To Use :
#   (1) Edit the following tag in a comment within a page of the event you wish
#       to add oversize support for :
#
#       < Tag with Direction Markers >
#       [ExOszRect:0,1,2,3,4,5,6,7]
#
#       < Tag Direction Marker Legend >
#       [5][6][7]
#       [3]   [4]
#       [0][1][2]
#
#
#       < Tag Example #1 >
#       [ExOszRect:0,0,0,2,2,0,0,0]
#
#       - The above example would create an event that would take up a grid
#         like the one displayed below where 'e' is the base square of the
#         event and 'n' are new squares added to the grid of the event :
#
#         [n][n][e][n][n]
#
#
#       < Tag Example #2 >
#       [ExOszRect:0,2,0,0,0,1,1,1]
#
#            [n][n][n]
#               [e]
#               [n]
#               [n]
#
#
#       < Tag Example #3 >
#       [ExOszRect:2,0,0,0,0,0,0,2]
#
#                     [n]
#                  [n]
#               [e]
#            [n]
#         [n]
#
#
#   (2) Assign a switch below and toggle it into the 'On' position to activate
#       Oversized Event Support.
#
#===============================================================================
# Description
# -----------------------------------------------------------------------------
# - Have you ever assigned large graphics to your events only to find that your
#   huge dragon has just has one square which triggers its code? Oversized
#   Event Support can help! You can easily assign a larger grid to your fierce
#   dragon and allow it to become the terror it was meant to be!
#===============================================================================

module ExOSZEvent

  # < Activation Switch >
  #   - Change this to the switch you would like to use.
  EX_OSZEVENT_SW = 1

end

#==============================================================================
# -» Game_Event
# -----------------------------------------------------------------------------
# Summary of Changes:
#    Aliased Method(s) - setup
#==============================================================================
class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor    :ex_osz_rect                       # OSZ Rect
  attr_accessor    :ex_osz_coords                     # OSZ Coords
 
  #--------------------------------------------------------------------------
  # » setup                                                         [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_setup setup unless $@
  def setup(*args)
    ex_oszev_setup(*args)
    @ex_osz_coords = []
    return unless @list != nil
    for i in 0...@list.size
      next if @list[i].code != 108
      if @list[i].parameters[0].include?("[ExOszRect:")
        @ex_osz_rect = (@list[i].parameters[0].scan(/\[\w+:(\d,\d,\d,\d,\d,\d,\d,\d)\]/).to_s).split(%r{,})
      end
    end
  end
end

#==============================================================================
# -» Game_Map
# -----------------------------------------------------------------------------
# Summary of Changes:
#    Aliased Method(s) - events_xy
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # » events_xy                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_events_xy events_xy unless $@
  def events_xy(*args)
    osz_ev_result = ex_oszev_events_xy(*args)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW]
      for event in $game_map.events.values
        if event.ex_osz_rect != nil
          event.ex_osz_coords.clear
          tmp_count = 0
          for extra_grid in event.ex_osz_rect
            for grid_i in 0..extra_grid.to_i
              next if extra_grid.to_i == 0
              case tmp_count
                when 0
                  ex_osz_tmp_x =  (grid_i);      ex_osz_tmp_y = (-grid_i)
                when 1
                  ex_osz_tmp_x =         0;      ex_osz_tmp_y = (-grid_i)
                when 2
                  ex_osz_tmp_x = (-grid_i);      ex_osz_tmp_y = (-grid_i)
                when 3
                  ex_osz_tmp_x =  (grid_i);      ex_osz_tmp_y =         0
                when 4
                  ex_osz_tmp_x = (-grid_i);      ex_osz_tmp_y =         0
                when 5
                  ex_osz_tmp_x =  (grid_i);      ex_osz_tmp_y =  (grid_i)
                when 6
                  ex_osz_tmp_x =         0;      ex_osz_tmp_y =  (grid_i)
                when 7
                  ex_osz_tmp_x = (-grid_i);      ex_osz_tmp_y =  (grid_i)
              end
              event.ex_osz_coords.push((ex_osz_tmp_x).to_s + "," + (ex_osz_tmp_y).to_s)
              osz_ev_result.push(event) if event.pos?(args[0] + ex_osz_tmp_x, args[1] + ex_osz_tmp_y)
            end
            tmp_count += 1
          end
        end
      end
    end
    event.ex_osz_coords.uniq!
    return osz_ev_result
  end
end

#==============================================================================
# -» Game_Character
# -----------------------------------------------------------------------------
# Summary of Changes:
#    Aliased Method(s) - move_down, move_left, move_right, move_up
#    New Method(s)     - oversized_spatial_check
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # » Oversized Spatial Check                                         [ New ]
  #--------------------------------------------------------------------------
  def oversized_spatial_check(direction, xy_val)
    tmp_array   = []
    tmp_trigger = [nil, nil]
    for coord_grid in self.ex_osz_coords
      tmp_pair = coord_grid.split(%r{,})
      tmp_chk  = true
     
      case direction
        when 2
          tmp_x  = (@x) + ((tmp_pair[0].to_i))
          tmp_y  = (@y) + ((tmp_pair[1].to_i) + xy_val)
        when 4
          tmp_x  = (@x) + (-(tmp_pair[0].to_i) + xy_val)
          tmp_y  = (@y) + (-(tmp_pair[1].to_i))
        when 6
          tmp_x  = (@x) + ((tmp_pair[0].to_i) + xy_val)
          tmp_y  = (@y) + (-(tmp_pair[1].to_i))
        when 8
          tmp_x  = (@x) + (-(tmp_pair[0].to_i))
          tmp_y  = (@y) + (-(tmp_pair[1].to_i) + xy_val)
      end
     
      if passable?(tmp_x, tmp_y) == false
        if $game_map.valid?(tmp_x, tmp_y) == true
          if map_passable?(tmp_x, tmp_y) == true
            tmp_ev = $game_map.events_xy(tmp_x, tmp_y)
            if tmp_ev.size > 0
              for grid_event in tmp_ev
                tmp_chk = false if grid_event != self
              end
            end
            if $game_player.pos?(tmp_x, tmp_y)
              tmp_chk = false
              tmp_trigger[0] = tmp_x
              tmp_trigger[1] = tmp_y
            end
            tmp_array.push(false) if tmp_chk == false
          else
            tmp_array.push(false)
          end
        else
          tmp_array.push(false)
        end
      end
       
    end
    if tmp_array.include?(false)
      tmp_chk = false
    else
      tmp_chk = true
    end
    return [tmp_chk, tmp_trigger[0], tmp_trigger[1]]

  end

  #--------------------------------------------------------------------------
  # » Move Down                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_down move_down unless $@
  def move_down(*args)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      if self.ex_osz_rect != nil
        osz_event_chk = oversized_spatial_check(2, 1)
        if osz_event_chk[0]
          turn_down
          @y = $game_map.round_y(@y+1)
          @real_y = (@y-1)*256
          increase_steps
          @move_failed = false
          return
        else
          turn_down
          check_event_trigger_touch(osz_event_chk[1], osz_event_chk[2])
          @move_failed = true
          return
        end
      end
    end

    ex_oszev_move_down(*args)
  end
 
  #--------------------------------------------------------------------------
  # » Move Left                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_left move_left unless $@
  def move_left(*args)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      if self.ex_osz_rect != nil
        osz_event_chk = oversized_spatial_check(4, -1)
        if osz_event_chk[0]
          turn_left
          @x = $game_map.round_x(@x-1)
          @real_x = (@x+1)*256
          increase_steps
          @move_failed = false
          return
        else
          turn_left
          check_event_trigger_touch(osz_event_chk[1], osz_event_chk[2])
          @move_failed = true
          return
        end
      end
    end

    ex_oszev_move_left(*args)
  end
 
  #--------------------------------------------------------------------------
  # » Move Right                                                    [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_right move_right unless $@
  def move_right(*args)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      if self.ex_osz_rect != nil
        osz_event_chk = oversized_spatial_check(6, 1)
        if osz_event_chk[0]
          turn_right
          @x = $game_map.round_x(@x+1)
          @real_x = (@x-1)*256
          increase_steps
          @move_failed = false
          return
        else
          turn_right
          check_event_trigger_touch(osz_event_chk[1], osz_event_chk[2])
          @move_failed = true
          return
        end
      end
    end

    ex_oszev_move_right(*args)
  end
 
  #--------------------------------------------------------------------------
  # » Move up                                                       [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_up move_up unless $@
  def move_up(*args)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      if self.ex_osz_rect != nil
        osz_event_chk = oversized_spatial_check(8, -1)
        if osz_event_chk[0]
          turn_up
          @y = $game_map.round_y(@y-1)
          @real_y = (@y+1)*256
          increase_steps
          @move_failed = false
          return
        else
          turn_up
          check_event_trigger_touch(osz_event_chk[1], osz_event_chk[2])
          @move_failed = true
          return
        end
      end
    end
   
    ex_oszev_move_up(*args)
  end
end

Credit


  • Exhydra

Thanks

  • None

Support


  • Please post in this thread for support.

Known Compatibility Issues

  • None Known

Demo


None

Author's Notes


  • Passability for oversized events is still slightly wonky, although the code works well enough to merit this release as its a vast improvement over version 1.0

Restrictions

  • Free for use in non-commercial and commercial games.
« Last Edit: July 04, 2011, 05:41:37 AM by Exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep:
Level 83
Music Composer
How? You mean like if an image is of the size of a full chara set, the image will display with only 1 square (event)?

Do you want original music for your game? Take a look here! You may like it.
Visit my Youtube Channel to listen the newest tracks and subscribe if you like my work :)
Also I have my Soundcloud account:

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
What I mean is, normally the event only has one square as its 'home'. Even if you set a huge image for the event, it will still only have that single square, which makes for an unrealistic presentation when you can walk right through portions of the sprite that you shouldn't be able to. With this script, it enlarges the event grid to accommodate bigger sprites.


UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best Use of Avatar and Signature Space2010 Favourite Staff Member2010 Most Mature Member
That's a useful idea. Good work Exhydra.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Thankee much. Not sure how many people use over-sized events, but I do a lot.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 74
RMRK Junior
Oh wow, this is exactly the kind of script I've been looking for! Do you think you could add two new positions? I've been trying to event log puzzles like the ones in Golden Sun, and I've been using events that are 3 tiles wide or 3 tiles tall. It'd be really convenient to have ones like these two:

(x)(evt)(x)

(x)
(x)
(evt)

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
I'll work on making the script more customizable where you can specify the amount of squares that you want. I was meaning to get around to it anyway.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

***
Rep:
Level 80
Monster Hunter
this, i can use a lot :) thanks!
great idea

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Optimization needs to be performed badly on this script, but it's going to take me some time to figure out a nice way of doing it. For now, here is a quickie fix. The first option that you wanted is [ExOszACustom] and the second option that you wanted is [ExOszBCustom].
« Last Edit: July 03, 2011, 12:29:06 AM by Exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 74
RMRK Junior
Thank you very much! I wasn't expecting that to be done so quickly. The passability works great, but the only problem is that I can't seem to set a move route for the events using the comment tags. Their move routes run fine without them, but once I add the comment tags they won't move. I tried setting a move route from a separate event and they still won't go. I also tried this in a blank project and got the same result.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
At the moment, each of the new false tiles added to the event will check if the area around them is passable. So if you have a layout like this :

Code: [Select]
[ ][ ][ ][ ][ ]
[x][e][e][e][ ]
[ ][x][ ][ ][ ]

Where 'e' are the tiles that the event is now taking up and 'x' represents impassable terrain on the map. In this case, the event would not be able to travel to the left or move down. So beware of hemming your events in by impassable terrain, at least for now. If that's not going to fit what you're after, then I can toss in another band-aid to allow pass-through while still triggering the event. It'll just make it more sloppy until I can get around to coding a proper fix.

Code: [Select]
#===============================================================================
# Oversized Event Support
#===============================================================================
# Author       : Exhydra
# Version      : 1.0
# Last Updated : 06/22/2011
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# » 06/22/11 Initial Release.
#===============================================================================
# Future Options
# -----------------------------------------------------------------------------
# » Nothing! Suggestions?
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To Use :
#   (1) Place one of the following tags in a comment within a page of the
#       event you wish to add oversize support for :
#
#      [ExOszA]
#         - This occupies one additional block on the right of the event.
#
#         Example :     [evt][x]
#
#      [ExOszB]
#         - This occupies one additional block on the right, upper-right
#            and top of the event.
#
#         Example :     [ x ][x]
#                       [evt][x]
#
#      [ExOszC]
#         - This occupies one additional block on the right, left, upper-right
#           top and upper-left of the event.
#
#         Example :     [x][ x ][x]
#                       [x][evt][x]
#
#
#   (2) Assign a switch below and toggle it into the 'On' position to activate
#       Oversized Event Support.
#           
#===============================================================================
# Description
# -----------------------------------------------------------------------------
# - Have you ever assigned large graphics to your events only to find that your
#   huge dragon has just has one square which triggers its code? Oversized
#   Event Support can help! You can easily assign a larger grid to your fierce
#   dragon and allow it to become the terror it was meant to be!
#===============================================================================

#===============================================================================
# [NOTE:] - This script uses OriginalWij's 'Get Comments' 1.1 scriptlet
#===============================================================================

module ExOSZEvent

  # < Activation Switch >
  #   - Change this to the switch you would like to use.
  EX_OSZEVENT_SW = 1
 
end

#==============================================================================
# -» Game_Map
# -----------------------------------------------------------------------------
# Summary of Changes:
#    Aliased Method(s) - events_xy
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # » events_xy                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_events_xy events_xy unless $@
  def events_xy(*args)
    osz_ev_result = ex_oszev_events_xy(*args)
   
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW]
      for event in $game_map.events.values
        case event.comment?("", true)
          when "[ExOszA]"
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1])
          when "[ExOszACustom]"
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1])
            osz_ev_result.push(event) if event.pos?(args[0] + 1, args[1])
          when "[ExOszB]"
            osz_ev_result.push(event) if event.pos?(args[0]    , args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1])
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1] + 1)
          when "[ExOszBCustom]"
            osz_ev_result.push(event) if event.pos?(args[0]    , args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0]    , args[1] + 2)
          when "[ExOszC]"
            osz_ev_result.push(event) if event.pos?(args[0] + 1, args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0]    , args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0]    , args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1] + 1)
            osz_ev_result.push(event) if event.pos?(args[0] + 1, args[1])
            osz_ev_result.push(event) if event.pos?(args[0] - 1, args[1])
        end
      end
    end
    return osz_ev_result
  end
end

#==============================================================================
# -» Game_Character
# -----------------------------------------------------------------------------
# Summary of Changes:
#    Aliased Method(s) - move_down, move_left, move_right, move_up
#==============================================================================
# passable_down
# if all of array is true
# turn_down or not

# Place Rect Array in Game Character init
# for i in aRect[1]
#   passable?
# end

class Game_Character
  #--------------------------------------------------------------------------
  # » Move Down                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_down move_down
  def move_down(turn_ok = true)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      case self.comment?("", true)
        when "[ExOszA]"
          if passable?(@x    , @y + 1) and
             passable?(@x + 1, @y + 1)
             turn_down
             @y = $game_map.round_y(@y+1)
             @real_y = (@y-1)*256
             increase_steps
             @move_failed = false
             return
          else
             turn_down if turn_ok
             check_event_trigger_touch(@x    , @y + 1)
             check_event_trigger_touch(@x + 1, @y + 1)
             @move_failed = true
             return
           end
        when "[ExOszACustom]"
          if passable?(@x    , @y + 1) and
             passable?(@x + 1, @y + 1) and
             passable?(@x - 1, @y + 1)
             turn_down
             @y = $game_map.round_y(@y+1)
             @real_y = (@y-1)*256
             increase_steps
             @move_failed = false
             return
          else
             turn_down if turn_ok
             check_event_trigger_touch(@x, @y+1)
             check_event_trigger_touch(@x+1, @y+1)
             check_event_trigger_touch(@x-1, @y+1)
             @move_failed = true
             return
           end
        when "[ExOszB]"
          if passable?(@x    , @y + 1) and
             passable?(@x + 1, @y + 1)
             turn_down
             @y = $game_map.round_y(@y+1)
             @real_y = (@y-1)*256
             increase_steps
             @move_failed = false
             return
          else
             turn_down if turn_ok
             check_event_trigger_touch(@x, @y+1)
             check_event_trigger_touch(@x+1, @y+1)
             @move_failed = true
             return
          end
        when "[ExOszBCustom]"
          if passable?(@x    , @y + 1)
             turn_down
             @y = $game_map.round_y(@y+1)
             @real_y = (@y-1)*256
             increase_steps
             @move_failed = false
             return
          else
             turn_down if turn_ok
             check_event_trigger_touch(@x, @y+1)
             @move_failed = true
             return
          end
        when "[ExOszC]"
          if passable?(@x    , @y + 1) and
             passable?(@x - 1, @y + 1) and
             passable?(@x + 1, @y + 1)
             turn_down
             @y = $game_map.round_y(@y+1)
             @real_y = (@y-1)*256
             increase_steps
             @move_failed = false
             return
          else
             turn_down if turn_ok
             check_event_trigger_touch(@x, @y+1)
             check_event_trigger_touch(@x-1, @y+1)
             check_event_trigger_touch(@x+1, @y+1)
             @move_failed = true
             return
          end
        end
      end
    ex_oszev_move_down
  end
 
  #--------------------------------------------------------------------------
  # » Move Left                                                     [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_left move_left
  def move_left(turn_ok = true)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      case self.comment?("", true)
        when "[ExOszA]"
          if passable?(@x - 1, @y) and
             turn_left
             @x = $game_map.round_x(@x-1)
             @real_x = (@x+1)*256
             increase_steps
             @move_failed = false
            return
          else
             turn_left if turn_ok
             check_event_trigger_touch(@x - 1, @y)
             @move_failed = true
            return
          end
        when "[ExOszACustom]"
          if passable?(@x - 2, @y) and
             turn_left
             @x = $game_map.round_x(@x-1)
             @real_x = (@x+1)*256
             increase_steps
             @move_failed = false
            return
          else
             turn_left if turn_ok
             check_event_trigger_touch(@x - 2, @y)
             @move_failed = true
            return
          end
        when "[ExOszB]"
          if passable?(@x - 1, @y) and
             passable?(@x - 1, @y - 1)
             turn_left
             @x = $game_map.round_x(@x-1)
             @real_x = (@x+1)*256
             increase_steps
             @move_failed = false
            return
          else
             turn_left if turn_ok
             check_event_trigger_touch(@x - 1  , @y)
             check_event_trigger_touch(@x - 1, @y - 1)
             @move_failed = true
            return
          end
        when "[ExOszBCustom]"
          if passable?(@x - 1, @y) and
             passable?(@x - 1, @y - 1) and
             passable?(@x - 1, @y - 2)
             turn_left
             @x = $game_map.round_x(@x-1)
             @real_x = (@x+1)*256
             increase_steps
             @move_failed = false
            return
          else
             turn_left if turn_ok
             check_event_trigger_touch(@x - 1 , @y)
             check_event_trigger_touch(@x - 1, @y - 1)
             check_event_trigger_touch(@x - 1, @y - 2)
             @move_failed = true
            return
          end
        when "[ExOszC]"
          if passable?(@x - 2, @y) and
             passable?(@x - 2, @y - 1)
             turn_left
             @x = $game_map.round_x(@x-1)
             @real_x = (@x+1)*256
             increase_steps
             @move_failed = false
            return
          else
             turn_left if turn_ok
             check_event_trigger_touch(@x - 2, @y)
             check_event_trigger_touch(@x - 2, @y - 1)
             @move_failed = true
            return
          end
        end
      end
    ex_oszev_move_left
  end
 
  #--------------------------------------------------------------------------
  # » Move Right                                                    [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_right move_right
  def move_right(turn_ok = true)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      case self.comment?("", true)
        when "[ExOszA]"
          if passable?(@x + 2, @y)
              turn_right
              @x = $game_map.round_x(@x+1)
              @real_x = (@x-1)*256
              increase_steps
              @move_failed = false
              return
          else
              turn_right if turn_ok
              check_event_trigger_touch(@x + 2, @y)
              @move_failed = true
              return
          end
        when "[ExOszACustom]"
          if passable?(@x + 2, @y)
              turn_right
              @x = $game_map.round_x(@x+1)
              @real_x = (@x-1)*256
              increase_steps
              @move_failed = false
              return
          else
              turn_right if turn_ok
              check_event_trigger_touch(@x + 2, @y)
              @move_failed = true
              return
          end
        when "[ExOszB]"
          if passable?(@x + 2, @y)      and
             passable?(@x + 2, @y - 1)
              turn_right
              @x = $game_map.round_x(@x+1)
              @real_x = (@x-1)*256
              increase_steps
              @move_failed = false
              return
          else
              turn_right if turn_ok
              check_event_trigger_touch(@x + 2, @y)
              check_event_trigger_touch(@x + 2, @y - 1)
              @move_failed = true
              return
          end
        when "[ExOszBCustom]"
          if passable?(@x + 1, @y)      and
             passable?(@x + 1, @y - 1)  and
             passable?(@x + 1, @y - 2)
              turn_right
              @x = $game_map.round_x(@x+1)
              @real_x = (@x-1)*256
              increase_steps
              @move_failed = false
              return
          else
              turn_right if turn_ok
              check_event_trigger_touch(@x + 1, @y)
              check_event_trigger_touch(@x + 1, @y - 1)
              check_event_trigger_touch(@x + 1, @y - 2)
              @move_failed = true
              return
          end
        when "[ExOszC]"
          if passable?(@x + 2, @y)      and
             passable?(@x + 2, @y - 1)
              turn_right
              @x = $game_map.round_x(@x+1)
              @real_x = (@x-1)*256
              increase_steps
              @move_failed = false
              return
          else
              turn_right if turn_ok
              check_event_trigger_touch(@x + 2, @y)
              check_event_trigger_touch(@x + 2, @y - 1)
              @move_failed = true
              return
          end
        end
      end
    ex_oszev_move_right
  end
 
  #--------------------------------------------------------------------------
  # » Move up                                                       [ Alias ]
  #--------------------------------------------------------------------------
  alias ex_oszev_move_up move_up
  def move_up(turn_ok = true)
    if $game_switches[ExOSZEvent::EX_OSZEVENT_SW] and self.is_a?(Game_Event)
      case self.comment?("", true)
        when "[ExOszA]"
          if passable?(@x    , @y - 1) and
             passable?(@x + 1, @y - 1)
             turn_up
             @y = $game_map.round_y(@y-1)
             @real_y = (@y+1)*256
             increase_steps
             @move_failed = false
            return
          else
            turn_up if turn_ok
            check_event_trigger_touch(@x, @y - 1)
            check_event_trigger_touch(@x + 1, @y - 1)
            @move_failed = true
            return
          end
        when "[ExOszACustom]"
          if passable?(@x    , @y - 1) and
             passable?(@x + 1, @y - 1) and
             passable?(@x - 1, @y - 1)
             turn_up
             @y = $game_map.round_y(@y-1)
             @real_y = (@y+1)*256
             increase_steps
             @move_failed = false
            return
          else
            turn_up if turn_ok
            check_event_trigger_touch(@x, @y - 1)
            check_event_trigger_touch(@x + 1, @y - 1)
            check_event_trigger_touch(@x - 1, @y - 1)
            @move_failed = true
            return
          end
        when "[ExOszB]"
          if passable?(@x, @y - 2)     and
             passable?(@x + 1, @y - 2)
             turn_up
             @y = $game_map.round_y(@y-1)
             @real_y = (@y+1)*256
             increase_steps
             @move_failed = false
            return
          else
            turn_up if turn_ok
            check_event_trigger_touch(@x, @y - 2)
            check_event_trigger_touch(@x + 1, @y - 2)
            @move_failed = true
            return
          end
        when "[ExOszBCustom]"
          if passable?(@x    , @y - 3)
             turn_up
             @y = $game_map.round_y(@y-1)
             @real_y = (@y+1)*256
             increase_steps
             @move_failed = false
            return
          else
            turn_up if turn_ok
            check_event_trigger_touch(@x, @y - 3)
            @move_failed = true
            return
          end
        when "[ExOszC]"
          if passable?(@x, @y - 2)     and
             passable?(@x - 1, @y - 2) and
             passable?(@x + 1, @y - 2)
             turn_up
             @y = $game_map.round_y(@y-1)
             @real_y = (@y+1)*256
             increase_steps
             @move_failed = false
            return
          else
            turn_up if turn_ok
            check_event_trigger_touch(@x, @y - 2)
            check_event_trigger_touch(@x - 1, @y - 2)
            check_event_trigger_touch(@x + 1, @y - 2)
            @move_failed = true
            return
          end
        end
      end
    ex_oszev_move_up
  end
end

#==============================================================================
# Get Comments
#==============================================================================
# Author  : OriginalWij
# Version : 1.1
#==============================================================================

#==============================================================================
# To use:
#   call:  result = {event}.comment?(comment, return_data = false)
#     comment     - tag to search for
#     return_data - true = returns comment tag/nil, false = returns true/false
#==============================================================================

#==============================================================================
# What this does:
#   checks for a tag in the comments of an event's active page
#==============================================================================

#==============================================================================
# Game_Event
#==============================================================================

class Game_Event
  #--------------------------------------------------------------------------
  # Comment?                                                            [New]
  #-------------------------------------------------------------------------- 
  def comment?(comment, return_data = false)
    if !@list.nil?
      for i in 0...@list.size
        next if @list[i].code != 108 and @list[i].code != 408
        if @list[i].parameters[0].include?(comment)
          return return_data ? @list[i].parameters[0] : true
        end
      end
    end
    return return_data ? nil : false
  end
end

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 74
RMRK Junior
This seems to be working just fine~! Thanks again for going through the trouble. If you happen to need graphics for anything, feel free to drop me a line sometime~

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
After much banging of my head against my desk, I've released version 1.1 (alpha). You can now have events take up any amount of squares on the map that you wish and in (just about) any pattern that you wish. The only thing that doesn't work 100% is passability of the oversized event when detecting impassible tiles and map boundaries while it is moving. Detection of actors and other events should work fine and if the event is stationary, the code works perfectly.
« Last Edit: July 04, 2011, 05:36:27 AM by Exhydra »

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 71
RMRK Junior
Im getting this error.

Line 160: NoMethodError Occurred.

undefined method 'ex_osz_coords' for nil:NilClass

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Hmm, I can't seem to reproduce the error. What leads up to the error? Although, line 160 does seem kind of weak in terms of sanity checking. Line 160 should look like this :

Code: [Select]
event.ex_osz_coords.uniq!



Replace that line with the following code, see if it fixes the issue :

Code: [Select]
event.ex_osz_coords.uniq! unless event == nil

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

***
Rep:
Level 74
I'm baaack!
This is perfect for me since most of my character graphics are 5 times bigger then the RTP size :D


EDIT:

I was about to ask for a bug fix but I noticed it's right above! :D
« Last Edit: July 22, 2011, 09:05:10 PM by Infinate X »

***
Rep:
Level 89
Got the same error :(
http://screenshooter.net/3976831/icyhtdm
After changing this line for "event.ex_osz_coords.uniq! unless event == nil" got another one...
http://screenshooter.net/3976831/mrjgioe
Regards,
Mike

***
Rep:
Level 89
Bump. Can you please check this/update?
Regards,
Mike