Events Always Under
#1
Events Always Under
Version: 1.0


Introduction
This script is designed to add a new parameter to events that are drawn on the map, the ability to be drawn below the traditional ground level.  This "Always Under" flag,  the polar opposite of the "Always On Top" flag, will have the event drawn at a -1 z-depth,  which will force it  to be rendered under the base ground layer, but still above the panorama graphic.



Script
Code:
#==============================================================================
# ** Events Always Under
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 1.0
#    02-22-2015
#    RGSS & RGSS2 / RPGMaker XP & RPGMaker VX
#==============================================================================
#
#  INTRODUCTION:
#
#  This script is designed to add a new parameter to events that are drawn on
#  the map, the ability to be drawn below the traditional ground level.  This
#  "Always Under" flag,  the polar opposite of the "Always On Top" flag, will
#  have the event drawn at a -1 z-depth,  which will force it  to be rendered
#  under the base ground layer, but still above the panorama graphic.
#
#------------------------------------------------------------------------------
#
#  USAGE:
#
#  Simply put, add the word 'Under' (without the quotes) to your event's name
#  (EX:  EV003 Under),  or create a comment  in your event's list of commands
#  and have that comment  merely read 'Under'  (again, without quotes).  This
#  will flag the event as an 'Always Under' event.
#
#  On personal preference, I would recommend using it within a comment as the
#  event can have the 'Always Under' flag turned on/off  if the event erased,
#  gone from one event page to another, or the like.

#==============================================================================
#
#  NOTE:
#
#  While one can apply a characterset graphic to an event, the 'through' flag
#  in an event will not let the player step upon any such tile.   So if it is
#  the intention  of the game/map designer  for the player  to walk upon such
#  tiles, only use graphics from the tileset for these events.  Additionally,
#  setting the 'through' flag on may actively hamper movement and disable the
#  passages flags.

#==============================================================================
#
#  TERMS AND CONDITIONS:
#
#  Free for use, even in commercial games.  This script was inspired by JayRay
#  who requested this feature, so due credit to both he and I is required.
#
#==============================================================================




#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias always_under_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #     map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    always_under_setup(map_id)
    for e in @events.values
      next if e.nil?
      e.always_under = true if e.name =~ "Under"
      image_flag = false
      if RUBY_VERSION.slice(0,3) == "1.6"
        image_flag = true if e.character_name != ""
      else
        image_flag = true if e.character_name != "" or e.tile_id != 0
      end
      unless image_flag == false or e.list.nil?
        for i in 0...e.list.size
          next if e.list[i].code != 108
          e.always_under = true  if e.list[i].parameters[0] =~ "Under"
        end
      end
    end
  end
end



#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :always_under             # Always Under Flag
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias always_under_initialize initialize
  alias always_under_screen_z screen_z
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    always_under_initialize
    @always_under = false
  end
  #--------------------------------------------------------------------------
  # * Get Screen Z-Coordinates
  #     height : character height
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    return -1 if @always_under
    if RUBY_VERSION.slice(0,3) == "1.6"
      return always_under_screen_z(height)
    else
      return always_under_screen_z
    end
  end
end



#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page
#  switching via condition determinants, and running parallel process events.
#  It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Get Event Name
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
end


Instructions
The instructions are pretty much in the script.  But it is MOSTLY Plug-n-play. :cheery:


Compatibility
This script works for both RPGMaker XP and RPGMaker VX.  I am unsure about it's compatibility with RPGMaker VXAce, but it MAY work.


Terms and Conditions
Free for use, even in commercial games.  This script was inspired by JayRay who requested this feature, so due credit to both he and I is required.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#2
VXAce already has a built-in drop-down of "below characters", "same as characters", "above characters", so it's probably not a necessity.
Reply }
#3
Taylor... This still would be good to have in VXAce... The Event Command "Below Character" per the VXA Engine is just that, still stays on top of the tileA, but below character. This script, if ported to VXA would effectively put it below the tileA layer and above parallax. allowing for better use of parallax mapping.

Personally, I love the idea of parallax mapping without huge images! Huge expanse of grass and dirt patches, with nothing but a 768x768 grass seemless tile and a 1024x1024 event of different dirt blobs. HUGE DIFFERENCE between that and a 3200x3200 (for a 100x100 map)
[Image: yy7iKKb.png]

ITCH: jayray.itch.io
Currently working on Goblin Gulch (MV)
Currently working on JayVinci Resurrection
Currently working on Bakin ABS (BAKIN)
Reply }
#4
Oh, I misread. @ -@ I thought it was referring to under the characters, not under... the ground...

bluh
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Immense Events DerVVulfman 17 19,241 10-28-2024, 03:39 AM
Last Post: DerVVulfman
   Copy Events XP DerVVulfman 12 3,349 05-26-2024, 09:40 PM
Last Post: Mel
   Refreshable Events XP kyonides 1 1,318 06-03-2023, 08:27 AM
Last Post: kyonides
Brick  Allow menu during events - for Visual Novels Taylor 2 7,911 08-25-2011, 12:41 PM
Last Post: Taylor



Users browsing this thread: 1 Guest(s)