Registrarse

error con script de día en rpg maker xp [1]

Estado
Cerrado para nuevas respuestas.

TheGatolete2

¿Sin puesto de mod para mi no hay paraíso?.
punto 1 trato de poner este script

#=======================================#
# ââ€â€œ¦nbsp; class Game_Title #
# Written: Deke
# Rewiten: Near Fantastica
# Tweaked: Silentdragon
# Shared & Upgraded: Cloud_FFVII
# Para activar el Script en un Mapa Especifico, agregar * al final del nombre del mapa
#------------------------------------------------------------------------------#
#=======================================#
class Game_Time

attr_accessor :minute_length
attr_accessor :hours
attr_accessor :minutess
attr_accessor :timess

def initialize
@minute_length= 60.0 #length of game minute in real seconds
@hour_length= 60.0 #minute in an hour
@day_length=24.0 #hours in a day
@month_length=30.0 #days in a month
@year_length=12.0 #months in a year
@minutes=0 #starting minute count
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end

def get_time
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_tone
get_time
hour=hours
minutes=minutess + hour*@hour_length
phase_shift=Math::pI*(minutes/(@hour_length*@day_length))
illumination= -150+ 165*Math.sin(phase_shift)
tone=Tone.new(illumination,illumination,illumination,0)
return tone
end

end # of class Game_Time

#=======================================#
# ââ€â€œ¦nbsp; class Window_Time #
# written by Deke #
#------------------------------------------------------------------------------#
#=======================================#
class Window_Time < Window_Base

#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Time" window font
self.contents.font.size = $defaultfontsize
refresh
end

#--------------------------------------------------------------------------
def refresh
$game_time.get_time
self.contents.clear
@total_sec = Graphics.frame_count / Graphics.frame_rate
@minute=$game_time.minutess
hour = $game_time.hours
pm_flag= hour >=12 ? true : false
hour= hour >= 12 ? hour-12 : hour
if hour.floor==0
text=sprintf("%02d:%02d",12,@minute)
else
text=sprintf("%02d:%02d",hour,@minute)
end
if pm_flag
text += " PM"
else
text += " AM"
end
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end

#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.minutess != @minute
refresh
end
end
end # of class

#=======================================
class Game_Temp
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Game Temp
#--------------------------------------------------------------------------
alias dns_game_temp_initalize initialize
#--------------------------------------------------------------------------
# ââ€â€�? Refer the Attr
#--------------------------------------------------------------------------
attr_reader :map_infos #Added Lines
attr_reader :eek:utside_array #Added Lines
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Scene Map
#--------------------------------------------------------------------------
def initialize
dns_game_temp_initalize
@outside_array = Array.new
@map_infos = load_data("Data/MapInfos.rxdata")
for key in @map_infos.keys
@outside_array[key] = @map_infos[key].name.include?("*")
end
end
end

