BDR Event Couter Version: 1.0 for RMVX
By: Fustel
Introduction
Well... did you ever notice those annoying cell door through wich you can speak to the prisonners behind, that you can open, and so on. In RPG Maker terms, they could be Event that sometimes act as Counter Tile (the one you can interact with Events placed behind), somotime don not.
I tried to imagine many solutions (creating an invisibl Counter Tile, calculating the second event position when activating the 'Counter' one, etc...), but to no avail. Or at least getting a confused thing...
So I had to to script the 'perfect' solution; ens then hers is another BRR script thing.
Features
Screenshots
Demo
Script
Instructions
FAQ
Compatibility
No issue known
Credits and Thanks
All done by myself
Author's Notes
And... do I have to say that 'f...' stands for 'funny' ?
Terms and Conditions
You may not use this in a commercial game without my explicit permission.
You may not post this script anywhere without my explict permission.
You must give me credit.
By: Fustel
Introduction
Well... did you ever notice those annoying cell door through wich you can speak to the prisonners behind, that you can open, and so on. In RPG Maker terms, they could be Event that sometimes act as Counter Tile (the one you can interact with Events placed behind), somotime don not.
I tried to imagine many solutions (creating an invisibl Counter Tile, calculating the second event position when activating the 'Counter' one, etc...), but to no avail. Or at least getting a confused thing...
So I had to to script the 'perfect' solution; ens then hers is another BRR script thing.
Features
- Allow to interact to an evet through another one
- The Counter flag is set/unset for each page of the event
Screenshots
Demo
http://www.mediafire.com/?t4o97l69afalr9m
Just try ecerything you can.
Notice that if to try to speak to the prisoner through the door while holding the key, he won't answer (page 2 of the door doesn't have the BDR_EVENT_COUNTER comment)
Just try ecerything you can.
Notice that if to try to speak to the prisoner through the door while holding the key, he won't answer (page 2 of the door doesn't have the BDR_EVENT_COUNTER comment)
Script
Code:
#==============================================================================
# ** BDR Event Counter
#------------------------------------------------------------------------------
# © Fustel, 2010
# 02/11/10
# Version 1.0
#------------------------------------------------------------------------------
# VERSION HISTORY:
# - 1.0 (02/11/10), Initial release
#------------------------------------------------------------------------------
# INSTRUCTIONS:
# - Place this script in the 'Materials' section
# - To make en event a counter when a set page is active,
# insert a comment in that page, containing the following line:
# BDR_EVENT_COUTER
#------------------------------------------------------------------------------
# NOTES
# - Only when the page with the tag is active will the event act as
# a counter
# - If the EventPage acts as a couter, its normal script is not run
# - An EventPage acts as a couter if
# - it contains the BDR_EVENT_COUTER comment
# - both EventPages (the 'counter one and the one behind)
# priority_tupe is set to 'same as character'
# - both EventPages (the 'counter one and the one behind)
# triggers is set to 'action button'
#=====================================================================
class Game_Event < Game_Character
BDR_EVENT_COUTER = "BDR_EVENT_COUTER"
attr_reader :bdr_event_counter
alias bdr_eventcounter_initialize initialize
def initialize(map_id, event)
@bdr_event_counter = false
bdr_eventcounter_initialize(map_id, event)
end
alias bdr_eventcounter_setup setup
def setup(new_page)
bdr_eventcounter_setup( new_page)
@bdr_event_counter = false
if @page != nil
for command in @page.list
next unless [ 108, 408].include?( command.code)
s = command.parameters[ 0].upcase.delete " "
@bdr_event_counter = true if s == BDR_EVENT_COUTER.upcase
end
end
end
end
class Game_Player < Game_Character
alias bdr_eventcounter_check_event_trigger_there check_event_trigger_there
def check_event_trigger_there(triggers)
return false if $game_map.interpreter.running?
result = false
cnt = false
front_x = $game_map.x_with_direction(@x, @direction)
front_y = $game_map.y_with_direction(@y, @direction)
front_front_x = $game_map.x_with_direction(front_x, @direction)
front_front_y = $game_map.y_with_direction(front_y, @direction)
for event in $game_map.events_xy(front_x, front_y)
next if event == nil
next unless event.priority_type == 1
next unless event.trigger == 0
next unless event.bdr_event_counter
cnt = true
end
if cnt
for event in $game_map.events_xy(front_front_x, front_front_y)
next if event == nil
next unless event.priority_type == 1
next unless event.trigger == 0
result = true
event.start
end
end
result = bdr_eventcounter_check_event_trigger_there(triggers) unless result
return result
end
end
Instructions
- Copy the script in the 'Materials' section, below 'BDR Damage'
- Insert a comment containg the following line in any page you want to act as a couter
BDR_EVENT_COUNTER
FAQ
Compatibility
No issue known
Credits and Thanks
All done by myself
Author's Notes
- Only when the page with the tag is active will the event act as a counter
- If the EventPage acts as a couter, its normal script is not run
- An EventPage acts as a couter if
- it contains the BDR_EVENT_COUTER comment
- both EventPages (the 'counter one and the one behind) priority_tupe is set to 'same as character'
- both EventPages (the 'counter one and the one behind) triggers is set to 'action button'
And... do I have to say that 'f...' stands for 'funny' ?
Terms and Conditions
You may not use this in a commercial game without my explicit permission.
You may not post this script anywhere without my explict permission.
You must give me credit.