The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: exhydra on June 23, 2011, 01:14:45 AM

Title: Oversized Event Support [1.1a]
Post by: exhydra on June 23, 2011, 01:14:45 AM
Oversized Event Support
Version: 1.1a
Author: Exhydra
Date: 6-22-2011

Version History



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


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



Thanks


Support



Known Compatibility Issues


Demo


None

Author's Notes



Restrictions

Title: Re: Oversized Event Support [1.0]
Post by: J. Moreno on June 23, 2011, 07:57:13 AM
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)?
Title: Re: Oversized Event Support [1.0]
Post by: exhydra on June 23, 2011, 08:53:03 AM
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.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.moofah.com%2Ftemp%2Fmedia%2Fimages%2Fjpeg%2Fmboard%2Fosz-example.jpg&hash=ee8851e356640e50aa3540aa181a342d33723a2c)
Title: Re: Oversized Event Support [1.0]
Post by: modern algebra on June 25, 2011, 05:46:11 PM
That's a useful idea. Good work Exhydra.
Title: Re: Oversized Event Support [1.0]
Post by: exhydra on June 25, 2011, 09:04:47 PM
Thankee much. Not sure how many people use over-sized events, but I do a lot.
Title: Re: Oversized Event Support [1.0]
Post by: PentagonBuddy on July 02, 2011, 09:02:38 AM
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 (http://www.youtube.com/watch?v=BblXjTyRTCI), 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)
Title: Re: Oversized Event Support [1.0]
Post by: exhydra on July 02, 2011, 10:07:02 AM
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.
Title: Re: Oversized Event Support [1.0]
Post by: Mitsarugi on July 02, 2011, 05:24:12 PM
this, i can use a lot :) thanks!
great idea
Title: Re: Oversized Event Support [1.0]
Post by: exhydra on July 02, 2011, 07:37:54 PM
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].
Title: Re: Oversized Event Support [1.0]
Post by: PentagonBuddy on July 02, 2011, 11:09:13 PM
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.
Title: Re: Oversized Event Support [1.0]
Post by: exhydra on July 03, 2011, 12:28:53 AM
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
Title: Re: Oversized Event Support [1.0]
Post by: PentagonBuddy on July 03, 2011, 02:43:38 AM
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~
Title: Re: Oversized Event Support [1.1]
Post by: exhydra on July 04, 2011, 05:34:09 AM
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.
Title: Re: Oversized Event Support [1.1a]
Post by: Mr G W on July 12, 2011, 07:16:40 PM
Im getting this error.

Line 160: NoMethodError Occurred.

undefined method 'ex_osz_coords' for nil:NilClass
Title: Re: Oversized Event Support [1.1a]
Post by: exhydra on July 12, 2011, 07:44:55 PM
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
Title: Re: Oversized Event Support [1.1a]
Post by: Infinate X on July 19, 2011, 06:52:14 PM
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
Title: Re: Oversized Event Support [1.1a]
Post by: Fizzly on April 02, 2012, 10:44:17 PM
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
Title: Re: Oversized Event Support [1.1a]
Post by: Fizzly on April 06, 2012, 07:54:44 PM
Bump. Can you please check this/update?