#=======================================
class Scene_Map
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_map_main main
alias dns_scene_map_update update
#--------------------------------------------------------------------------
# ââ€â€�? Main
#--------------------------------------------------------------------------
def main
if $game_temp.outside_array[$game_map.map_id]
tone=$game_time.get_tone
$game_time.get_time
@minute=$game_time.minutess
$game_screen.start_tone_change(tone, 0)
end
# スãÆ’â€â€�ãÆ’©ã‚¤ãƒˆã‚»ãƒƒトをä½Å“æˆ?
@spriteset = Spriteset_Map.new
# ãÆ’¡ãÆ’Æ’ã‚»ãÆ’¼ã‚¸ã‚¦ã‚£ãÆ’³ãƒ‰ã‚¦ã‚’ä½Å“æˆ?
@message_window = Window_Message.new
# トãÆ’©ãÆ’³ã‚¸ã‚·ãÆ’§ãÆ’³å®Å¸è¡Å’
Graphics.transition
# ãÆ’¡ã‚¤ãÆ’³ãÆ’«ãÆ’¼ãÆ’â€â€�
loop do
$light_effects.refresh
# ゲãÆ’¼ãÆ’ çâ€�»é?¢ã‚’æ›´æâ€â€œ°
Graphics.update
# 入力æÆ’â€¦å ±ã‚’æ›´æâ€â€œ°
Input.update
# ãĥãÆ’¬ãÆ’¼ãÆ’ æ›´æâ€â€œ°
update
# çâ€�»é?¢ã?Œ切り替ã‚?ã?£ã?Ÿã‚‰ãÆ’«ãÆ’¼ãÆ’â€â€�ã‚’ä¸*æâ€â€œ*
if $scene != self
break
end
end
# トãÆ’©ãÆ’³ã‚¸ã‚·ãÆ’§ãÆ’³æºâ€â€œå‚™
Graphics.freeze
# スãÆ’â€â€�ãÆ’©ã‚¤ãƒˆã‚»ãƒƒトを解æâ€�¾
@spriteset.dispose
# ãÆ’¡ãÆ’Æ’ã‚»ãÆ’¼ã‚¸ã‚¦ã‚£ãÆ’³ãƒ‰ã‚¦ã‚’解æâ€�¾
@message_window.dispose
# タイトãÆ’«çâ€�»é?¢ã?«åˆ‡ã‚Šæ›¿ã?ˆä¸*ã?®å ´å?ˆ
if $scene.is_a?(Scene_Title)
# çâ€�»é?¢ã‚’ãĥェãÆ’¼ãƒ‰ã‚¢ã‚¦ãƒˆ
Graphics.transition
Graphics.freeze
end
$light_effects.hide
end
#--------------------------------------------------------------------------
# ââ€â€�? Update
#--------------------------------------------------------------------------
def update
$game_time.get_time
$light_effects.update
conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.minutess != @minute
conditional2 =$game_temp.outside_array[$game_map.map_id] and @current_id != $game_map.map_id
if conditional1 or conditional2
tone=$game_time.get_tone
$game_screen.start_tone_change(tone, 0)
@minute = $game_time.minutess
$game_map.need_refresh=true
@current_id=$game_map.map_id
end
if $game_temp.outside_array[$game_map.map_id] == false and @current_id != $game_map.map_id
$game_screen.start_tone_change(Tone.new(0,0,0,0),0)
@current_id=$game_map.map_id
end
dns_scene_map_update
end
end

#======================================================
class Scene_Title
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_title_update update
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Scene Map
#--------------------------------------------------------------------------
def update
$game_time=Game_Time.new
#Dubealex Addition (from XRXS) to show Map Name on screen
dns_scene_title_update
end
end

class Game_Map
#--------------------------------------------------------------------------
# ââ€â€�? Refer the attr
#--------------------------------------------------------------------------
attr_reader :eek:utside
attr_reader :map_id
#--------------------------------------------------------------------------
# ââ€â€�? Outside
#--------------------------------------------------------------------------
def outside
return $game_temp.outside_array[@map_id]
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Light Effect System
#------------------------------------------------------------------------------
#  By: Near Fantastica
# Date: 13/2/05
#
# Addes light Effects to the DNS so objects glow and have ground effect lighting...
#==============================================================================

