hello, I need some little help from the pro scripters. I need to get the last id of the event to erase it that triggered from the certain event.
i think my idea is to make a for each or for loop defining every existing event ids inside the new method to get the chosen id to be deleted but i have no idea how can i do it.
Ruby:
#==============================================================================
# ** Event Killing Each Other
#------------------------------------------------------------------------------
# This class handles events. Functions include event page switching via
# condition determinants and running parallel process events. Used within the
# Game_Map class.
#==============================================================================
class Game_Event < Game_Character
#==========================================================================
def get_id_if_dead(i)
a = 0
for @id in 0..i do # for each amount of existing events in the last defined id
until a == i do # tracks down the event id to be erased
a++
end
if a == i # if it gets the right id then erases the chosen id's event
@erased = true # dunno if this works
refresh
end
end
end
#--------------------------------------------------------------------------
# * Trigger Map Event
# triggers : Trigger array
# normal : Is priority set to [Same as Characters] ?
#--------------------------------------------------------------------------
def start_map_event(x, y, triggers, normal, id)
return if $game_map.interpreter.running?
$game_map.events_xy(x, y).each do |event|
if event.trigger_in?(triggers) && event.normal_priority? == normal
get_id_if_dead(event.id) if $game_switches[1] == true # how can i find it's id
event.start
end
end
end
#--------------------------------------------------------------------------
# * Determine if Touch Event is Triggered
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
start_map_event(x, y, [1,2], true)
end
end
i think my idea is to make a for each or for loop defining every existing event ids inside the new method to get the chosen id to be deleted but i have no idea how can i do it.