- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 38
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
[Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 0:56
Bonsoir tout le monde, c'est encore moi qui arrive avec des problèmes à la noix.
Voici donc mon soucis.
Lors que je crée un event vierge, et que j'y inscrit dans un commentaire "FIRE", il se produit in game un effet visuel que l'on connait tous.
Or, lors que je crée un event avec des conditions et des changements de pages, et sur cette dernière page qui termine l'event, j'y inscrit
le commentaire, il ne se produit pas l'effet désiré.
J'ai testé en event parallèle, en touche action, et rien ne se passe.
Je ne sais donc plus quoi faire :s
Auriez-vous une idée ou déjà eu ce problème ?
Merci d'avance et bonne nuit
Voici donc mon soucis.
Lors que je crée un event vierge, et que j'y inscrit dans un commentaire "FIRE", il se produit in game un effet visuel que l'on connait tous.
Or, lors que je crée un event avec des conditions et des changements de pages, et sur cette dernière page qui termine l'event, j'y inscrit
le commentaire, il ne se produit pas l'effet désiré.
J'ai testé en event parallèle, en touche action, et rien ne se passe.
Je ne sais donc plus quoi faire :s
Auriez-vous une idée ou déjà eu ce problème ?
Merci d'avance et bonne nuit
- Ti-MaxMembre
- Nombre de messages : 1100
Localisation : Canada/Québec
Distinction : Poisson 2018 [Amal']
Date d'inscription : 02/09/2009
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 1:40
Est-ce qu'il est possible de le montrer cet évènement ? Ça aiderait grandement.
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 38
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 10:01
- 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
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 10:29
Vérifie dans le script pour voir si il n'est pas précisé que le commentaire doit obligatoirement être la toute première instruction de l'event, toutes pages confondues. Je ne vois que ça.
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 38
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 13:44
J'ai regardé mais bon, j'ai pas de notions suffisante pour analyser efficacement le script.
Je n'y trouve pas de ligne qui pourrait faire référence à une première page d'un event.
Je link le script :
Je n'y trouve pas de ligne qui pourrait faire référence à une première page d'un event.
Je link le script :
- Spoiler:
- #==============================================================================
# ■ Light Effects VX 1.1
# 5.21.2008
#------------------------------------------------------------------------------
# Script: Kylock (à l'origine pour RMXP Near Fantastica)
# Tradução por Equipe Gemstone
# Traduit Par Douk => Français => http://rpgmakervx.1fr1.net/
#================================================= =============================
# Pour faire briller un événement, écrire un commentaire: avec un des
# Modes de lumière ci-dessous.
#================================================
#===============================================================
#
# rpgmakervx.1fr1.net
#
#===============================================================
# ● des news :
#------------------------------------------------- -----------------------------
# 1,0 - sortie d'origine
# 1,1 - Des nouvelles façons de lumière ajoutée: LIGHT2 TORCHE, TORCH2.
# - Changement de la façon de mélanger le sprite à ajouter (semble un peu mieux).
# - Les Feux d'incendie sont maintenant teinte de rouge.
#================================================= =============================
# ● modes d'éclairage :
#------------------------------------------------- -----------------------------
# Ground - Moyen-portée et de la lumière blanche.
# FIRE - Le feu rouge varie légèrement.
# LUMIERE - Portée courte et à la lumière blanche.
# LIGHT2 - à longue distance et une lumière blanche.
# TORCHE - Grosse lumière rouge avec une grande emprise.
# TORCH2 - Grosse lumière qui varie légèrement.
#==============================================================================
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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.blend_type = 1
when "FIRE"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "LIGHT"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
effect.light.blend_type = 1
when "LIGHT2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.blend_type = 1
when "TORCH"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCH2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
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.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
when "FIRE"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "LIGHT"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
when "LIGHT2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
when "TORCH"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10
effect.light.opacity = rand(30) + 70
when "TORCH2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
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 = 1000
@event = event
@type = type
end
end
- Ti-MaxMembre
- Nombre de messages : 1100
Localisation : Canada/Québec
Distinction : Poisson 2018 [Amal']
Date d'inscription : 02/09/2009
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 15:27
L'image de ton Event n'apparaît pas.
- LitchyMembre
- Nombre de messages : 15
Age : 30
Localisation : Le Sud de la France !
Distinction : aucune
Date d'inscription : 08/11/2009
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 15:48
Il me semble avoir déjà eu ce problème. Pourrais-tu ré-up l'image de ton event ?
- 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
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 15:53
L'image s'affiche très bien mais prend du temps à charger, patientez quelques minutes avec la page ouverte au pire.
Pour le script, il me semble qu'effectivement il ne prend en compte que la première instruction d'un évènement, toutes pages confondues.
Fais un test :
- Un event avec le commentaire FIRE seul, qui devrait fonctionner
- Un event avec deux pages, sur la première l'interrupteur local A qui est activé, et la deuxième le commentaire avec la condition sur l'interrupteur local bien sur,
- Idem que le précédent mais avec des interrupteurs classiques et non locaux.
Pour le script, il me semble qu'effectivement il ne prend en compte que la première instruction d'un évènement, toutes pages confondues.
Fais un test :
- Un event avec le commentaire FIRE seul, qui devrait fonctionner
- Un event avec deux pages, sur la première l'interrupteur local A qui est activé, et la deuxième le commentaire avec la condition sur l'interrupteur local bien sur,
- Idem que le précédent mais avec des interrupteurs classiques et non locaux.
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 38
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 22:02
Me revoilà
Alors, j'ai testé le tout, et en fait, j'ai saisi un truc que je n'avais pas vu aupravant.
Donc, pour commencé, tes trois tests fonctionnent Gummy,
Mais il y a un soucis. En fait, les effets lumineux des 2emes pages des events ne s'activent qu'une
fois que le héros à changé de map, et revient sur celle-ci.
Et c'est là le problème.
L'effet lumineux n'est pas effectif instantanément :s
Et je ne vois pas comment y remédier, si ce n'est en téléportant au même emplacement le héros dès la fin de l'event, mais ça ne me conviens pas franchement.
Alors, j'ai testé le tout, et en fait, j'ai saisi un truc que je n'avais pas vu aupravant.
Donc, pour commencé, tes trois tests fonctionnent Gummy,
Mais il y a un soucis. En fait, les effets lumineux des 2emes pages des events ne s'activent qu'une
fois que le héros à changé de map, et revient sur celle-ci.
Et c'est là le problème.
L'effet lumineux n'est pas effectif instantanément :s
Et je ne vois pas comment y remédier, si ce n'est en téléportant au même emplacement le héros dès la fin de l'event, mais ça ne me conviens pas franchement.
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: [Résolu] Effet de lumière avec le script light effect
Mer 15 Aoû 2012 - 23:23
Bonsoir,
Essaie un petit "$scene = Scene_Map.new" juste après avoir activer l'interrupteur local.
A part ça je ne vois pas du tout comment régler le problème dans le script...
Il y a une version plus récente également de ce script avec la gestion de plusieurs interrupteurs :
...
Essaie un petit "$scene = Scene_Map.new" juste après avoir activer l'interrupteur local.
A part ça je ne vois pas du tout comment régler le problème dans le script...
Il y a une version plus récente également de ce script avec la gestion de plusieurs interrupteurs :
- Code:
=begin
Light Effects XT Mod
Version: 0.1
Author: BulletXt (bulletxt@gmail.com)
Date: 29/05/2009
Original Author: Kylock (http://www.rpgmakervx.net/index.php?showtopic=2432)
Description:
To make an event glow, put a Comment inside event with one of the following
light modes.
Light Modes:
GROUND - Medium steady white light.
GROUND2 - Medium white light with slight flicker.
GROUND3 - Small steady red light.
GROUND4 - Medium steady green light.
GROUND5 - Medium steady blu light.
FIRE - Large red light with a slight flicker.
LIGHT - Small steady white light.
LIGHT2 - X-Large steady white light.
LIGHT3 - Small white light with slight flicker.
TORCH - X-Large red light with a heavy flicker.
TORCH2 - X-Large red light with a sleight flicker.
TORCH3 - Large white light with a slight flicker.
You can make a specific light type turn off/on by turning
one of the following switches id ON/off. By default, the switches are off so
the lights will show. Of course, turning all switches to ON will make all
light types go off.
=end
#id switch that if ON turns off FIRE mode lights
#applies only to light mode: FIRE
FIRE = 1
#id switch that if ON turns off LIGHT mode lights
#applies to light mode: LIGHT, LIGHT2, LIGHT3
LIGHT = 2
#id switch that if ON turns off GROUND mode lights
#applies to light mode: GROUND, GROUND2, GROUND3, GROUND4, GROUND5
GROUND = 3
#id switch that if ON turns off TORCH mode lights
#applies to light mode: TORCH, TORCH2, TORCH3
TORCH = 4
=begin
Tips and tricks:
You can't make a single specific light inside event go on/off if
a condition applies, for example if a switch is ON.
For the moment, you can achieve this by doing
a script call immediatley after you make the condition apply.
If for example the light event must go on if switch 100 is ON, after you turn
on the switch do this call script:
$scene = Scene_Map.new
Be aware that doing this call script will make game freeze
for 30 milliseconds.
################################################################################
=end
class Spriteset_Map
alias bulletxt_spriteset_map_initalize initialize
def initialize
@light_effects = []
initialize_lights
bulletxt_spriteset_map_initalize
update
end
alias bulletxt_spriteset_map_dispose dispose
def dispose
bulletxt_spriteset_map_dispose
for effect in @light_effects
effect.light.dispose
end
@light_effects = []
end
alias bulletxt_spriteset_map_update update
def update
bulletxt_spriteset_map_update
update_light_effects
end
def initialize_lights
for event in $game_map.events.values
next if event.list == nil
for i in 0...event.list.size
if event.list[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].parameters == ["LIGHT3"]
type = "LIGHT3"
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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].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
if event.list[i].code == 108 and event.list[i].parameters == ["TORCH3"]
type = "TORCH3"
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[i].code == 108 and event.list[i].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[i].code == 108 and event.list[i].parameters == ["GROUND2"]
type = "GROUND2"
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[i].code == 108 and event.list[i].parameters == ["GROUND3"]
type = "GROUND3"
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[i].code == 108 and event.list[i].parameters == ["GROUND4"]
type = "GROUND4"
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[i].code == 108 and event.list[i].parameters == ["GROUND5"]
type = "GROUND5"
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
end
end
for effect in @light_effects
case effect.type
when "FIRE"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "LIGHT"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
effect.light.blend_type = 1
when "LIGHT2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.blend_type = 1
when "LIGHT3"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
effect.light.blend_type = 1
when "TORCH"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCH2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCH3"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.blend_type = 1
when "GROUND"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.blend_type = 1
when "GROUND2"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.blend_type = 1
when "GROUND3"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.tone = Tone.new(255,-255,-255, 255)
effect.light.blend_type = 1
when "GROUND4"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.tone = Tone.new(-255,255,-255, 100)
effect.light.blend_type = 1
when "GROUND5"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.tone = Tone.new(-255,255,255, 100)
effect.light.blend_type = 1
end
end
end
def update_light_effects
################################################################################
# handle FIRE
if $game_switches[FIRE]
for effect in @light_effects
next if effect.type != "FIRE"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type != "FIRE"
effect.light.visible = true
end
end
# handle LIGHT
if $game_switches[LIGHT]
for effect in @light_effects
next if effect.type != "LIGHT" && effect.type != "LIGHT2" && effect.type != "LIGHT3"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type != "LIGHT" && effect.type != "LIGHT2" && effect.type != "LIGHT3"
effect.light.visible = true
end
end
# handle GROUND
if $game_switches[GROUND]
for effect in @light_effects
next if effect.type != "GROUND" && effect.type != "GROUND2" && effect.type != "GROUND3" && effect.type != "GROUND4" && effect.type != "GROUND5"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type != "GROUND" && effect.type != "GROUND2" && effect.type != "GROUND3" && effect.type != "GROUND4" && effect.type != "GROUND5"
effect.light.visible = true
end
end
# handle TORCH
if $game_switches[TORCH]
for effect in @light_effects
next if effect.type != "TORCH" && effect.type != "TORCH2" && effect.type != "TORCH3"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type != "TORCH" && effect.type != "TORCH2" && effect.type != "TORCH3"
effect.light.visible = true
end
end
################################################################################
for effect in @light_effects
case effect.type
when "FIRE"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "LIGHT"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
when "LIGHT2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
when "LIGHT3"
effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15
effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15
effect.light.opacity = rand(10) + 90
when "TORCH"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10
effect.light.opacity = rand(30) + 70
when "TORCH2"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8
effect.light.opacity = rand(10) + 90
when "TORCH3"
effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3
effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "GROUND"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
when "GROUND2"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
effect.light.opacity = rand(10) + 90
when "GROUND3"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
when "GROUND4"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
when "GROUND5"
effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8
effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
end
end
#close def
end
#close class
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 = 1000
@event = event
@type = type
end
end
...
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 38
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: [Résolu] Effet de lumière avec le script light effect
Jeu 16 Aoû 2012 - 8:14
Alors, j'ai testé plusieurs solution avec cette ligne de script, et il semblerait que cela marche si je la met sur la 3e page. Mais cela crée un leger décalage entre l'effet visuel et le changement de chara, mais je devrais réussir à le supprimer en changeant l'ordre de mon event.
Merci beaucoup tout le monde
Merci beaucoup tout le monde
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|