class Light_Effect_System
#--------------------------------------------------------------------------
# ââ€â€�? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :picture_le
attr_accessor :event_list
attr_accessor :type_list
#--------------------------------------------------------------------------
# ââ€â€�? Initialization
#--------------------------------------------------------------------------
def initialize
@event_counter = 0
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects on Map Change
#--------------------------------------------------------------------------
def setup
# Setup Event Max
@event_counter = 0
for i in 1..999
if $game_map.map.events.id > @event_counter
@event_counter = $game_map.map.events.id
end
end
#
for i in 1..@event_counter
if $game_map.map.events == nil
next
end
case $game_map.map.events.name
when "Ground"
ground(i)
when "Fire"
fire(i)
when "Lamp Post"
lamp(i)
when "Left Lantern"
left_lantern(i)
when "Right Lantern"
right_lantern(i)
end
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Updates the Array based on time of day
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.hours > 7 and $game_time.hours < 14
hide
else
show
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Updates the XY of the sprites
#--------------------------------------------------------------------------
def refresh
for i in 0..$light_effects.picture_le.size - 1
case $light_effects.type_list
when "Ground"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 200 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 200 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Fire"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 300 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 300 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Left Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 5
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
when "Right Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 25
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
$light_effects.picture_le.visible = true
when "Left Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 20
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
when "Right Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 10
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Redraws the Array
#--------------------------------------------------------------------------
def redraw
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.bitmap.dispose
end
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Shows Array
#--------------------------------------------------------------------------
def show
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Hides Array
#--------------------------------------------------------------------------
def hide
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = false
end
end
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects for Ground
#--------------------------------------------------------------------------
def ground(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 200 / 100.0
light_effects.zoom_y = 200 / 100.0
light_effects.z = 1000
light_effects.opacity = 50
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Ground")
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects for Fire
#--------------------------------------------------------------------------
def fire(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 300 / 100.0
light_effects.zoom_y = 300 / 100.0
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Fire")
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects for Lamp
#--------------------------------------------------------------------------
def lamp(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lamp Post")
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lamp Post")
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def left_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lantern")
end
#--------------------------------------------------------------------------
# ââ€â€�? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def right_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lantern")
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Game_Map
#------------------------------------------------------------------------------
#  Add defenision of the names to Game Map Class
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# ââ€â€�? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :map
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Game Map
#--------------------------------------------------------------------------
alias les_game_map_setup setup
#--------------------------------------------------------------------------
# ââ€â€�? Refers the Map Setup
#--------------------------------------------------------------------------
def setup(map_id)
$light_effects.redraw
les_game_map_setup(map_id)
$light_effects.setup
end
end

#==============================================================================
# ââ€â€œ¦nbsp; Scene_Title
#------------------------------------------------------------------------------
#  It is the class which processes the title picture
#==============================================================================

class Scene_Title
#--------------------------------------------------------------------------
# ââ€â€�? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias les_scene_title_update update
#--------------------------------------------------------------------------
# ââ€â€�? Sets up the ABS
#--------------------------------------------------------------------------
def update
$light_effects = Light_Effect_System.new
les_scene_title_update
end
end


y al hacerlo funcionar me sale un error no se si mi version de rpg maker xp no es la correcta para el script o mi pokemon essentials ya tiene el script puesto

a qui sale el error



al poner $ , @ , & me sale el error pero al poner algún símbolo no me aparecerá al error pero al borrar script no me vuelve a salir el error no si el script estará malo

pd en algo del script en ves de aparecer el script sin ningún problema copiado aperecio un emoticon

pd2 me salio un error al hacer el tema con lo cual no me sale las etiquetas
 
Última edición por un moderador:

Seizera

Just passing
Respuesta: error con script de día en rpg maker xp

Pues amigo dice que en la linea 51 pero queda duro buscarla en el texto de el spoiler bro.
si la remarcas o sacas esa linea te podría ayudar es que soy vago xD.
pues le entiendo más o menos a el RGSS el lenguaje de programación que usa.
 

TheGatolete2

¿Sin puesto de mod para mi no hay paraíso?.
Respuesta: error con script de día en rpg maker xp

Pues amigo dice que en la linea 51 pero queda duro buscarla en el texto de el spoiler bro.
si la remarcas o sacas esa linea te podría ayudar es que soy vago xD.
pues le entiendo más o menos a el RGSS el lenguaje de programación que usa.
re:kaze esta tratando de poner un script para que a ya día y noche en el juego por lo que sabe el pokemon essentials ese script de día y noche ya viene con el pokemon essentials o uno lo tiene que poner y como hago que los mapas nuevos salgan con lo de día y noche por los que vienen por defecto ya sale eso del día
y la noche pd tengo pokemon essentials 7 en este vídeo de youtube encontré el script

[HD] [ESP] RPG MAKER XP - TUTORIAL 14 (1/1) - YouTube

dime los nombres de las verciones de rpg maker xp que hay
 

Seizera

Just passing
Respuesta: error con script de día en rpg maker xp

Son engines completamente diferentes,así que no te funcionará así no más amigo.
 

TheGatolete2

¿Sin puesto de mod para mi no hay paraíso?.
Respuesta: error con script de día en rpg maker xp

Son engines completamente diferentes,así que no te funcionará así no más amigo.
re:kaze bien respondo lo de si el pokemon essentials ya venia por defecto el script de día y noche ,sabes como hacer que un mapa nuevo echo en el pokemon essentials aparezca lo de día y noche
 

TheGatolete2

¿Sin puesto de mod para mi no hay paraíso?.
Respuesta: error con script de día en rpg maker xp

http://whackahack.com/foro/t-duda-pokemon-essentials-dia-y-noche
eso creo que lo soluciona.
ahí explican todo bien en el mensaje 2 creo.
Deberías buscar bien antes de preguntar xD.
re:kaze con gracias por el dato del tema pero con este tema me refería a un error de script gracias de todas formas por ese tutorial pero en fin otro dato tengo un tema y nadie me a comentado

http://whackahack.com/foro/t-script-de-clima-pedido-y-duda-script-y-sprites

pd lo del tutorial sirvió pero en este temas estamos hablando de un error de script mira lo primero y busca se linea 51
 
Última edición:

Xabier2012

Usuario mítico
Respuesta: error con script de día en rpg maker xp

Mira este scipt simple de día y noche, pd: las instrucciones vienen al principio del script.

Crear una nueva clase por encima de "Main" con cualquier nombre y copiad en ella el siguiente código:#==========================================================================
=====

# Script Simple de Dí*a y Noche
#
# Versión : 0.3.2 - 28.03.08
# Creado por: hellMinor
# Descripción: Un simple script que cambia el tono de la pantalla para emular
# el dí*a o la noche. Se basa en los pasos o la hora del sistema.
#
#==========================================================================
=====


#==========================================================================
=====

# Map-Detection F.A.Q.
#==========================================================================
=====

# Si tienes un mapa interior en el que no se muestran efectos de dí*a y noche
# simplemente pon [int] al comienzo del nombre del mapa.
# Al entrar a este tipo de mapas, el script cambiará inmediatamente el
# tono de pantalla a $daytone y todos los cambios hechos por el scrip serán
# ignorados.
#
# Algunos mapas interiores necesitan ser oscuros,como cuevas. Sólo pon [dint]
# al comienzo del nombre dle mapa para marcarlo como mapa interior oscuro.
# El script cambiará el tono a $nighttone en vez de $daytone
#
# Mientras, el tiempo sigue pasando en el mapa interior, y cuando salgas del
# interior se cambiará al tono de tiempo actual del juego.
#==========================================================================
=====

# Get-Time F.A.Q.
#==========================================================================
=====

# Si necesitas obtener el tiempo actual, puedes usar esto en Llamar Script:
# para obtener el tiempo actual:
# $game_variables[0001] = $dayandnight.getTime
# para obtener la hora actual:
# $game_variables[0001] = $dayandnight.getHour
# o para obtener el minuto actual:
# $game_variables[0001] = $dayandnight.getMinute
#
# $game_variables[0001] será la primera variable en la base de datos.
# Para usar otra variable, cambia el 0001 a algo >5000
#
#==========================================================================
=====


class DayAndNight < Game_Screen
#==========================================================================
=====

# Configuración Principal
#--------------------------------------------------------------------------
----
$active = true # Activa/Desactiva el script
$timesystem = 1 # Determina qué tipo de sistema está activo
# 0 = Sistema por Pasos
# 1 = Sistema por Hora
$fadingtime = 4 # Velocidad a la que cambia el tono (en segundos)
#--------------------------------------------------------------------------
-----
$dusktone = Tone.new(-68, -51, -9, 25) # Tono al Anochecer
$nighttone = Tone.new(-136, -102, -17, 51) # Tono por la Noche
$dawntone = Tone.new(-20, -51, -68, 0) # Tono al Amanecer
$daytone = Tone.new(0, 0, 0, 0) # Tono por el Dí*a
#--------------------------------------------------------------------------
-----
# Timesystem config
#--------------------------------------------------------------------------
-----
$starting_time = "night" # Determina la fase de inicio
# "day" para dí*a ,"dusk" para anochecer
# "dawn" para amanecer y "night" para noche.
# Notas: Por defecto es "night".
# ¡¡Cualquier otro cambiará TODOS los cálculos
# hechos con Graphics.frame_counter!!

$divider = 1 # Decide la velocidad a la que corre el Sistema Temporal
# Ej: 2 = Doble velocidad (30 segundos = 1 hora)
# Ej: 0,5 = Mitad de Velocidad (2 minutos = 1 hora)
$dusktime = 7 # Cambia al anochecer en $dusktime
$daytime = 8 # Cambia al dí*a en $daytime
$dawntime = 19 # Cambia al amanecer en $dawntime
$nighttime = 20 # Cambia a la noche en $nighttime
#--------------------------------------------------------------------------
----
# Configuración de los Pasos
#--------------------------------------------------------------------------
----
$count = 0 # Cuenta cuántos pasos hay entre un periodo
$maxsteps = 200 # Cuántos pasos hay entre el cambio dí*a/noche
#--------------------------------------------------------------------------
-----
# Comprobaciones
#--------------------------------------------------------------------------
----
$day = true # Comprueba si es de dí*a
$dusk = false # Comprueba si anochece
$dawn = false # Comprueba si amanece
$night = false # Comprueba si es de noche
#--------------------------------------------------------------------------
-----
def change?
if $count >= $maxsteps
if $day
doDusk
end
if $dusk
doNight
end
if $night
doDawn
end
if $dawn
doDay
end
end
end
#--------------------------------------------------------------------------
-----
def doNight
if $dayandnight.exterior?
$game_map.screen.start_tone_change($nighttone,$fadingtime*60)
end
$count = 0
$day = false
$dusk = false
$dawn = false
$night = true
end
#--------------------------------------------------------------------------
-----
def doDay
if $dayandnight.exterior?
$game_map.screen.start_tone_change($daytone,$fadingtime*60)
end
$count = 0
$day = true
$night = false
$dawn = false
$dusk = false
end
#--------------------------------------------------------------------------
-----
def doDawn
if $dayandnight.exterior?
$game_map.screen.start_tone_change($dawntone,$fadingtime*60)
end
$count = 0
$day = false
$night = false
$dusk = false
$dawn = true
end
#--------------------------------------------------------------------------
-----
def doDusk
if $dayandnight.exterior?
$game_map.screen.start_tone_change($dusktone,$fadingtime*60)
end
$count = 0
$day = false
$night = false
$dusk = true
$dawn = false
end
#--------------------------------------------------------------------------
-----
def updateclock
clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
hour = clocktime / 60 % 24
minutes = clocktime % 60
if hour == $dawntime && minutes == 0
doDawn
end
if hour == $daytime && minutes == 0
doDay
end
if hour == $dusktime && minutes == 0
doDusk
end
if hour == $nighttime && minutes == 0
doNight
end
end
#--------------------------------------------------------------------------
-----
def interior?
if($game_map.name.to_s.index("[int]") != nil)
return true
end
end
#--------------------------------------------------------------------------
-----
def exterior?
if($game_map.name.to_s.index("[int]") == nil &&
$game_map.name.to_s.index("[dint]") == nil)
return true
end
end
#--------------------------------------------------------------------------
-----
def dark_interior?
if($game_map.name.to_s.index("[dint]") != nil)
return true
end
end
#--------------------------------------------------------------------------
-----
def get_state_tone
if $dawn
return $dawntone
end
if $day
return $daytone
end
if $dusk
return $dusktone
end
if $night
return $nighttone
end
end
#--------------------------------------------------------------------------
-----
def getTime
clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
hour = clocktime / 60 % 24
minutes = clocktime % 60
return hour.to_s+":"+minutes.to_s
end
#--------------------------------------------------------------------------
-----
def getHour
clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
hour = clocktime / 60 % 24
return hour
end
#--------------------------------------------------------------------------
-----
def getMinute
clocktime = Graphics.frame_count / (Graphics.frame_rate/$divider)
minutes = clocktime % 60
return minutes
end

end
#==========================================================================
=====


class Game_Character
#==========================================================================
=====


def increase_steps
@stop_count = 0
if $active && $timesystem == 0
$count += 1
$dayandnight = DayAndNight.new
$dayandnight.change?
end
update_bush_depth
end

end
#==========================================================================
=====


class Game_Map
#==========================================================================
=====


def initialize
@screen = Game_Screen.new
if $active && $timesystem == 1
$dayandnight = DayAndNight.new
end
@interpreter = Game_Interpreter.new(0, true)
@map_id = 0
@display_x = 0
@display_y = 0
create_vehicles
end
#--------------------------------------------------------------------------
-----
def update
refresh if $game_map.need_refresh
update_scroll
update_events
update_vehicles
update_parallax
if $active && $timesystem == 1
$dayandnight.updateclock
end
@screen.update
end

def name
$data_mapinfos[@map_id]
end

end
#==========================================================================
=====


class Scene_Map
#==========================================================================
=====


def fadein(duration)
Graphics.transition(0)
if $active && $dayandnight.interior?
$game_map.screen.start_tone_change($daytone,1)
else if $active && $dayandnight.dark_interior?
$game_map.screen.start_tone_change($nighttone,1)
else if $active && $dayandnight.exterior?
$game_map.screen.start_tone_change($dayandnight.get_state_tone,1)
end
end
end
for i in 0..duration-1
Graphics.brightness = 255 * i / duration
update_basic
end
Graphics.brightness = 255
end

end
#==========================================================================
=====


class Scene_Title
#==========================================================================
=====


alias load_database_additions load_database
def load_database
load_database_additions
$data_mapinfos = load_data("Data/MapInfos.rvdata")
for key in $data_mapinfos.keys
$data_mapinfos[key] = $data_mapinfos[key].name
end
end

alias command_new_game_additions command_new_game
def command_new_game
command_new_game_additions
Graphics.frame_count += 25200/$divider if $starting_time == "dawn"
Graphics.frame_count += 28800/$divider if $starting_time == "day"
Graphics.frame_count += 68400/$divider if $starting_time == "dusk"
end

end

#==========================================================================
=====

# Game-Time-Hotfix
#==========================================================================
=====


#==========================================================================
=====


class Window_SaveFile < Window_Base
#==========================================================================
=====


def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
begin
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
@game_system = Marshal.load(file)
@game_message = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
case $starting_time
when "night"
@total_sec = @frame_count / Graphics.frame_rate
when "dawn"
@total_sec = @frame_count-(25200/$divider) / Graphics.frame_rate
when "day"
@total_sec = @frame_count-(28800/$divider) / Graphics.frame_rate
when "dusk"
@total_sec = @frame_count-(68400/$divider) / Graphics.frame_rate
end
rescue
@file_exist = false
ensure
file.close
end
end
end

end
 

TheGatolete2

¿Sin puesto de mod para mi no hay paraíso?.
Respuesta: error con script de día en rpg maker xp

veo que lo del tutorial de este link de me ser mejor a si que cierren el tema a petición mía

por suerte aquí estamos hablando de un error de script no un pedido de tutorial
 

Edo

You've met with a terrible fate, haven't you?
Miembro de honor
Respuesta: error con script de día en rpg maker xp

Cierro el tema, entonces.
 
Estado
Cerrado para nuevas respuestas.
Arriba