- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Effets météo en combat
Lun 29 Déc 2014 - 20:58
Bonsoir,
J'utilise le script de Tsukihime pour conserver l'effet météo actuel pendant les combats. C'est-à-dire que s'il pleut sur ma WorldMap et qu'un combat se déclenche, je vois toujours la pluie à l'écran pendant le combat.
Le script qui n'est pas bien long, le voici :
Ma question est la suivante :
Dans mon jeu test, j'utilise des images pour simuler les rayons du soleil et des flashs pour simuler l'orage. Est-il possible de conserver ces éléments en plein combat ? Actuellement, ce n'est pas le cas (le script de Tsukihime gérant uniquement les effets météo propres à RPG Maker).
J'utilise le script de Tsukihime pour conserver l'effet météo actuel pendant les combats. C'est-à-dire que s'il pleut sur ma WorldMap et qu'un combat se déclenche, je vois toujours la pluie à l'écran pendant le combat.
Le script qui n'est pas bien long, le voici :
Ma question est la suivante :
Dans mon jeu test, j'utilise des images pour simuler les rayons du soleil et des flashs pour simuler l'orage. Est-il possible de conserver ces éléments en plein combat ? Actuellement, ce n'est pas le cas (le script de Tsukihime gérant uniquement les effets météo propres à RPG Maker).
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Dim 4 Jan 2015 - 16:02
Up
- HeavenStaffeux retraité
- Nombre de messages : 2441
Age : 23
Localisation : Alpes-Maritimes VIRILITÉ OLALA
Distinction : Aucune
Date d'inscription : 18/10/2012
Re: Effets météo en combat
Dim 4 Jan 2015 - 17:21
Ce que tu peux faire, c'est faire un background avec ton rayon de soleil inclut dedans et regarde si ça fonctionne :3
Heav'n
Heav'n
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Dim 4 Jan 2015 - 17:36
Mais il faudrait que ce background s'affiche quand le soleil est bien présent. Ces fameux rayons apparaissent uniquement quand ma variable Météo est sur un état ensoleillé.
- HeavenStaffeux retraité
- Nombre de messages : 2441
Age : 23
Localisation : Alpes-Maritimes VIRILITÉ OLALA
Distinction : Aucune
Date d'inscription : 18/10/2012
Re: Effets météo en combat
Dim 4 Jan 2015 - 17:45
Nérylis a écrit:Mais il faudrait que ce background s'affiche quand le soleil est bien présent. Ces fameux rayons apparaissent uniquement quand ma variable Météo est sur un état ensoleillé.
Dans ce cas, il faudrait que tu c/c trois fois tes maps (orage, pluie, soleil...) et que dans les paramètres de la map tu choisis le backgroung de la map. Sinon, j'ai pas d'autre idée x)
Heav'n
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Dim 4 Jan 2015 - 17:56
Renvoie le script pour voir
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Dim 4 Jan 2015 - 18:18
Le script se situe sur mon post original.
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Dim 4 Jan 2015 - 18:48
il ne s'afficher pas mais maintenant c'est ok pour l'orage les flash se font a période régulière ou de manière aléatoire ?
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Dim 4 Jan 2015 - 20:18
C'est à période régulière : la première fois au bout de 300 frames et après tous les 600 frames.
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Dim 4 Jan 2015 - 20:23
Tient voila :
a la place de celui de tsuki
dis moi si ça convient
- Code:
module Weather_Battle
PICTURE_RAYON_SOLEIL = "Rayon_soleil.png"
PICTURE_RAYON_OPACITY = 100
ID_SWITCH_JOUR = 5
FLASH_ROUGE = 255
FLASH_VERT = 255
FLASH_BLEU = 255
FLASH_INTENSITE = 255
FLASH_DUREE = 60
FLASH_TIME = 120
end
class Spriteset_Battle
#just throw the weather creation somewhere after viewports created...
alias tsuki_weatherfx_create_viewports create_viewports
def create_viewports
tsuki_weatherfx_create_viewports
create_weather
end
def create_weather
@weather = Spriteset_Weather.new(@viewport2)
@weather.type = $game_map.screen.weather_type
@weather.power = $game_map.screen.weather_power
end
alias tsuki_screenfx_spritebattle_update update
def update
tsuki_screenfx_spritebattle_update
update_weather
end
#only update weather if it's not the same as the current weather?
def update_weather
#@weather.type = $game_troop.screen.weather_type if $game_troop.screen.weather_type != @weather.type
#@weather.power = $game_troop.screen.weather_power if $game_troop.screen.weather_power != @weather.power
@weather.ox = 0
@weather.oy = 0
@weather.update
if @weather.type == :storm
if (Graphics.frame_count % Weather_Battle::FLASH_TIME) == 0
r = Weather_Battle::FLASH_ROUGE
v = Weather_Battle::FLASH_VERT
b = Weather_Battle::FLASH_BLEU
g = Weather_Battle::FLASH_INTENSITE
color = Color.new(r,v,b,g)
$game_troop.screen.start_flash(color, Weather_Battle::FLASH_DUREE)
end
elsif @weather.type == :none
if $game_switches[Weather_Battle::ID_SWITCH_JOUR]
return if @sprite_weather
@sprite_weather = Sprite.new
@sprite_weather.bitmap = Cache.picture(Weather_Battle::PICTURE_RAYON_SOLEIL)
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY
end
end
end
#throw weather disposal somewhere before viewports are disposed...
alias tsuki_weatherfx_dispose_viewports dispose_viewports
def dispose_viewports
dispose_weather
tsuki_weatherfx_dispose_viewports
end
def dispose_weather
@weather.dispose
@sprite_weather.dispose rescue true
end
end
class Game_Interpreter
#allow weather in battle
alias tsuki_weatherfx_command_236 command_236
def command_236
if $game_party.in_battle
screen.change_weather(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[3]
else
tsuki_weatherfx_command_236
end
end
end
a la place de celui de tsuki
dis moi si ça convient
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Dim 4 Jan 2015 - 20:47
Je viens de tester : pour l'orage et les éclairs en combat, ça marche super bien.
Pour les rayons de soleil, je ne t'ai pas tout dit.
J'ai une variable Météo qui peut afficher plusieurs états ensoleillés. Ces états déterminent si les rayons sont plus ou moins intenses. J'ai une seule image dans mon dossier Pictures. Dans mon évênement, en fonction de ma variable météo, j'affiche cette image sous 4 ID possibles avec une opacité différente. En gros, s'il y a un ciel bleu (varaiable météo à 0), j'affiche l'image Soleil en image 1 avec une opacité de 50. S'il y a un peu de nuages (variable météo à 1), j'affiche l'image Soleil en image 2 avec une opacité de 35...
Pour les rayons de soleil, je ne t'ai pas tout dit.
J'ai une variable Météo qui peut afficher plusieurs états ensoleillés. Ces états déterminent si les rayons sont plus ou moins intenses. J'ai une seule image dans mon dossier Pictures. Dans mon évênement, en fonction de ma variable météo, j'affiche cette image sous 4 ID possibles avec une opacité différente. En gros, s'il y a un ciel bleu (varaiable météo à 0), j'affiche l'image Soleil en image 1 avec une opacité de 50. S'il y a un peu de nuages (variable météo à 1), j'affiche l'image Soleil en image 2 avec une opacité de 35...
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Dim 4 Jan 2015 - 21:10
oki je rajoute ça alors
- Code:
module Weather_Battle
PICTURE_RAYON_SOLEIL = "Rayon_soleil.png"
ID_VARIABLE_METEO = 5
PICTURE_RAYON_OPACITY1 = 50
PICTURE_RAYON_OPACITY2 = 35
PICTURE_RAYON_OPACITY3 = 20
PICTURE_RAYON_OPACITY4 = 5
FLASH_ROUGE = 255
FLASH_VERT = 255
FLASH_BLEU = 255
FLASH_INTENSITE = 255
FLASH_DUREE = 60
FLASH_TIME = 120
end
class Spriteset_Battle
#just throw the weather creation somewhere after viewports created...
alias tsuki_weatherfx_create_viewports create_viewports
def create_viewports
tsuki_weatherfx_create_viewports
create_weather
end
def create_weather
@weather = Spriteset_Weather.new(@viewport2)
@weather.type = $game_map.screen.weather_type
@weather.power = $game_map.screen.weather_power
end
alias tsuki_screenfx_spritebattle_update update
def update
tsuki_screenfx_spritebattle_update
update_weather
end
#only update weather if it's not the same as the current weather?
def update_weather
#@weather.type = $game_troop.screen.weather_type if $game_troop.screen.weather_type != @weather.type
#@weather.power = $game_troop.screen.weather_power if $game_troop.screen.weather_power != @weather.power
@weather.ox = 0
@weather.oy = 0
@weather.update
if @weather.type == :storm
if (Graphics.frame_count % Weather_Battle::FLASH_TIME) == 0
r = Weather_Battle::FLASH_ROUGE
v = Weather_Battle::FLASH_VERT
b = Weather_Battle::FLASH_BLEU
g = Weather_Battle::FLASH_INTENSITE
color = Color.new(r,v,b,g)
$game_troop.screen.start_flash(color, Weather_Battle::FLASH_DUREE)
end
elsif @weather.type == :none
if $game_variables[Weather_Battle::ID_VARIABLE_METEO] < 4
return if @sprite_weather
@sprite_weather = Sprite.new
@sprite_weather.bitmap = Cache.picture(Weather_Battle::PICTURE_RAYON_SOLEIL)
id = $game_variables[Weather_Battle::ID_VARIABLE_METEO]
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY1 if id == 0
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY2 if id == 1
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY3 if id == 2
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY4 if id == 3
end
end
end
#throw weather disposal somewhere before viewports are disposed...
alias tsuki_weatherfx_dispose_viewports dispose_viewports
def dispose_viewports
dispose_weather
tsuki_weatherfx_dispose_viewports
end
def dispose_weather
@weather.dispose
@sprite_weather.dispose rescue true
end
end
class Game_Interpreter
#allow weather in battle
alias tsuki_weatherfx_command_236 command_236
def command_236
if $game_party.in_battle
screen.change_weather(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[3]
else
tsuki_weatherfx_command_236
end
end
end
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Lun 5 Jan 2015 - 20:30
C'est presque parfait, beau boulot.
J'ai testé ton script, tout fonctionne (les opacités fonctionnent très bien, que ça soit le matin, le jour ou le soir, ça claque).
Il reste deux petites choses à modifier :
- La nuit, peu importe la météo, on ne voit aucun rayon de soleil. Mon interrupteur nuit coupe toutes les images. Or, on les voit en combat.
- Lorsque je rentre dans un donjon, c'est la même chose. Même s'il fait beau dehors, on ne voit aucun rayon à l'intérieur. Là aussi, on les voit cependant en plein combat.
J'ai testé ton script, tout fonctionne (les opacités fonctionnent très bien, que ça soit le matin, le jour ou le soir, ça claque).
Il reste deux petites choses à modifier :
- La nuit, peu importe la météo, on ne voit aucun rayon de soleil. Mon interrupteur nuit coupe toutes les images. Or, on les voit en combat.
- Lorsque je rentre dans un donjon, c'est la même chose. Même s'il fait beau dehors, on ne voit aucun rayon à l'intérieur. Là aussi, on les voit cependant en plein combat.
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Ven 9 Jan 2015 - 16:32
Voilou
- Code:
module Weather_Battle
PICTURE_RAYON_SOLEIL = "Rayon_soleil.png"
ID_VARIABLE_METEO = 5
INTER_NUIT = 1
INTER_DONJON = 2
PICTURE_RAYON_OPACITY1 = 50
PICTURE_RAYON_OPACITY2 = 35
PICTURE_RAYON_OPACITY3 = 20
PICTURE_RAYON_OPACITY4 = 5
FLASH_ROUGE = 255
FLASH_VERT = 255
FLASH_BLEU = 255
FLASH_INTENSITE = 255
FLASH_DUREE = 60
FLASH_TIME = 120
end
class Spriteset_Battle
#just throw the weather creation somewhere after viewports created...
alias tsuki_weatherfx_create_viewports create_viewports
def create_viewports
tsuki_weatherfx_create_viewports
create_weather
end
def create_weather
@weather = Spriteset_Weather.new(@viewport2)
@weather.type = $game_map.screen.weather_type
@weather.power = $game_map.screen.weather_power
end
alias tsuki_screenfx_spritebattle_update update
def update
tsuki_screenfx_spritebattle_update
update_weather
end
#only update weather if it's not the same as the current weather?
def update_weather
#@weather.type = $game_troop.screen.weather_type if $game_troop.screen.weather_type != @weather.type
#@weather.power = $game_troop.screen.weather_power if $game_troop.screen.weather_power != @weather.power
@weather.ox = 0
@weather.oy = 0
@weather.update
if @weather.type == :storm
if (Graphics.frame_count % Weather_Battle::FLASH_TIME) == 0
r = Weather_Battle::FLASH_ROUGE
v = Weather_Battle::FLASH_VERT
b = Weather_Battle::FLASH_BLEU
g = Weather_Battle::FLASH_INTENSITE
color = Color.new(r,v,b,g)
$game_troop.screen.start_flash(color, Weather_Battle::FLASH_DUREE)
end
elsif @weather.type == :none
return if $game_switches[Weather_Battle::INTER_NUIT] == true || $game_switches[Weather_Battle::INTER_DONJON] == true
if $game_variables[Weather_Battle::ID_VARIABLE_METEO] < 4
return if @sprite_weather
@sprite_weather = Sprite.new
@sprite_weather.bitmap = Cache.picture(Weather_Battle::PICTURE_RAYON_SOLEIL)
id = $game_variables[Weather_Battle::ID_VARIABLE_METEO]
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY1 if id == 0
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY2 if id == 1
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY3 if id == 2
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY4 if id == 3
end
end
end
#throw weather disposal somewhere before viewports are disposed...
alias tsuki_weatherfx_dispose_viewports dispose_viewports
def dispose_viewports
dispose_weather
tsuki_weatherfx_dispose_viewports
end
def dispose_weather
@weather.dispose
@sprite_weather.dispose rescue true
end
end
class Game_Interpreter
#allow weather in battle
alias tsuki_weatherfx_command_236 command_236
def command_236
if $game_party.in_battle
screen.change_weather(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[3]
else
tsuki_weatherfx_command_236
end
end
end
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Ven 9 Jan 2015 - 16:43
J'ai voulu tester mais j'ai une erreur sur le Flash Time : "Level stack too deep"
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Mer 14 Jan 2015 - 15:41
Tu est sur que le problème vient de mon script ?
Sinon j'ai corriger un truc :
Sinon j'ai corriger un truc :
- Code:
module Weather_Battle
PICTURE_RAYON_SOLEIL = "Rayon_soleil.png"
ID_VARIABLE_METEO = 5
INTER_NUIT = 1
INTER_DONJON = 2
PICTURE_RAYON_OPACITY1 = 50
PICTURE_RAYON_OPACITY2 = 35
PICTURE_RAYON_OPACITY3 = 20
PICTURE_RAYON_OPACITY4 = 5
FLASH_ROUGE = 255
FLASH_VERT = 255
FLASH_BLEU = 255
FLASH_INTENSITE = 255
FLASH_DUREE = 60
FLASH_TIME = 120
end
class Spriteset_Battle
#just throw the weather creation somewhere after viewports created...
alias tsuki_weatherfx_create_viewports create_viewports
def create_viewports
tsuki_weatherfx_create_viewports
create_weather
end
def create_weather
@weather = Spriteset_Weather.new(@viewport2)
@weather.type = $game_map.screen.weather_type
@weather.power = $game_map.screen.weather_power
end
alias tsuki_screenfx_spritebattle_update update
def update
tsuki_screenfx_spritebattle_update
update_weather
end
#only update weather if it's not the same as the current weather?
def update_weather
#@weather.type = $game_troop.screen.weather_type if $game_troop.screen.weather_type != @weather.type
#@weather.power = $game_troop.screen.weather_power if $game_troop.screen.weather_power != @weather.power
@weather.ox = 0
@weather.oy = 0
@weather.update
if @weather.type == :storm
if (Graphics.frame_count % Weather_Battle::FLASH_TIME) == 0
r = Weather_Battle::FLASH_ROUGE
v = Weather_Battle::FLASH_VERT
b = Weather_Battle::FLASH_BLEU
g = Weather_Battle::FLASH_INTENSITE
color = Color.new(r,v,b,g)
$game_troop.screen.start_flash(color, Weather_Battle::FLASH_DUREE)
end
elsif @weather.type == :none
if $game_switches[Weather_Battle::INTER_NUIT] == true || $game_switches[Weather_Battle::INTER_DONJON] == true
@sprite_weather.dispose if @sprite_weather
else
if $game_variables[Weather_Battle::ID_VARIABLE_METEO] < 4
return if @sprite_weather
@sprite_weather = Sprite.new
@sprite_weather.bitmap = Cache.picture(Weather_Battle::PICTURE_RAYON_SOLEIL)
id = $game_variables[Weather_Battle::ID_VARIABLE_METEO]
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY1 if id == 0
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY2 if id == 1
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY3 if id == 2
@sprite_weather.opacity = Weather_Battle::PICTURE_RAYON_OPACITY4 if id == 3
else
@sprite_weather.dispose if @sprite_weather
end
end
end
end
#throw weather disposal somewhere before viewports are disposed...
alias tsuki_weatherfx_dispose_viewports dispose_viewports
def dispose_viewports
dispose_weather
tsuki_weatherfx_dispose_viewports
end
def dispose_weather
@weather.dispose
@sprite_weather.dispose rescue true
end
end
class Game_Interpreter
#allow weather in battle
alias tsuki_weatherfx_command_236 command_236
def command_236
if $game_party.in_battle
screen.change_weather(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[3]
else
tsuki_weatherfx_command_236
end
end
end
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Mer 14 Jan 2015 - 18:17
C'est bizarre, j'ai repris ce que tu avais fait mais le bug n'est pas revenu.
Tu as corrigé quoi ?
Tu as corrigé quoi ?
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Mer 14 Jan 2015 - 19:53
La suppression de l'image qui n'etait pas bonne Du coup c'est bon ?
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Mer 14 Jan 2015 - 20:14
On dirait que ça marche bien.
Je fais valider le sujet, et si j'ai un souci, je te contacte par MP.
Je fais valider le sujet, et si j'ai un souci, je te contacte par MP.
- vincent26Membre
- Nombre de messages : 766
Age : 28
Localisation : baume de transit le village paumé
Distinction : aucune
Date d'inscription : 17/08/2010
Re: Effets météo en combat
Mer 14 Jan 2015 - 20:27
Pas de soucis
- NérylisMembre
- Nombre de messages : 615
Age : 35
Localisation : Seine Maritime
Distinction : aucune
Date d'inscription : 23/11/2014
Re: Effets météo en combat
Mer 14 Jan 2015 - 20:28
Merci pour tout.
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|