Hi, I wish that someone should convert this VX Script for the new tool Rpg Maker MV. I tried to contact the author of the original script but did not receive responses from a month.
Sorry for my English, I do my best.
Thanks in advance to anyone to help me.
Sorry for my English, I do my best.
Thanks in advance to anyone to help me.
Code:
#===============================================================================# Autore : kingartur2(3)# Versione : 1.0#===============================================================================# register_time(id)# Registra nell'evento gli attuali secondi da usare dopo.# ATTENZIONE : per id non si intende l'id dell'evento ma l'id dell'orario# le memorizzazioni sono relative all'evento che si usa## time_event(id)# Da come ritorno l'orario memorizzato## time_passed?(id, time)# Da usare preferibilmente con l'ultimo comando della condizione SE# fa avviare la condizione se sono passati "time" secondi## Apponendo in un evento comune con processo parallelo il commento :# <time : x># l'evento si autoattiverà ogni x secondi se la sua switch è attiva# ATTENZIONE : deve essere un processo parallelo, in ogni altro caso non si# attiverà#===============================================================================class Game_SelfSwitches def true_value(key) return @data[key] endendclass Game_Interpreter def register_time(id) key = [@map_id, @event_it, "time_variable" + id.to_s] $game_self_switches[key] = $game_system.playtime end def time_event(id) key = [@map_id, @event_it, "time_variable" + id.to_s] val = $game_self_switches.true_value(key) val = 0 if val.nil? return val end def time_passed?(id, time) old_time = time_event(id) return ($game_system.playtime - old_time) >= time endendclass RPG::CommonEvent def automatic_time if !@automatic_time.nil? return @automatic_time end for i in @list if i.code == 108 or i.code == 408 if i.parameters[0] =~ /<time : (\d+)>/ @automatic_time = $1.to_i end end end if @automatic_time.nil? @automatic_time = -1 end return @automatic_time endendclass Game_CommonEvent alias fbswhfsdbhb initialize def initialize(common_event_id) fbswhfsdbhb(common_event_id) if @event.automatic_time >= 0 @time_event = true @last_active = $game_system.playtime @register = @event.automatic_time else @time_event = false end end alias fjdsfiudsji? active? def active? return false if @time_event return fjdsfiudsji? end alias fbhsfbdsiuhh update def update fbhsfbdsiuhh if @time_event and (($game_system.playtime - @last_active) >= @register) and $game_switches[@event.switch_id] @last_active = $game_system.playtime $game_temp.reserve_common_event(@event.id) end endend