- Сообщений: 14
- Спасибо получено: 0
Правила раздела:
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.
Ночное время суток!
16 года 9 мес. назад #28007
от Хвост
Хвост создал тему: Ночное время суток!
Как VX сделать ночное время суток!!
Например Лес, ночь, ну и конечно Костер от которого светло естественно!
Или подвал темный с факелами на стене!!
Если можно расскажите по подробней как можна так сделать!??
Например Лес, ночь, ну и конечно Костер от которого светло естественно!
Или подвал темный с факелами на стене!!
Если можно расскажите по подробней как можна так сделать!??
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
16 года 9 мес. назад #28014
от Kuraudo
Это все, потому что я ужасный тип.
Kuraudo ответил в теме Ночное время суток!
Уф, сто лет не открывал VX, но по моему ночное время суток там делается так же как и на остальных мукерах, а именно через команду Change Screen Color Tone(название по аналогии).
Если хочешь сделать освещение в определенных местах, то придется использовать фог, где в нужных местах будут "дырки", - в итоге визуально будет казаться, что везде тьма, а возле мест освещения исходит свет.
Если хочешь сделать освещение в определенных местах, то придется использовать фог, где в нужных местах будут "дырки", - в итоге визуально будет казаться, что везде тьма, а возле мест освещения исходит свет.
Это все, потому что я ужасный тип.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
16 года 9 мес. назад - 16 года 9 мес. назад #28022
от Хвост
Хвост ответил в теме Ночное время суток!
Я если чесно плохо еще знаю мекер и начел с VX!
Обесните плиз как нить по другому, знаю как можно EV сделать эффект что бы было темно!
А чтобы заставить объекты светится это для меня сложно!
Если можно обесните пожалусто по пунктам
Обесните плиз как нить по другому, знаю как можно EV сделать эффект что бы было темно!
А чтобы заставить объекты светится это для меня сложно!
Если можно обесните пожалусто по пунктам
Последнее редактирование: 16 года 9 мес. назад пользователем Хвост.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
16 года 9 мес. назад - 16 года 9 мес. назад #28024
от mephis
→ → ↓ ↑ Y
mephis ответил в теме Ночное время суток!
"Время суток", два рецепта.
1. Для тех, кто НЕ ПОНИМАЕТ скрипты.
В ивенте выполнить стандартную команду "Tint Screen".
Параметры "Color Tone" подбирать на свой вкус. Примерные значения для разного времени суток (красный, зелёный, синий):
2. Для тех, кто ПОНИМАЕТ скрипты.
Использовать тёплый ламповый скрипт из KGC Scripts Library.
Позволяет возложить заботу о смене времени суток на игровой движок. Настраивается всё до мелочей. Плюс ко всему вводится и система дней недели (очевидно для создания расписаний для магазинов и т.п.). Как и все скрипты из этой библиотеки хорошо документирован. Но, что НЕ внезапно, на английском.
Не спрашивайте меня как его использовать, т.к. это для тех кто понимает. Для остальных - первый вариант.
Текст скрипта:
______________________________________________________
"Освещение". Вообще рецептов целая куча, вплоть до реализации динамического построения теней от движущихся объектов. Автору дам вариант попроще.
Объясняю пошагово, для совсем начинающих.
1. Для тех, кто НЕ ПОНИМАЕТ скрипты.
В ивенте выполнить стандартную команду "Tint Screen".
Параметры "Color Tone" подбирать на свой вкус. Примерные значения для разного времени суток (красный, зелёный, синий):
- День (0, 0, 0)
- Вечер (-32, -96, -96)
- Ночь (-128, -128, -32)
- Утро (-48, -48, -16)
2. Для тех, кто ПОНИМАЕТ скрипты.
Использовать тёплый ламповый скрипт из KGC Scripts Library.
Позволяет возложить заботу о смене времени суток на игровой движок. Настраивается всё до мелочей. Плюс ко всему вводится и система дней недели (очевидно для создания расписаний для магазинов и т.п.). Как и все скрипты из этой библиотеки хорошо документирован. Но, что НЕ внезапно, на английском.
Не спрашивайте меня как его использовать, т.к. это для тех кто понимает. Для остальных - первый вариант.
Текст скрипта:
ВНИМАНИЕ: Спойлер!
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Day-to-Night Phases - KGC_DayNight ◆ VX ◆
#_/ ◇ Last update : 2008/03/08 ◇
#_/ ◆ Translated by Mr. Anonymous ◆
#_/-----------------------------------------------------------------------------
#_/ This script adds the concept of Day-to-Night phase shifting to your game.
#_/ Events that only occur during certain phase shifts, such as night, can
#_/ be created as well.
#_/=============================================================================
#_/ Note: The event command "Tint Screen" doesn't function normally while this
#_/ script is running a phase shift. To use the Tint Screen function properly,
#_/ please refer to the directions.
#_/=============================================================================
#_/ Installation: Insert above Main.
#_/-----------------------------------------------------------------------------
#_/ Terminology: Phase refers to the current state of the day, such as "Noon".
#_/ ◆ Instructions For Usage ◆
#_/
#_/ ◆ Stop Day-to-Night ◆
#_/ When [DN_STOP] is inserted into a Map's name (after its given name), the
#_/ Day-to-Night change stops, the timer does not stop however, and if a phase
#_/ is currently active, such as "Night", the tint remains on the map.
#_/
#_/ ◆ Stop Day-to-Night and Time, Cancel Phase ◆
#_/
#_/ When [DN_VOID] is inserted into a Map's name (after its given name), the
#_/ Day-to-Night change stops, the timer is effectively frozen, and if a phase
#_/ is currently active, such as "Night", the tint is reverted back to normal.
#_/
#_/ ◆ Phase-Specific Encounters ◆
#_/
#_/ When [DN Phase#](Where Phase# refers to the phase. 0 = Noon, 1 = Evening,
#_/ 2 = Night, 3 = Morning) is inserted into a specified Troop's "Notes" box
#_/ in the Troops tab of the database, the specified Troop will only appear
#_/ under those conditions.
#_/
#_/ ◆ Event Script Functions ◆
#_/ The following commands are available using the "Script" item in events.
#_/
#_/ * stop_daynight
#_/ Day to Night change is stopped.
#_/
#_/ * start_daynight
#_/ Day to Night change is started.
#_/
#_/ * get_daynight_name
#_/ Name of present phase is acquired. This function only works in other
#_/ scripts.
#_/
#_/ * get_daynight_week (variable_id)
#_/ Appoints the day of the week to the given variable.
#_/
#_/ * get_daynight_week_name
#_/ Name of the present day is aquired. This function only works in other
#_/ scripts.
#_/
#_/ * change_daynight_phase(phase, duration, pass_days)
#_/ Changes the current phase to a new one. Handy for Inns and the like.
#_/ Example: change_daynight_phase (3, 1, 1)
#_/ This would make one day pass, change the phase to morning, with a
#_/ duration of one frame. Duration must be set to a minimum of 1.
#_/
#_/ * transit_daynight_phase(duration)
#_/ Forces the phase to change at the very moment you call this.
#_/ This appears to be bugged. No matter how I've called it, I get errors.
#_/
#_/ * set_daynight_default(duration)
#_/ Forces the tint of the current phase to reset to the initial phase.
#_/
#_/ * restore_daynight_phase(duration)
#_/ Forces the tint of the current phase to reset to its normal tint.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#==============================================================================#
# ★ Customization ★ #
#==============================================================================#
module KGC
module DayNight
# ◆ Day to Night Switch Method ◆
# 0. Time Lapse 1.Time passes with number of steps 2.Real Time
METHOD = 1
# ◆ Phase Variable ◆
# The present phase (of day and night) is stored here.
PHASE_VARIABLE = 11
# ◆ Passing Days Storage Variable ◆
# The passing days is stored here.
PASS_DAYS_VARIABLE = 12
# ◆ Stop On Event Toggle ◆
# Stops the Day/Night Timer when an event is run by player.
STOP_ON_EVENT = false
# ◆ Phases During Combat ◆
# true = Only the battleback is tinted.
# false = Battleback and enemies are tinted.
TONE_BACK_ONLY_IN_BATTLE = true
# ◆ Setting Individual Phases ◆
# Each phase makes use of the Tint Screen function. The format as follows:
# ["Name", the color tone(Tint), time switch],
#
# [Name]
# Name of Phase
# *The name holds no significance.
# [Tint]
# The color tone of the entire screen.
# Please don't alter this if you don't grasp color tints.
# [Time Shift]
# The amount of steps taken until the next phase shift occurs.
# The following set up is for step-time change. (METHOD = 1)
PHASE = [
["Noon", Tone.new( 0, 0, 0), 300], # Phase 0
["Evening", Tone.new( -32, -96, -96), 100], # Phase 1
["Night", Tone.new(-128, -128, -32), 250], # Phase 2
["Morning", Tone.new( -48, -48, -16), 100], # Phase 3
]
# ◆ Real Time Setup ◆
# Replace the values in the about phase set-up if you wish to use real-time.
# ["Noon", Tone.new( 0, 0, 0), 16], #Phase0 (16 o'clock [4:00PM])
# ["Evening", Tone.new( 0, -96, -96), 20], #Phase1 (20 o'clock [8:00PM])
# ["Night", Tone.new(-96, -96, -64), 6], #Phase2 (6 o'clock [6:00AM])
# ["Morning", Tone.new(-48, -48, -16), 10], #Phase3 (10 o'clock [10:00AM])
# ◆ Day Change ◆
# The day changes on the value set here.
# 0.Day 1.Evening 2.Night 3.Morning
PASS_DAY_PHASE = 3
# ◆ Fade Time (by frame) ◆
# The amount of frames it takes to fade into the next phase.
PHASE_DURATION = 60
# ◆ Day of the Week Names ◆
# This shouldn't be hard to figure out, I hope.
# When using the Real-Time method (= 2), this must be seven days.
# Values of these are 0, 1, 2, 3, 4, 5, 6
WEEK_NAME = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
end
end
#------------------------------------------------------------------------------#
$imported = {} if $imported == nil
$imported["DayNight"] = true
if $data_mapinfos == nil
$data_mapinfos = load_data("Data/MapInfos.rvdata")
end
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Unless you know what you're doing, it's best not to alter anything beyond #
# this point, as this only affects the tags used for the Map name. #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
module KGC::DayNight
METHOD_TIME = 0 # Time Lapse
METHOD_STEP = 1 # Time passes with number of steps
METHOD_RTIME = 2 # Real Time
# Whatever word(s) in the following lines are what are used to determine
# what is searched for in the Map Name or the "Notes" section of the database.
# Regular Expression Defined
module Regexp
# Base MapInfo Module
module MapInfo
# Day/Night Stop tag string
DAYNIGHT_STOP = /\[DN_STOP\]/i
# Day/Night Void tag string
DAYNIGHT_VOID = /\[DN_VOID\]/i
end
# Base Troop Module
module Troop
# Appearance Phase tag string
APPEAR_PHASE = /\[DN((?:[ ]*[\-]?\d+(?:[ ]*,)?)+)\]/i
end
end
#--------------------------------------------------------------------------
# ○ 敵グループ出現判定
# troop : 判定対象の敵グループ
# phase : 判定するフェーズ
#--------------------------------------------------------------------------
def self.troop_appear?(troop, phase = $game_system.daynight_phase)
# 出現判定
unless troop.appear_daynight_phase.empty?
return false unless troop.appear_daynight_phase.include?(phase)
end
# 非出現判定
unless troop.nonappear_daynight_phase.empty?
return false if troop.nonappear_daynight_phase.include?(phase)
end
return true
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC::Commands
module_function
#--------------------------------------------------------------------------
# ○ 昼夜切り替えを停止
#--------------------------------------------------------------------------
def stop_daynight
$game_system.daynight_change_enabled = false
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替えを起動
#--------------------------------------------------------------------------
def start_daynight
$game_system.daynight_change_enabled = true
end
#--------------------------------------------------------------------------
# ○ Preset Phase is aquired.
#--------------------------------------------------------------------------
def get_daynight_name
return KGC::DayNight::PHASE[get_daynight_phase][0]
end
#--------------------------------------------------------------------------
# ○ Obtain DayNight Week and store it in a variable.
# variable_id : Variable ID
#--------------------------------------------------------------------------
def get_daynight_week(variable_id = 0)
if KGC::DayNight::METHOD == KGC::DayNight::METHOD_RTIME
week = Time.now.wday
else
days = $game_variables[KGC::DayNight::PASS_DAYS_VARIABLE]
week = (days % KGC::DayNight::WEEK_NAME.size)
end
if variable_id > 0
$game_variables[variable_id] = week
end
return week
end
#--------------------------------------------------------------------------
# ○ Present Day of the Week is aquired.
#--------------------------------------------------------------------------
def get_daynight_week_name
return KGC::DayNight::WEEK_NAME[get_daynight_week]
end
#--------------------------------------------------------------------------
# ○ Phase Shift
# phase : Phase
# duration : Shift Time(In Frames)
# pass_days : Passing Days (When argument is omitted: 0)
#--------------------------------------------------------------------------
def change_daynight_phase(phase,
duration = KGC::DayNight::PHASE_DURATION,
pass_days = 0)
$game_temp.manual_daynight_duration = duration
$game_system.daynight_counter = 0
$game_system.daynight_phase = phase
$game_variables[KGC::DayNight::PASS_DAYS_VARIABLE] += pass_days
$game_map.need_refresh = true
end
#--------------------------------------------------------------------------
# ○ Transit Daynight Phase
# duration : Shift Time(In Frames)
#--------------------------------------------------------------------------
def transit_daynight_phase(duration = KGC::DayNight::PHASE_DURATION)
$game_screen.transit_daynight_phase(duration)
$game_map.need_refresh = true
end
#--------------------------------------------------------------------------
# ○ デフォルトの色調に戻す
# duration : 切り替え時間(フレーム)
#--------------------------------------------------------------------------
def set_daynight_default(duration = KGC::DayNight::PHASE_DURATION)
$game_screen.set_daynight_default(duration)
$game_map.need_refresh = true
end
#--------------------------------------------------------------------------
# ○ 現在のフェーズを復元
# duration : 切り替え時間(フレーム)
#--------------------------------------------------------------------------
def restore_daynight_phase(duration = KGC::DayNight::PHASE_DURATION)
$game_screen.restore_daynight_phase(duration)
$game_map.need_refresh = true
end
end
class Game_Interpreter
include KGC::Commands
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::MapInfo
#==============================================================================
class RPG::MapInfo
#--------------------------------------------------------------------------
# ● マップ名取得
#--------------------------------------------------------------------------
def name
return @name.gsub(/\[.*\]/) { "" }
end
#--------------------------------------------------------------------------
# ○ オリジナルマップ名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替え停止
#--------------------------------------------------------------------------
def daynight_stop
return @name =~ KGC::DayNight::Regexp::MapInfo::DAYNIGHT_STOP
end
#--------------------------------------------------------------------------
# ○ 昼夜エフェクト無効
#--------------------------------------------------------------------------
def daynight_void
return @name =~ KGC::DayNight::Regexp::MapInfo::DAYNIGHT_VOID
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::Area
#==============================================================================
unless $@
class RPG::Area
#--------------------------------------------------------------------------
# ○ エンカウントリストの取得
#--------------------------------------------------------------------------
alias encounter_list_KGC_DayNight encounter_list
def encounter_list
list = encounter_list_KGC_DayNight.clone
# 出現条件判定
list.each_index { |i|
list[i] = nil unless KGC::DayNight.troop_appear?($data_troops[list[i]])
}
return list.compact
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::Troop
#==============================================================================
class RPG::Troop
#--------------------------------------------------------------------------
# ○ Generate DayNight Cache
#--------------------------------------------------------------------------
def create_daynight_cache
@__appear_daynight_phase = []
@__nonappear_daynight_phase = []
# 出現するフェーズ
if @name =~ KGC::DayNight::Regexp::Troop::APPEAR_PHASE
$1.scan(/[\-]?\d+/).each { |num|
phase = num.to_i
if phase < 0
# 出現しない
@__nonappear_daynight_phase << phase.abs
else
# 出現する
@__appear_daynight_phase << phase
end
}
end
end
#--------------------------------------------------------------------------
# ○ 出現するフェーズ
#--------------------------------------------------------------------------
def appear_daynight_phase
create_daynight_cache if @__appear_daynight_phase == nil
return @__appear_daynight_phase
end
#--------------------------------------------------------------------------
# ○ 出現しないフェーズ
#--------------------------------------------------------------------------
def nonappear_daynight_phase
create_daynight_cache if @__nonappear_daynight_phase == nil
return @__nonappear_daynight_phase
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :manual_daynight_duration # 手動フェーズ変更フラグ
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_DayNight initialize
def initialize
initialize_KGC_DayNight
@manual_daynight_duration = nil
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :daynight_counter # フェーズ遷移カウンタ
attr_writer :daynight_change_enabled # 昼夜切り替え有効
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_DayNight initialize
def initialize
initialize_KGC_DayNight
@daynight_counter = 0
@daynight_change_enabled = true
end
#--------------------------------------------------------------------------
# ○ フェーズ遷移カウンタを取得
#--------------------------------------------------------------------------
def daynight_counter
@daynight_counter = 0 if @daynight_counter == nil
return @daynight_counter
end
#--------------------------------------------------------------------------
# ○ 現在のフェーズを取得
#--------------------------------------------------------------------------
def daynight_phase
return $game_variables[KGC::DayNight::PHASE_VARIABLE]
end
#--------------------------------------------------------------------------
# ○ 現在のフェーズを変更
#--------------------------------------------------------------------------
def daynight_phase=(value)
$game_variables[KGC::DayNight::PHASE_VARIABLE] = value
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替え有効フラグを取得
#--------------------------------------------------------------------------
def daynight_change_enabled
@daynight_change_enabled = 0 if @daynight_change_enabled == nil
return @daynight_change_enabled
end
#--------------------------------------------------------------------------
# ○ フェーズ進行
#--------------------------------------------------------------------------
def progress_daynight_phase
self.daynight_phase += 1
if self.daynight_phase >= KGC::DayNight::PHASE.size
self.daynight_phase = 0
end
$game_map.need_refresh = true
end
#--------------------------------------------------------------------------
# ○ 現在のフェーズオブジェクトを取得
#--------------------------------------------------------------------------
def daynight_phase_object
return KGC::DayNight::PHASE[daynight_phase]
end
#--------------------------------------------------------------------------
# ○ 以前のフェーズオブジェクトを取得
#--------------------------------------------------------------------------
def previous_daynight_phase_object
return KGC::DayNight::PHASE[daynight_phase - 1]
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Screen
#==============================================================================
class Game_Screen
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :daynight_tone # 昼夜の色調
#--------------------------------------------------------------------------
# ● クリア
#--------------------------------------------------------------------------
alias clear_KGC_DayNight clear
def clear
clear_KGC_DayNight
clear_daynight
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替え用変数をクリア
#--------------------------------------------------------------------------
def clear_daynight
@default_tone = Tone.new(0, 0, 0)
# 移動判定用座標初期化
@daynight_x = 0
@daynight_y = 0
# フレーム更新用カウント初期化
@frame_count = Graphics.frame_count
@daynight_tone_duration = 0
apply_daynight
end
#--------------------------------------------------------------------------
# ○ 昼夜の色調を適用
#--------------------------------------------------------------------------
def apply_daynight
return if $game_map == nil
# 切り替えを無効化するマップの場合
if $game_map.daynight_void?
if @daynight_tone_changed
# 初期の色調に戻す
@tone = @default_tone.clone
@daynight_tone_changed = false
end
@daynight_tone = @tone.clone
return
end
# フェーズがおかしければ修復
if $game_system.daynight_phase_object == nil
$game_system.daynight_phase = 0
end
# 現在の色調を適用
@tone = $game_system.daynight_phase_object[1].clone
@daynight_tone = @tone.clone
# 現実時間遷移の場合
if KGC::DayNight::METHOD == KGC::DayNight::METHOD_RTIME
time = Time.now
# マッチするフェーズに遷移
KGC::DayNight::PHASE.each_with_index { |phase, i|
if phase[2] <= time.hour
start_tone_change(phase[1], 1)
$game_system.daynight_phase = i
break
end
}
end
@daynight_tone_changed = true
end
#--------------------------------------------------------------------------
# ○ 色調の取得
#--------------------------------------------------------------------------
def tone
if $game_temp.in_battle && KGC::DayNight::TONE_BACK_ONLY_IN_BATTLE
return @default_tone
else
return @tone
end
end
#--------------------------------------------------------------------------
# ● 色調変更の開始
# tone : 色調
# duration : 時間
#--------------------------------------------------------------------------
alias start_tone_change_KGC_DayNight start_tone_change
def start_tone_change(tone, duration)
duration = [duration, 1].max
start_tone_change_KGC_DayNight(tone, duration)
@daynight_tone_target = tone.clone
@daynight_tone_duration = duration
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_KGC_DayNight update
def update
update_KGC_DayNight
update_daynight_transit
end
#--------------------------------------------------------------------------
# ● 色調の更新
#--------------------------------------------------------------------------
alias update_tone_KGC_DayNight update_tone
def update_tone
update_tone_KGC_DayNight
if @daynight_tone_duration >= 1
d = @daynight_tone_duration
target = @daynight_tone_target
@daynight_tone.red = (@daynight_tone.red * (d - 1) + target.red) / d
@daynight_tone.green = (@daynight_tone.green * (d - 1) + target.green) / d
@daynight_tone.blue = (@daynight_tone.blue * (d - 1) + target.blue) / d
@daynight_tone.gray = (@daynight_tone.gray * (d - 1) + target.gray) / d
@daynight_tone_duration -= 1
end
end
#--------------------------------------------------------------------------
# ○ フェーズ遷移の更新
#--------------------------------------------------------------------------
def update_daynight_transit
# 手動切り替えが行われた場合
if $game_temp.manual_daynight_duration
start_tone_change($game_system.daynight_phase_object[1],
$game_temp.manual_daynight_duration)
$game_temp.manual_daynight_duration = nil
@daynight_tone_changed = true
end
return unless $game_system.daynight_change_enabled # 切り替えを
return if $game_map.daynight_stop? # 停止中
if KGC::DayNight::STOP_ON_EVENT
interpreter = ($game_temp.in_battle ? $game_troop.interpreter :
$game_map.interpreter)
return if interpreter.running? # イベント実行中
end
case KGC::DayNight::METHOD
when KGC::DayNight::METHOD_TIME # 時間
update_daynight_pass_time
when KGC::DayNight::METHOD_STEP # 歩数
update_daynight_step
when KGC::DayNight::METHOD_RTIME # 現実時間
update_daynight_real_time
end
end
#--------------------------------------------------------------------------
# ○ 遷移 : 時間経過
#--------------------------------------------------------------------------
def update_daynight_pass_time
# カウント増加量計算
inc_count = Graphics.frame_count - @frame_count
# 加算量がおかしい場合は戻る
if inc_count >= 100
@frame_count = Graphics.frame_count
return
end
# カウント加算
$game_system.daynight_counter += inc_count
@frame_count = Graphics.frame_count
# 状態遷移判定
count = $game_system.daynight_counter / Graphics.frame_rate
if count >= $game_system.daynight_phase_object[2]
transit_daynight_next
end
end
#--------------------------------------------------------------------------
# ○ 遷移 : 歩数
#--------------------------------------------------------------------------
def update_daynight_step
# 移動していなければ戻る
return if @daynight_x == $game_player.x && @daynight_y == $game_player.y
@daynight_x = $game_player.x
@daynight_y = $game_player.y
# カウント加算
$game_system.daynight_counter += 1
# 状態遷移判定
count = $game_system.daynight_counter
if count >= $game_system.daynight_phase_object[2]
transit_daynight_next
end
end
#--------------------------------------------------------------------------
# ○ 遷移 : 現実時間
#--------------------------------------------------------------------------
def update_daynight_real_time
time = Time.now
# 状態遷移判定
time1 = $game_system.daynight_phase_object[2]
transit = (time1 <= time.hour)
if $game_system.previous_daynight_phase_object != nil
time2 = $game_system.previous_daynight_phase_object[2]
if time1 < time2
transit &= (time.hour < time2)
end
end
if transit
transit_daynight_next
end
end
#--------------------------------------------------------------------------
# ○ 次の状態へ遷移
# duration : 遷移時間
#--------------------------------------------------------------------------
def transit_daynight_next(duration = KGC::DayNight::PHASE_DURATION)
$game_system.daynight_counter = 0
$game_system.progress_daynight_phase
# 日数経過判定
if $game_system.daynight_phase == KGC::DayNight::PASS_DAY_PHASE
$game_variables[KGC::DayNight::PASS_DAYS_VARIABLE] += 1
end
# 色調切り替え
start_tone_change($game_system.daynight_phase_object[1], duration)
@daynight_tone_changed = true
end
#--------------------------------------------------------------------------
# ○ デフォルトの状態(0, 0, 0)に戻す
# duration : 遷移時間
#--------------------------------------------------------------------------
def set_daynight_default(duration)
start_tone_change(@default_tone, duration)
end
#--------------------------------------------------------------------------
# ○ 現在のフェーズを復元
# duration : 遷移時間
#--------------------------------------------------------------------------
def restore_daynight_phase(duration)
start_tone_change($game_system.daynight_phase_object[1], duration)
@daynight_tone_changed = true
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● セットアップ
# map_id : マップ ID
#--------------------------------------------------------------------------
alias setup_KGC_DayNight setup
def setup(map_id)
setup_KGC_DayNight(map_id)
@screen.apply_daynight
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替えを停止するか
#--------------------------------------------------------------------------
def daynight_stop?
info = $data_mapinfos[map_id]
return false if info == nil
return (info.daynight_stop || info.daynight_void)
end
#--------------------------------------------------------------------------
# ○ 昼夜切り替えが無効か
#--------------------------------------------------------------------------
def daynight_void?
info = $data_mapinfos[map_id]
return false if info == nil
return info.daynight_void
end
#--------------------------------------------------------------------------
# ● エンカウントリストの取得
#--------------------------------------------------------------------------
alias encounter_list_KGC_DayNight encounter_list
def encounter_list
list = encounter_list_KGC_DayNight.clone
# 出現条件判定
list.each_index { |i|
list[i] = nil unless KGC::DayNight.troop_appear?($data_troops[list[i]])
}
return list.compact
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
if KGC::DayNight::TONE_BACK_ONLY_IN_BATTLE
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● バトルバックスプライトの作成
#--------------------------------------------------------------------------
alias create_battleback_KGC_DayNight create_battleback
def create_battleback
create_battleback_KGC_DayNight
if @battleback_sprite.wave_amp == 0
@battleback_sprite.tone = $game_troop.screen.daynight_tone
end
end
#--------------------------------------------------------------------------
# ● バトルフロアスプライトの作成
#--------------------------------------------------------------------------
alias create_battlefloor_KGC_DayNight create_battlefloor
def create_battlefloor
create_battlefloor_KGC_DayNight
@battlefloor_sprite.tone = $game_troop.screen.daynight_tone
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
alias start_KGC_DayNight start
def start
$game_map.screen.clear_daynight
start_KGC_DayNight
end
end
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
#
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
"Освещение". Вообще рецептов целая куча, вплоть до реализации динамического построения теней от движущихся объектов. Автору дам вариант попроще.
Объясняю пошагово, для совсем начинающих.
- Сохраняешь вот этот файл по ссылке: i218.photobucket.com/albums/cc308/kylock1/le.png себе на компьютер. Копируешь его в папку "Pictures" своего проекта.
- Идёшь в редактор скриптов VX. Слева увидишь список скриптов. Добавляешь там новую строчку выше скрипта "Main". Обзываешь его "Light Effects". Переносишь туда нижеуказанную копипасту:
ВНИМАНИЕ: Спойлер!#==============================================================================
# ■ Light Effects VX 1.3
# 12.27.2008
#
# Script by: Kylock (originally for RMXP by Near Fantastica)
# Version 1.3 by Enelvon
#==============================================================================
# To make an event glow, give it a Comment: with any of the supported light
# modes.
# The SWITCH setting below will disable light effects from updating with the
# switch is on.
#==============================================================================
# ● Change Log
#
# 1.0 - Original Release
# 1.1 - New light modes added: LIGHT2, TORCH, TORCH2
# - Changed sprite blend mode to ADD (looks slightly better)
# - Fire-based lights are now red in color
# 1.2 - Bug fixed with looping maps and lights displaying above messageboxes
# 1.3 - More bugfixes
#==============================================================================
# ● Light Modes
#
# GROUND - Medium steady white light.
# FIRE - Large red light with a slight flicker.
# LIGHT - Small steady white light.
# LIGHT2 - X-Large steady white light.
# TORCH - X-Large red light with a heavy flicker.
# TORCH2 - X-Large red light with a sleight flicker.
#==============================================================================
class Spriteset_Map
alias les_spriteset_map_initalize initialize
alias les_spriteset_map_dispose dispose
alias les_spriteset_map_update update
def initialize
@light_effects = []
setup_lights
les_spriteset_map_initalize
update
end
def dispose
les_spriteset_map_dispose
for effect in @light_effects
effect.light.dispose
end
@light_effects = []
end
def update
les_spriteset_map_update
update_light_effects
end
def setup_lights
for event in $game_map.events.values
next if event.list == nil
for i in 0...event.list.size
if event.list.code == 108 and event.list.parameters == ["GROUND"]
type = "GROUND"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 2
light_effects.light.zoom_y = 2
light_effects.light.opacity = 100
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["FIRE"]
type = "FIRE"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 300 / 100.0
light_effects.light.zoom_y = 300 / 100.0
light_effects.light.opacity = 100
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["LIGHT"]
type = "LIGHT"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 1
light_effects.light.zoom_y = 1
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["LIGHT2"]
type = "LIGHT2"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["TORCH"]
type = "TORCH"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["TORCH2"]
type = "TORCH2"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
end
end
for effect in @light_effects
case effect.type
when "GROUND"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
when "FIRE"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "LIGHT"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
effect.light.blend_type = 1
when "LIGHT2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.blend_type = 1
when "TORCH"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCH2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
end
end
end
def update_light_effects
if $game_switches[1]
for effect in @light_effects
next if effect.type == "FIRE" || effect.type == "TORCH"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type == "FIRE" || effect.type == "TORCH"
effect.light.visible = true
end
end
for effect in @light_effects
case effect.type
when "GROUND"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
when "FIRE"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "LIGHT"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
when "LIGHT2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
when "TORCH"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.opacity = rand(30) + 70
when "TORCH2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.opacity = rand(10) + 90
end
end
end
end
class Light_Effect
attr_accessor :light
attr_accessor :event
attr_accessor :type
def initialize(event, type)
@light = Sprite.new
@light.bitmap = Cache.picture("le.png")
@light.visible = true
@light.z = 190
@event = event
@type = type
end
end - В ивенте светящегося объекта (костра, лампы, неведомой сияющей херни и т.п.) выполняешь стандартную команду "Comment". Это комментарий. В его тексте тебе нужно указать одно из этих слов: GROUND, FIRE, LIGHT, LIGHT2, TORCH, TORCH2. Это разные эффекты освещения. Для разных объектов. Проверь экспериментально как каждый из них выглядит.
- Для каждого ивента указываешь свою настройку.
→ → ↓ ↑ Y
Последнее редактирование: 16 года 9 мес. назад пользователем mephis.
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
- etomoyasakur
- Не в сети
- Новый участник
-
Скрыть
Больше
- Сообщений: 9
- Спасибо получено: 0
16 года 3 мес. назад #30789
от etomoyasakur
etomoyasakur ответил в теме Ночное время суток!
подскажите, а способ, описанный выше для ХР подойдет?
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
16 года 3 мес. назад #30790
от Sn@ke
"Люди, Ангелы, Демоны... Есть ли между ними разница? Я не согласен с теми, кто утверждает, что Демоны - это абсолютное зло. Бывают Люди, гораздо хуже Демонов.И бывают Демоны куда более великодушные, чем Ангелы. Важно не то, кто ты, а то, кем ты хочешь быть..."
- Найн, Высший Демон -
Dark Arts - The Wings of Angel
Sn@ke ответил в теме Ночное время суток!
Скрипт - не пойдет. А с помощью функции change screen tone - легко.
"Люди, Ангелы, Демоны... Есть ли между ними разница? Я не согласен с теми, кто утверждает, что Демоны - это абсолютное зло. Бывают Люди, гораздо хуже Демонов.И бывают Демоны куда более великодушные, чем Ангелы. Важно не то, кто ты, а то, кем ты хочешь быть..."
- Найн, Высший Демон -
Dark Arts - The Wings of Angel
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
- etomoyasakur
- Не в сети
- Новый участник
-
Скрыть
Больше
- Сообщений: 9
- Спасибо получено: 0
16 года 3 мес. назад #30800
от etomoyasakur
etomoyasakur ответил в теме Ночное время суток!
Спасибо
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Время создания страницы: 0.103 секунд
