- GummyStaffeux retraité
- Nombre de messages : 2666
Age : 32
Localisation : Belgique
Distinction : Modérateur imprévisible
Papy Lolo' [Nabots Nimousse]
Date d'inscription : 27/01/2008
Modif du script Nightlights Isolated de hellMinor
Jeu 9 Juil 2009 - 23:11
Encore moi!
Voici le script d'hellMinor permettant l'affichage simplifiés d'image sur la map, très utile pour les effets lumineux.
Le problème est que les images sont fixes.
Y'aurait-il un gentil scripteur capable de modifier ou de rajouter un module à ce script permettant d'agrandir et de rétrécir le halo lumineux légèrement afin de donner du mouvement et du réalisme à l'affaire?
Merki.
Voici le script d'hellMinor permettant l'affichage simplifiés d'image sur la map, très utile pour les effets lumineux.
- Spoiler:
- Code:
#==============================================================================
# Nightlights Isolated
#
# Version : 1.0 - 30.04.08
# Created by : hellMinor
# Do NOT redistribute without my permission
# Description : My Nightlighting-System from Simple Day And Night as single
# Script, do NOT use with it with Simple Day and Night v1.0 or
# above.
#
#==============================================================================
# Nightslights F.A.Q.
#==============================================================================
# Create a folder named Nightlights in your Graphics folder and put a picture
# with the same name,width and height as your map into it.
# The picture will automatically shown
PIC_FORMAT = "png" # Format for the Nightlight-Maps
#==============================================================================
module Cache
#==============================================================================
def self.nightlights(filename)
load_bitmap("graphics/nightlights/", filename)
end
end
#==============================================================================
class Game_Map
#==============================================================================
def setup(map_id)
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
@display_x = 0
@display_y = 0
@passages = $data_system.passages
referesh_vehicles
setup_events
setup_scroll
setup_parallax
setup_nightlights
@need_refresh = false
end
#------------------------------------------------------------------------------
def setup_nightlights
@nightlights_mapname = $game_map.name
@nightlights_loop_x = 0
@nightlights_loop_y = 0
@nightlights_sx = 0
@nightlights_sy = 0
@nightlights_x = 0
@nightlights_y = 0
end
#------------------------------------------------------------------------------
def update
refresh if $game_map.need_refresh
update_scroll
update_events
update_vehicles
update_parallax
if $active && $timesystem == 1
update_nightlights
$dayandnight.updateclock
end
@screen.update
end
#------------------------------------------------------------------------------
def update_nightlights
@nightlights_x += @nightlights_sx * 4 if @nightlights_loop_x
@nightlights_y += @nightlights_sy * 4 if @nightlights_loop_y
end
#------------------------------------------------------------------------------
def set_display_pos(x, y)
@display_x = (x + @map.width * 256) % (@map.width * 256)
@display_y = (y + @map.height * 256) % (@map.height * 256)
@parallax_x = x
@parallax_y = y
@nightlights_x = x
@nightlights_y = y
end
#------------------------------------------------------------------------------
def calc_nightlights_x(bitmap)
if bitmap == nil
return 0
else
w1 = bitmap.width - 544
w2 = @map.width * 32 - 544
if w1 <= 0 or w2 <= 0
return 0
else
return @nightlights_x * w1 / w2 / 8
end
end
end
#------------------------------------------------------------------------------
def calc_nightlights_y(bitmap)
if bitmap == nil
return 0
else
h1 = bitmap.height - 416
h2 = @map.height * 32 - 416
if h1 <= 0 or h2 <= 0
return 0
else
return @nightlights_y * h1 / h2 / 8
end
end
end
#------------------------------------------------------------------------------
def scroll_down(distance)
if loop_vertical?
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance
@nightlights_y += distance
else
last_y = @display_y
@display_y = [@display_y + distance, (height - 13) * 256].min
@parallax_y += @display_y - last_y
@nightlights_y += @display_y - last_y
end
end
#------------------------------------------------------------------------------
def scroll_left(distance)
if loop_horizontal?
@display_x += @map.width * 256 - distance
@display_x %= @map.width * 256
@parallax_x -= distance
@nightlights_x -= distance
else
last_x = @display_x
@display_x = [@display_x - distance, 0].max
@parallax_x += @display_x - last_x
@nightlights_x += @display_x - last_x
end
end
#------------------------------------------------------------------------------
def scroll_right(distance)
if loop_horizontal?
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance
@nightlights_x += distance
else
last_x = @display_x
@display_x = [@display_x + distance, (width - 17) * 256].min
@parallax_x += @display_x - last_x
@nightlights_x += @display_x - last_x
end
end
#------------------------------------------------------------------------------
def scroll_up(distance)
if loop_vertical?
@display_y += @map.height * 256 - distance
@display_y %= @map.height * 256
@parallax_y -= distance
@nightlights_y -= distance
else
last_y = @display_y
@display_y = [@display_y - distance, 0].max
@parallax_y += @display_y - last_y
@nightlights_y += @display_y - last_y
end
end
#------------------------------------------------------------------------------
def name
$data_mapinfos[@map_id]
end
end
#==============================================================================
class Spriteset_Map
#==============================================================================
def initialize
create_viewports
create_tilemap
create_parallax
create_characters
create_shadow
create_weather
create_pictures
create_timer
create_nightlights
update
end
#------------------------------------------------------------------------------
def create_nightlights
$nightlights = Plane.new(@viewport3)
end
#------------------------------------------------------------------------------
alias dispose_nl_adds dispose
def dispose
dispose_nl_adds
dispose_nightlights
end
#------------------------------------------------------------------------------
def dispose_nightlights
$nightlights.dispose
end
#------------------------------------------------------------------------------
alias update_nl_adds update
def update
update_nl_adds
update_nightlights
end
#------------------------------------------------------------------------------
def update_nightlights
if @nightlights_mapname != $game_map.name
@nightlights_mapname = $game_map.name
if $nightlights.bitmap != nil
$nightlights.bitmap.dispose
$nightlights.bitmap = nil
end
if @nightlights_mapname != ""
if File.exist?("Graphics/Nightlights/"+@nightlights_mapname+"."+PIC_FORMAT)
$nightlights.bitmap = Cache.nightlights(@nightlights_mapname)
end
end
Graphics.frame_reset
end
$nightlights.ox = $game_map.calc_nightlights_x($nightlights.bitmap)
$nightlights.oy = $game_map.calc_nightlights_y($nightlights.bitmap)
end
end
#==============================================================================
class Scene_Title
#==============================================================================
alias load_database_nl_adds load_database
def load_database
load_database_nl_adds
$data_mapinfos = load_data("Data/MapInfos.rvdata")
for key in $data_mapinfos.keys
$data_mapinfos[key] = $data_mapinfos[key].name
end
end
end
Le problème est que les images sont fixes.
Y'aurait-il un gentil scripteur capable de modifier ou de rajouter un module à ce script permettant d'agrandir et de rétrécir le halo lumineux légèrement afin de donner du mouvement et du réalisme à l'affaire?
Merki.
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|