Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: Dread Mac Farlane - episode 4 / Sorties: Star Trek: Glorious Wolf - (...) / Sorties: Dread Mac Farlane - episode 3 / News: Plein d'images cools créées par (...) / Sorties: Star Trek: Glorious Wolf - (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

404 connectés actuellement

29191511 visiteurs
depuis l'ouverture

6562 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Le Temple de Valor

RPG Fusion

Eclipso

Level Up!

New RPG Maker

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Scripts > [RMVX] Erreur de compatibilité avec le script de brouillard de DeadlyDan


Ignis - posté le 03/08/2020 à 15:17:52 (27 messages postés)

❤ 0

Bonjour j'ai récuperer sur internet un script de DeadlyDan pour mettre un brouillard sur une map.
J'ai tous installer correctement et quand je test il me met une erreur a la ligne 67
Pourquoi il m'indique une erreur ?


Voilà l'erreur en question :


https://www.casimages.com/i/200803031731575581.png.html

Et le code

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#===========================================
# ¦ DeadlyDan_MapFog by DeadlyDan
#--------------------------------------------
# Allows maps to have fogs like in RPG Maker XP
#============================================
 
#===============================================================
#
# www.rpgmakervx-fr.com
#
#===============================================================
 
 
# Usage:
=begin
 
To initialize a fog for a current map you must:
 
1) Create a map event and set it to only come on when Self Switch A is on.
2) Rename it to FOG. (Case sensitive, so it has to be FOG)
3) Set it to a Parallel Process.
4) Add for example, the following code into a Script Code event command:
 
$game_map.fog_name = \"fog\" # Filename of fog image located in the Pictures folder
$game_map.fog_zoom = 300 # How much to zoom into the fog image
$game_map.fog_sx = 1 # The scrolling speed across the x axis
$game_map.fog_sy = 1 # The scrolling speed across the y axis
$game_map.fog_target_opacity = 80 # The opacity of the fog
$game_map.fog_show # Always call this after changing fog variables
 
5) Then, add a Control Self Switch after that Script Code, and set it to turn A off.
 
(Note)
It is absolutely vital that you put the event name to FOG and set it to a Parallel Proccess and also set it to
only run when Self-Switch A is on.
 
Make sure you place this script after all other scripts except for Main.
 
(Extras)
You can also use extra commands to change the fog settings, such as the following example:
 
$game_map.fog_tone = Tone.new ( 100, 0, 0, 0 )
$game_map.fog_blend_type = 1 # ( 0 = NONE, 1 = ADD, 2 = SUBTRACT )
 
(Important!)
When you want to have a map with no fog, do all of the above but instead of seting the fog options and then
calling $game_map.fog_show, just add a Script Code event command and place in it $game_map.fog_clear.
 
This will clear the fog settings and the fog will dissapear, every map has to have a fog event in it, else maps
will keep all other maps fog settings that might be unintentional on the users side.
 
=end
 
class Game_Temp
attr_accessor :fog_name
attr_accessor :fog_opacity
attr_accessor :fog_target_opacity
attr_accessor :fog_blend_type
attr_accessor :fog_zoom
attr_accessor :fog_sx
attr_accessor :fog_sy
attr_accessor :fog_tone
 
alias original_initialize initialize
def initialize
original_initialize
@fog_name = \"fog\"
@fog_tone = Tone.new ( 0, 0, 0, 0 )
@fog_opacity = 0
@fog_target_opacity = 0
@fog_blend_type = 0
@fog_zoom = 100
@fog_sx = 0
@fog_sy = 0
end
 
end
 
class Game_Map
attr_accessor :fog_name
attr_accessor :fog_opacity
attr_accessor :fog_target_opacity
attr_accessor :fog_blend_type
attr_accessor :fog_zoom
attr_accessor :fog_sx
attr_accessor :fog_sy
attr_accessor :fog_ox
attr_accessor :fog_oy
attr_accessor :fog_tone
attr_accessor :fog_start_loop
attr_accessor :fog_eventid
attr_accessor :fog_visible
attr_accessor :fog
 
alias original_initialize initialize
def initialize
original_initialize
@fog = Plane.new ( @viewport1 )
@fog_ox = 0
@fog_oy = 0
end
 
alias original_setup setup
def setup ( map_id )
original_setup ( map_id )
fog_event
end
 
alias original_update update
def update
original_update
if ( @fog_visible and @fog )
fog_update
end
end
 
def fog_init
@fog_name = $game_temp.fog_name
@fog_tone = $game_temp.fog_tone
@fog_opacity = $game_temp.fog_opacity
@fog_target_opacity = $game_temp.fog_target_opacity
@fog_blend_type = $game_temp.fog_blend_type
@fog_zoom = $game_temp.fog_zoom
@fog_sx = $game_temp.fog_sx
@fog_sy = $game_temp.fog_sy
@fog_tone_target = Tone.new ( 0, 0, 0, 0 )
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@fog_previous_name = \"\"
fog_setup
end
 
def fog_setup
fog_hide
if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != \"\" ) )
@fog.bitmap = Cache.picture ( @fog_name )
@fog_name_previous = @fog_name
@fog_opacity = @fog_target_opacity
@fog.opacity = @fog_opacity
@fog.blend_type = @fog_blend_type
@fog.zoom_x = @fog_zoom / 100
@fog.zoom_y = @fog_zoom / 100
@fog.ox = @fog_ox
@fog.oy = @fog_oy
@fog.tone = @fog_tone
@fog.z = 99
@fog_visible = true
else
fog_hide
end
end
 
def fog_update
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
 
if ( @fog_tone_duration >= 1 )
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
if ( @fog_opacity_duration >= 1 )
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
@fog.opacity = @fog_opacity
@fog.blend_type = @fog_blend_type
@fog.zoom_x = @fog_zoom / 100
@fog.zoom_y = @fog_zoom / 100
@fog.ox = @fog_ox
@fog.oy = @fog_oy
@fog.tone = @fog_tone
end
 
def fog_show
fog_init
end
 
def fog_hide
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
end
 
def fog_clear
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
@fog_target_opacity = 0
$game_temp.fog_target_opacity = 0
fog_show
end
 
def scroll_up ( distance )
if ( loop_vertical? )
@display_y += @map.height * 256 - distance
@display_y %= @map.height * 256
@parallax_y -= distance
@fog_oy -= distance / 8.0
else
last_y = @display_y
@display_y = [@display_y - distance, 0].max
@parallax_y += @display_y - last_y
@fog_oy += ( @display_y - last_y ) / 8.0
end
end
 
def scroll_down ( distance )
if ( loop_vertical? )
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance
@fog_oy += distance / 8.0
else
last_y = @display_y
@display_y = [@display_y + distance, (height - 13) * 256].min
@parallax_y += @display_y - last_y
@fog_oy += ( @display_y - last_y ) / 8.0
end
end
 
def scroll_left ( distance )
if ( loop_horizontal? )
@display_x += @map.width * 256 - distance
@display_x %= @map.width * 256
@parallax_x -= distance
@fog_ox -= distance / 8.0
else
last_x = @display_x
@display_x = [@display_x - distance, 0].max
@parallax_x += @display_x - last_x
@fog_ox += ( @display_x - last_x ) / 8.0
end
end
 
def scroll_right ( distance )
if ( loop_horizontal? )
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance
@fog_ox += distance / 8.0
else
last_x = @display_x
@display_x = [@display_x + distance, (width - 17) * 256].min
@parallax_x += @display_x - last_x
@fog_ox += ( @display_x - last_x ) / 8.0
end
end
 
def setup_events
@fog_eventid = 0
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
if ( @events[i].name == \"FOG\" )
@fog_eventid = i
end
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
end
 
def fog_event
if ( @fog_eventid != 0 )
key = @events[@fog_eventid].selfswitch
$game_self_switches[key] = true
end
end
 
end
 
class Scene_Map < Scene_Base
 
alias original_start start
def start
original_start
$game_map.fog_show
$game_map.fog_event
end
 
alias original_terminate terminate
def terminate
original_terminate
$game_map.fog_hide
end
 
end
 
class Game_Player < Game_Character
 
alias original_perform_transfer perform_transfer
def perform_transfer
original_perform_transfer
$game_map.setup_events
$game_map.fog_event
$game_map.fog_show
end
 
end
 
class Game_Event < Game_Character
 
def name
return @event.name
end
 
def selfswitch
key = [@map_id, @event.id, \'A\']
return key
end
 
end




gif - posté le 03/08/2020 à 15:22:46 (4782 messages postés) - staff

❤ 0

Egotrip Gigamaxé

Salut, t'as essayé en remplacant :

Portion de code : Tout sélectionner

1
2
3
4
5
ligne  67 @fog_name = \"fog\"
ligne 130 @fog_previous_name = \"\"
ligne 136 if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != \"\" ) )
ligne 261 if ( @events[i].name == \"FOG\" )
ligne 316 key = [@map_id, @event.id, \'A\']


par

Portion de code : Tout sélectionner

1
2
3
4
5
@fog_name = "fog"
@fog_previous_name = ""
if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != "" ) )
if ( @events[i].name == "FOG" )
key = [@map_id, @event.id, 'A']



?

EDIT : Le code entier :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#===========================================
# ¦ DeadlyDan_MapFog by DeadlyDan
#--------------------------------------------
# Allows maps to have fogs like in RPG Maker XP
#============================================
 
#===============================================================
#
# www.rpgmakervx-fr.com
#
#===============================================================
 
 
# Usage:
=begin
 
To initialize a fog for a current map you must:
 
1) Create a map event and set it to only come on when Self Switch A is on.
2) Rename it to FOG. (Case sensitive, so it has to be FOG)
3) Set it to a Parallel Process.
4) Add for example, the following code into a Script Code event command:
 
$game_map.fog_name = \"fog\" # Filename of fog image located in the Pictures folder
$game_map.fog_zoom = 300 # How much to zoom into the fog image
$game_map.fog_sx = 1 # The scrolling speed across the x axis
$game_map.fog_sy = 1 # The scrolling speed across the y axis
$game_map.fog_target_opacity = 80 # The opacity of the fog
$game_map.fog_show # Always call this after changing fog variables
 
5) Then, add a Control Self Switch after that Script Code, and set it to turn A off.
 
(Note)
It is absolutely vital that you put the event name to FOG and set it to a Parallel Proccess and also set it to
only run when Self-Switch A is on.
 
Make sure you place this script after all other scripts except for Main.
 
(Extras)
You can also use extra commands to change the fog settings, such as the following example:
 
$game_map.fog_tone = Tone.new ( 100, 0, 0, 0 )
$game_map.fog_blend_type = 1 # ( 0 = NONE, 1 = ADD, 2 = SUBTRACT )
 
(Important!)
When you want to have a map with no fog, do all of the above but instead of seting the fog options and then
calling $game_map.fog_show, just add a Script Code event command and place in it $game_map.fog_clear.
 
This will clear the fog settings and the fog will dissapear, every map has to have a fog event in it, else maps
will keep all other maps fog settings that might be unintentional on the users side.
 
=end
 
class Game_Temp
attr_accessor :fog_name
attr_accessor :fog_opacity
attr_accessor :fog_target_opacity
attr_accessor :fog_blend_type
attr_accessor :fog_zoom
attr_accessor :fog_sx
attr_accessor :fog_sy
attr_accessor :fog_tone
 
alias original_initialize initialize
def initialize
original_initialize
@fog_name = "fog"
@fog_tone = Tone.new ( 0, 0, 0, 0 )
@fog_opacity = 0
@fog_target_opacity = 0
@fog_blend_type = 0
@fog_zoom = 100
@fog_sx = 0
@fog_sy = 0
end
 
end
 
class Game_Map
attr_accessor :fog_name
attr_accessor :fog_opacity
attr_accessor :fog_target_opacity
attr_accessor :fog_blend_type
attr_accessor :fog_zoom
attr_accessor :fog_sx
attr_accessor :fog_sy
attr_accessor :fog_ox
attr_accessor :fog_oy
attr_accessor :fog_tone
attr_accessor :fog_start_loop
attr_accessor :fog_eventid
attr_accessor :fog_visible
attr_accessor :fog
 
alias original_initialize initialize
def initialize
original_initialize
@fog = Plane.new ( @viewport1 )
@fog_ox = 0
@fog_oy = 0
end
 
alias original_setup setup
def setup ( map_id )
original_setup ( map_id )
fog_event
end
 
alias original_update update
def update
original_update
if ( @fog_visible and @fog )
fog_update
end
end
 
def fog_init
@fog_name = $game_temp.fog_name
@fog_tone = $game_temp.fog_tone
@fog_opacity = $game_temp.fog_opacity
@fog_target_opacity = $game_temp.fog_target_opacity
@fog_blend_type = $game_temp.fog_blend_type
@fog_zoom = $game_temp.fog_zoom
@fog_sx = $game_temp.fog_sx
@fog_sy = $game_temp.fog_sy
@fog_tone_target = Tone.new ( 0, 0, 0, 0 )
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@fog_previous_name = ""
fog_setup
end
 
def fog_setup
fog_hide
if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != "" ) )
@fog.bitmap = Cache.picture ( @fog_name )
@fog_name_previous = @fog_name
@fog_opacity = @fog_target_opacity
@fog.opacity = @fog_opacity
@fog.blend_type = @fog_blend_type
@fog.zoom_x = @fog_zoom / 100
@fog.zoom_y = @fog_zoom / 100
@fog.ox = @fog_ox
@fog.oy = @fog_oy
@fog.tone = @fog_tone
@fog.z = 99
@fog_visible = true
else
fog_hide
end
end
 
def fog_update
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
 
if ( @fog_tone_duration >= 1 )
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
if ( @fog_opacity_duration >= 1 )
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
@fog.opacity = @fog_opacity
@fog.blend_type = @fog_blend_type
@fog.zoom_x = @fog_zoom / 100
@fog.zoom_y = @fog_zoom / 100
@fog.ox = @fog_ox
@fog.oy = @fog_oy
@fog.tone = @fog_tone
end
 
def fog_show
fog_init
end
 
def fog_hide
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
end
 
def fog_clear
@fog_visible = false
@fog_opacity = 0
$game_temp.fog_opacity = 0
@fog_target_opacity = 0
$game_temp.fog_target_opacity = 0
fog_show
end
 
def scroll_up ( distance )
if ( loop_vertical? )
@display_y += @map.height * 256 - distance
@display_y %= @map.height * 256
@parallax_y -= distance
@fog_oy -= distance / 8.0
else
last_y = @display_y
@display_y = [@display_y - distance, 0].max
@parallax_y += @display_y - last_y
@fog_oy += ( @display_y - last_y ) / 8.0
end
end
 
def scroll_down ( distance )
if ( loop_vertical? )
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance
@fog_oy += distance / 8.0
else
last_y = @display_y
@display_y = [@display_y + distance, (height - 13) * 256].min
@parallax_y += @display_y - last_y
@fog_oy += ( @display_y - last_y ) / 8.0
end
end
 
def scroll_left ( distance )
if ( loop_horizontal? )
@display_x += @map.width * 256 - distance
@display_x %= @map.width * 256
@parallax_x -= distance
@fog_ox -= distance / 8.0
else
last_x = @display_x
@display_x = [@display_x - distance, 0].max
@parallax_x += @display_x - last_x
@fog_ox += ( @display_x - last_x ) / 8.0
end
end
 
def scroll_right ( distance )
if ( loop_horizontal? )
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance
@fog_ox += distance / 8.0
else
last_x = @display_x
@display_x = [@display_x + distance, (width - 17) * 256].min
@parallax_x += @display_x - last_x
@fog_ox += ( @display_x - last_x ) / 8.0
end
end
 
def setup_events
@fog_eventid = 0
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
if ( @events[i].name == "FOG" )
@fog_eventid = i
end
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
end
 
def fog_event
if ( @fog_eventid != 0 )
key = @events[@fog_eventid].selfswitch
$game_self_switches[key] = true
end
end
 
end
 
class Scene_Map < Scene_Base
 
alias original_start start
def start
original_start
$game_map.fog_show
$game_map.fog_event
end
 
alias original_terminate terminate
def terminate
original_terminate
$game_map.fog_hide
end
 
end
 
class Game_Player < Game_Character
 
alias original_perform_transfer perform_transfer
def perform_transfer
original_perform_transfer
$game_map.setup_events
$game_map.fog_event
$game_map.fog_show
end
 
end
 
class Game_Event < Game_Character
 
def name
return @event.name
end
 
def selfswitch
key = [@map_id, @event.id, 'A']
return key
end
 
end
 



Itch.io | Twitter | Une IA qui génère des sprites de Pokémon | Cochouchou à la coupe du monde ! | le concours hebdomadaire du meilleur screen !


Ignis - posté le 03/08/2020 à 15:25:53 (27 messages postés)

❤ 0

Je viens de le faire sa m'a crée une autre erreur

https://www.casimages.com/i/200803032545604908.png.html


Je viens de copier le script EDIT et il y a encore la meme erreur ligne 68


gif - posté le 03/08/2020 à 16:02:13 (4782 messages postés) - staff

❤ 0

Egotrip Gigamaxé

Bon bah j'vais devoir ouvrir rmvx :p.

Peux-tu me partager le lien depuis lequel tu as copié le script ? Merci !

Itch.io | Twitter | Une IA qui génère des sprites de Pokémon | Cochouchou à la coupe du monde ! | le concours hebdomadaire du meilleur screen !


Ignis - posté le 03/08/2020 à 16:05:36 (27 messages postés)

❤ 0

https://www.rpgmakervx-fr.com/t553-brouillard-pour-rmvx


gif - posté le 03/08/2020 à 16:08:29 (4782 messages postés) - staff

❤ 0

Egotrip Gigamaxé

Ouais ok, on a trouvé le même.

Bah écoute je prendrais le temps de le régler d'ici mercredi :).

Edit : As-tu essayé cette version ? https://www.neoseeker.com

Itch.io | Twitter | Une IA qui génère des sprites de Pokémon | Cochouchou à la coupe du monde ! | le concours hebdomadaire du meilleur screen !


Ignis - posté le 05/08/2020 à 17:14:23 (27 messages postés)

❤ 0

Bonjour gif alors t'a des nouvelles concernant le script ?


gif - posté le 05/08/2020 à 17:47:10 (4782 messages postés) - staff

❤ 0

Egotrip Gigamaxé

Oui, la version que je t'ai partagé du script fonctionne bien (https://www.neoseeker.com), l'as tu testé ?

image

image
Magnifique "fog of war" que j'ai créé pour l'occasion lol

Les commentaires en début du script indiquent :

Portion de code : Tout sélectionner

1
2
3
4
5
6
  $game_map.fog_name = "fog"               # Filename of fog image located in the Pictures folder
  $game_map.fog_zoom = 300                 # How much to zoom into the fog image
  $game_map.fog_sx = 1                           # The scrolling speed across the x axis
  $game_map.fog_sy = 1                           # The scrolling speed across the y axis
  $game_map.fog_target_opacity = 80    # The opacity of the fog
  $game_map.fog_show                             # Always call this after changing fog variables  



Alors que c'est plutôt :

Portion de code : Tout sélectionner

1
2
3
4
5
6
  $game_temp.fog_name = "fog"               # Filename of fog image located in the Pictures folder
  $game_temp.fog_zoom = 300                 # How much to zoom into the fog image
  $game_temp.fog_sx = 1                           # The scrolling speed across the x axis
  $game_temp.fog_sy = 1                           # The scrolling speed across the y axis
  $game_temp.fog_target_opacity = 80    # The opacity of the fog
  $game_map.fog_show                             # Always call this after changing fog variables  



Je suppose qu'ils n'étaient pas à jour. Version avec ces corrections (commentaires) :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
#===========================================
# DeadlyDan_MapFog by DeadlyDan
#--------------------------------------------
#  Allows maps to have fogs like in RPG Maker XP
#============================================
# Usage:
=begin
  
  To initialize a fog for a current map you must:
  
  1) Create a map event and set it to only come on when Self Switch A is on.
  2) Rename it to FOG. (Case sensitive, so it has to be FOG)
  3) Set it to a Parallel Process.
  4) Add for example, the following code into a Script Code event command:
  
  $game_temp.fog_name = "fog"               # Filename of fog image located in the Pictures folder
  $game_temp.fog_zoom = 300                 # How much to zoom into the fog image
  $game_temp.fog_sx = 1                           # The scrolling speed across the x axis
  $game_temp.fog_sy = 1                           # The scrolling speed across the y axis
  $game_temp.fog_target_opacity = 80    # The opacity of the fog
  $game_map.fog_show                             # Always call this after changing fog variables  
  
  5) Then, add a Control Self Switch after that Script Code, and set it to turn A off.
  
  (Note)
  It is absolutely vital that you put the event name to FOG and set it to a Parallel Proccess and also set it to
  only run when Self-Switch A is on.
  
  Make sure you place this script after all other scripts except for Main.
  
  (Extras)
  You can also use extra commands to change the fog settings, such as the following example:
  
  $game_temp.fog_tone = Tone.new ( 100, 0, 0, 0 )
  $game_temp.fog_blend_type = 1 # ( 0 = NONE, 1 = ADD, 2 = SUBTRACT )
  
  (Important!)
  When you want to have a map with no fog, do all of the above but instead of seting the fog options and then
  calling $game_map.fog_show, just add a Script Code event command and place in it $game_map.fog_clear.
  
  This will clear the fog settings and the fog will dissapear, every map has to have a fog event in it, else maps
  will keep all other maps fog settings that might be unintentional on the users side.
  
=end
 
class Game_Temp
  attr_accessor :fog_name
  attr_accessor :fog_opacity
  attr_accessor :fog_target_opacity
  attr_accessor :fog_blend_type
  attr_accessor :fog_zoom
  attr_accessor :fog_sx
  attr_accessor :fog_sy
  attr_accessor :fog_tone
  
  alias original_initialize initialize
  def initialize
    original_initialize
    @fog_name = ""
    @fog_tone = Tone.new ( 0, 0, 0, 0 )
    @fog_opacity = 0
    @fog_target_opacity = 0
    @fog_blend_type = 0
    @fog_zoom = 100
    @fog_sx = 0
    @fog_sy = 0
  end
  
end
 
class Game_Map
  attr_accessor :fog_name
  attr_accessor :fog_opacity
  attr_accessor :fog_target_opacity
  attr_accessor :fog_blend_type
  attr_accessor :fog_zoom
  attr_accessor :fog_sx
  attr_accessor :fog_sy
  attr_accessor :fog_ox
  attr_accessor :fog_oy
  attr_accessor :fog_tone
  attr_accessor :fog_start_loop
  attr_accessor :fog_eventid
  attr_accessor :fog_visible
  attr_accessor :fog
  
  alias original_initialize initialize
  def initialize
    original_initialize
    @fog = Plane.new ( @viewport1 )
    @fog_ox = 0
    @fog_oy = 0
  end
  
  alias original_setup setup
  def setup ( map_id )
    original_setup ( map_id )
    fog_event
  end
 
  alias original_update update
  def update
    original_update
    if ( @fog_visible and @fog )
      fog_update
    end
  end  
 
  def fog_init
      @fog_name = $game_temp.fog_name
      @fog_tone = $game_temp.fog_tone
      @fog_opacity = $game_temp.fog_opacity
      @fog_target_opacity = $game_temp.fog_target_opacity
      @fog_blend_type = $game_temp.fog_blend_type
      @fog_zoom = $game_temp.fog_zoom
      @fog_sx = $game_temp.fog_sx
      @fog_sy = $game_temp.fog_sy
      @fog_tone_target = Tone.new ( 0, 0, 0, 0 )
      @fog_tone_duration = 0
      @fog_opacity_duration = 0
      @fog_opacity_target = 0
      @fog_previous_name = ""
      fog_setup
  end
  
  def fog_setup
    fog_hide
    if ( ( @fog_previous_name != @fog_name ) and ( @fog_name != "" ) )
      p @fog_name
      @fog.bitmap = Cache.picture ( @fog_name )
      @fog_name_previous = @fog_name
      @fog_opacity = @fog_target_opacity
      @fog.opacity = @fog_opacity
      @fog.blend_type = @fog_blend_type
      @fog.zoom_x = @fog_zoom / 100
      @fog.zoom_y = @fog_zoom / 100
      @fog.ox = @fog_ox
      @fog.oy = @fog_oy
      @fog.tone = @fog_tone
      @fog.z = 99
      @fog_visible = true
    else
       fog_hide
    end
  end
  
  def fog_update
    @fog_ox -= @fog_sx / 8.0
    @fog_oy -= @fog_sy / 8.0
 
    if ( @fog_tone_duration >= 1 )
      d = @fog_tone_duration
      target = @fog_tone_target
      @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
      @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
      @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
      @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
      @fog_tone_duration -= 1
    end
    if ( @fog_opacity_duration >= 1 )
      d = @fog_opacity_duration
      @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
      @fog_opacity_duration -= 1
    end
    @fog.opacity = @fog_opacity
    @fog.blend_type = @fog_blend_type
    @fog.zoom_x = @fog_zoom / 100
    @fog.zoom_y = @fog_zoom / 100
    @fog.ox = @fog_ox
    @fog.oy = @fog_oy
    @fog.tone = @fog_tone
  end
  
  def fog_show
    fog_init
  end
  
  def fog_hide
    @fog_visible = false
    @fog_opacity = 0
    $game_temp.fog_opacity = 0
  end
  
  def fog_clear
    @fog_visible = false
    @fog_opacity = 0
    $game_temp.fog_opacity = 0
    @fog_target_opacity = 0
    $game_temp.fog_target_opacity = 0
    fog_show
  end
    
  def scroll_up ( distance )
    if ( loop_vertical? )
      @display_y += @map.height * 256 - distance
      @display_y %= @map.height * 256
      @parallax_y -= distance
      @fog_oy -= distance / 8.0
    else
      last_y = @display_y
      @display_y = [@display_y - distance, 0].max
      @parallax_y += @display_y - last_y
      @fog_oy += ( @display_y - last_y ) / 8.0
    end
  end
  
  def scroll_down ( distance )
    if ( loop_vertical? )
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance
      @fog_oy += distance / 8.0
    else
      last_y = @display_y
      @display_y = [@display_y + distance, (height - 13) * 256].min
      @parallax_y += @display_y - last_y
      @fog_oy += ( @display_y - last_y ) / 8.0
    end
  end
 
  def scroll_left ( distance )
    if ( loop_horizontal? )
      @display_x += @map.width * 256 - distance
      @display_x %= @map.width * 256
      @parallax_x -= distance
      @fog_ox -= distance / 8.0
    else
       last_x = @display_x
      @display_x = [@display_x - distance, 0].max
      @parallax_x += @display_x - last_x
      @fog_ox += ( @display_x - last_x ) / 8.0
    end
  end
  
  def scroll_right ( distance )
    if ( loop_horizontal? )
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance
      @fog_ox += distance / 8.0
    else
      last_x = @display_x
      @display_x = [@display_x + distance, (width - 17) * 256].min
      @parallax_x += @display_x - last_x
      @fog_ox += ( @display_x - last_x ) / 8.0
    end
  end
  
  def setup_events
    @fog_eventid = 0
    @events = {}
    for i in @map.events.keys
      @events[i] = Game_Event.new(@map_id, @map.events[i])
      if ( @events[i].name == "FOG" )
        @fog_eventid = i
      end
    end
    @common_events = {}
    for i in 1...$data_common_events.size
      @common_events[i] = Game_CommonEvent.new(i)
    end
  end
    
  def fog_event
    if ( @fog_eventid != 0 )
      key = @events[@fog_eventid].selfswitch
      $game_self_switches[key] = true
    end
  end
 
end
 
class Scene_Map < Scene_Base
  
  alias original_start start
  def start
    original_start
    $game_map.fog_show
    $game_map.fog_event
  end
 
  alias original_terminate terminate
  def terminate
    original_terminate
    $game_map.fog_hide
  end
  
end
 
class Game_Player < Game_Character
  
  alias original_perform_transfer perform_transfer
  def perform_transfer
    original_perform_transfer
    $game_map.setup_events
    $game_map.fog_event
    $game_map.fog_show
  end
  
end
 
class Game_Event < Game_Character
 
  def name
    return @event.name
  end
  
  def selfswitch
    key = [@map_id, @event.id, 'A']
    return key
  end
  
end



Itch.io | Twitter | Une IA qui génère des sprites de Pokémon | Cochouchou à la coupe du monde ! | le concours hebdomadaire du meilleur screen !


Ignis - posté le 05/08/2020 à 17:57:04 (27 messages postés)

❤ 0

J'ai copié ton script et l'event avec, a l'identique

Mais...

Il y a une erreur de syntaxe ligne 60

@fog_tone = Tone.new ( 0, 0, 0, 0 )

Quelqu'un sait d'ou vient l'erreur de syntaxe?


HuLijin - posté le 05/08/2020 à 18:05:09 (997 messages postés)

❤ 0

Yeoun, mage-archère-louve

À tout hasard, tu n'aurais pas un autre script plus bas dans ta liste qui modifie le comportement de Tone ?
L'erreur qu'il génère est vraiment bizarre. On dirait qu'il y a trop d'arguments. Je ne code plus en Ruby depuis des lustres, je ne sais plus s'il y a un code erreur dédié pour les erreurs d'arguments ou si c'est ce message.

M.V.


gif - posté le 05/08/2020 à 18:08:37 (4782 messages postés) - staff

❤ 0

Egotrip Gigamaxé

Ca marche très bien sur un projet vierge. C'est surement un autre script qui doit t'embêter, oui.

Itch.io | Twitter | Une IA qui génère des sprites de Pokémon | Cochouchou à la coupe du monde ! | le concours hebdomadaire du meilleur screen !


Ignis - posté le 05/08/2020 à 18:09:23 (27 messages postés)

❤ 0

Non il y a pas de script en dessous de celui-ci ''FOG"

https://www.casimages.com/i/200805060905417002.png.html

Comment faire pour qu'il ne m'embête plus xD :triste2

Je peux pas supprimer des scripts qui sont liées au fonctionnement du jeu.

Est ce que je peux faire ce que je veux avec un eventcommun?


HuLijin - posté le 05/08/2020 à 18:31:35 (997 messages postés)

❤ 0

Yeoun, mage-archère-louve

Bon ben un script plus haut alors. T'en as un paquet qui ne sont pas des scripts de base. Au hasard, le Ombre vu le nom, mais ça peut être n'importe lequel de ceux dans Materials.

M.V.


Ignis - posté le 05/08/2020 à 18:39:23 (27 messages postés)

❤ 0

"Ombre" c'est ce script Zeus Lights Shadows il permet de jouer la luminosité pour les endroits sombre tel que les grottes, caves, tombeaux

J'en est absolument besoin il constitue les effets principal du jeu

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
 
# Zeus Lights & Shadows v1.3 for XP, VX and VXace by Zeus81
# €30 for commercial use
# Licence : http://creativecommons.org/licenses/by-nc-nd/3.0/
# Contact : zeusex81@gmail.com
# (fr) Manuel d'utilisation : http://pastebin.com/raw.php?i=xfu8yG0q
# (en) User Guide           : http://pastebin.com/raw.php?i=9bnzSHCw
#      Demo : https://www.dropbox.com/sh/cajvk3wf6ue0ivf/QA9zgrm2Vx
 
module Zeus_Lights_Shadows
  extend self
  
  Disable_Lights = false
  Disable_Shadows = false
  Disable_AutoShadows = false
  
  def light(key = "event#@event_id")
    $game_map.lights[key]  ||= Game_Light.new
  end
  def shadow(key = "event#@event_id")
    $game_map.shadows[key] ||= Game_Shadow.new
  end
  def set_shadowable(value, chara_id=@event_id)
    chara = zls_get_character(chara_id)
    chara.shadowable = value if chara
  end
  def zls_get_character(id)
    case id
    when  0        ; nil
    when -1        ; $game_player
    when -2, -3, -4; $game_player.followers[-id-2] if RPG_VERSION == :vxace
    when -5, -6, -7; $game_map.vehicles[-id-5] if RPG_VERSION != :xp
    else             $game_map.events[id]
    end
  end
end
 
$imported ||= {}
$imported[:Zeus_Lights_Shadows] = __FILE__
RPG_VERSION = RUBY_VERSION == '1.8.1' ? defined?(Hangup) ? :xp : :vx : :vxace
 
module Zeus_Animation
  def animate(variable, target_value, duration=0, ext=nil)
    @za_animations ||= {}
    if duration < 1
      update_animation_value(variable, target_value, 1, ext)
      @za_animations.delete(variable)
    else
      @za_animations[variable] = [target_value, duration.to_i, ext]
    end
  end
private
  def update_animations
    @za_animations ||= {}
    @za_animations.delete_if do |variable, data|
      update_animation_value(variable, *data)
      (data[1] -= 1) == 0
    end
  end
  def calculate_next_value(value, target_value, duration)
    (value * (duration - 1) + target_value) / duration
  end
  def update_animation_value(variable, target_value, duration, ext)
    value = instance_variable_get(variable)
    method_name = "update_animation_variable_#{variable.to_s[1..-1]}"
    method_name = "update_animation_#{value.class}" unless respond_to?(method_name)
    send(method_name, variable, value, target_value, duration, ext)
  end
  def update_animation_Color(variable, value, target_value, duration, ext)
    value.red   = calculate_next_value(value.red  , target_value.red  , duration)
    value.green = calculate_next_value(value.green, target_value.green, duration)
    value.blue  = calculate_next_value(value.blue , target_value.blue , duration)
    value.alpha = calculate_next_value(value.alpha, target_value.alpha, duration)
  end
  def update_animation_Float(variable, value, target_value, duration, ext)
    value = calculate_next_value(value, target_value, duration)
    instance_variable_set(variable, value)
  end
  alias update_animation_Fixnum update_animation_Float
  alias update_animation_Bignum update_animation_Float
end
 
class Game_Light_Shadow_Base
  include Zeus_Animation
  attr_accessor :chara_id, :active, :visible, :filename, :opacity, :color,
                :x, :y, :ox, :oy, :zoom_x, :zoom_y, :parallax_x, :parallax_y,
                :direction, :directions, :pattern, :patterns, :anime_rate
  def initialize
    clear
  end
  def clear
    @chara_id = 0
    @active = false
    @visible = true
    @filename = ""
    @opacity = 255
    @color ||= Color.new(0, 0, 0)
    @color.set(0, 0, 0, 255)
    @x = 0
    @y = 0
    @ox = 0.5
    @oy = 0.5
    @zoom_x = 1.0
    @zoom_y = 1.0
    @zoom2 = Math.sqrt(100.0)
    @parallax_x = 1.0
    @parallax_y = 1.0
    @direction = 0
    @directions = 1
    @pattern = 0
    @patterns = 1
    @anime_rate = 0.0
  end
  def setup(filename)
    @active = true
    @filename = filename
  end
  def update
    update_animations
    update_pattern
  end
  def update_pattern
    if @anime_rate > 0 and Graphics.frame_count % @anime_rate < 1
      @pattern += 1
      @pattern %= @patterns
    end
  end
  def set_pos(x, y, duration=0)
    animate(:@x, x, duration)
    animate(:@y, y, duration)
  end
  def set_origin(ox, oy, duration=0)
    animate(:@ox, ox / 100.0, duration)
    animate(:@oy, oy / 100.0, duration)
  end
  def set_parallax(x, y, duration=0)
    animate(:@parallax_x, x, duration)
    animate(:@parallax_y, y, duration)
  end
  def set_opacity(opacity, duration=0)
    opacity = opacity * 255 / 100
    animate(:@opacity, opacity, duration)
  end
  def set_color(red, green, blue, alpha, duration=0)
    animate(:@color, Color.new(red, green, blue, alpha), duration)
  end
  def set_zoom(zoom, duration=0)
    zoom = Math.sqrt([1, zoom].max)
    animate(:@zoom2, zoom, duration)
  end
  def update_animation_variable_zoom2(variable, value, target_value, duration, ext)
    @zoom2 = calculate_next_value(value, target_value, duration)
    @zoom_y = @zoom_x = @zoom2 ** 2 / 100.0
  end
end
 
class Game_Shadow < Game_Light_Shadow_Base
  attr_accessor :size, :shadowable
  def clear
    super
    @size = nil
    @shadowable = true
  end
  def setup(filename_or_width, height=0)
    if filename_or_width.is_a?(String)
      @size = nil
      super(filename_or_width)
    else
      super("")
      @size ||= Rect.new(0, 0, 0, 0)
      @size.set(0, 0, filename_or_width.to_i, height.to_i)
    end
  end
end
 
class Game_Light < Game_Light_Shadow_Base
  attr_accessor :z, :angle, :mirror, :blend_type, :flicker,
                :wave_amp, :wave_length, :wave_speed, :wave_phase
  def clear
    super
    @z = 0xC001
    @angle = 0.0
    @mirror = false
    @blend_type = 1
    @wave_amp = 0
    @wave_length = 180
    @wave_speed = 360
    @wave_phase = 0.0
    @flicker = 1.0
    @flicker_variance = 0.0
    @flicker_rate = 4.0
  end
  def update
    super
    update_flicker
  end
  def update_flicker
    if @flicker_variance == 0
      @flicker = 1
    elsif @flicker_rate == 0 or Graphics.frame_count % @flicker_rate < 1
      case rand(100)
      when 33; value = 1 - @flicker_variance*2
      when 66; value = 1 + @flicker_variance*2
      else     value = 1 - @flicker_variance + @flicker_variance*2*rand
      end
      animate(:@flicker, value, @flicker_rate.to_i)
    end
  end
  def set_angle(angle, duration=0)
    animate(:@angle, angle, duration)
  end
  def set_wave(amp, length, speed, duration=0)
    animate(:@wave_amp   , amp   , duration)
    animate(:@wave_length, length, duration)
    animate(:@wave_speed , speed , duration)
  end
  def set_flicker(variance, refresh_rate, duration=0)
    animate(:@flicker_variance , variance / 100.0, duration)
    animate(:@flicker_rate     , refresh_rate    , duration)
  end
end
 
class Game_Character
  attr_accessor :shadowable
  def shadowable
    @shadowable = true if @shadowable.nil?
    @shadowable
  end
end
 
class Game_Map
  include Zeus_Lights_Shadows
  attr_reader :lights, :shadows, :auto_shadows
  alias zeus_lights_shadows_setup setup
  def setup(map_id)
    @lights  ||= {}
    @lights.each_value  {|data| data.clear if data.chara_id >= 0}
    @shadows ||= {}
    @shadows.each_value {|data| data.clear if data.chara_id >= 0}
    zeus_lights_shadows_setup(map_id)
    @auto_shadows ||= []
    @auto_shadows.clear
    init_auto_shadows if RPG_VERSION != :xp and (!Disable_Shadows or Disable_AutoShadows)
  end
  alias zeus_lights_shadows_update update
  def update(*args)
    zeus_lights_shadows_update(*args)
    @lights.each_value  {|data| data.update}
    @shadows.each_value {|data| data.update}
  end
  
  case RPG_VERSION
  when :vx
    
    def init_auto_shadows
      grounds = [1552...1664, 2816...3008, 3200...3392, 3584...3776, 3968...4160]
      is_ground = Proc.new {|id| grounds.any? {|range| range.include?(id)}}
      is_wall = Proc.new {|id| id >= 4352}
      data.xsize.times do |x|
        data.ysize.times do |y|
          tile_id = data[x, y, 0]
          if is_wall.call(tile_id)
            data[x, y, 1] = tile_id
            data[x, y, 0] = 0
          elsif !Disable_Shadows and !Disable_AutoShadows and
                x > 0 and y > 0 and is_ground.call(tile_id) and
                is_wall.call(data[x-1, y, 1]) and is_wall.call(data[x-1, y-1, 1])
          then
            @auto_shadows << [x*32, y*32, 16, 32]
          end
        end
      end
    end
    
  when :vxace
    
    def init_auto_shadows
      data.xsize.times do |x|
        data.ysize.times do |y|
          shadow_id = data[x, y, 3] & 0b1111
          data[x, y, 3] -= shadow_id
          next if Disable_Shadows or Disable_AutoShadows or shadow_id == 0
          case shadow_id
          when  3; @auto_shadows << [x*32, y*32, 32, 16]
          when  5; @auto_shadows << [x*32, y*32, 16, 32]
          when 10; @auto_shadows << [x*32+16, y*32, 16, 32]
          when 12; @auto_shadows << [x*32, y*32+16, 32, 16]
          when 15; @auto_shadows << [x*32, y*32, 32, 32]
          else
            4.times do |i|
              if shadow_id[i] == 1
                @auto_shadows << [x*32 + i%2*16, y*32 + i/2*16, 16, 16]
              end
            end
          end
        end
      end
    end
    
  end # case RPG_VERSION
  
end
 
if RPG_VERSION == :xp
  Cache = RPG::Cache
  Game_Interpreter = Interpreter
end
 
class Game_Interpreter
  include Zeus_Lights_Shadows
end
 
class Spriteset_Lights_Shadows
  include Zeus_Lights_Shadows
  ShadowData = Struct.new(:bitmap, :opacity, :src_rect, :color,
                          :x, :y, :ox, :oy, :zoom_x, :zoom_y)
  def initialize(viewport)
    @viewport = viewport
    @luminosity = 0
    unless Disable_Lights
      @night_layer = Sprite.new(@viewport)
      @night_layer.z = 0xC000
      @night_layer.blend_type = 2
      @night_layer.visible = false
      @night_color = Color.new(0, 0, 0)
      @lights = {}
    end
    unless Disable_Shadows
      @shadows_layer = Sprite.new(@viewport)
      @shadows_layer.visible = false
      @auto_shadows_color = Color.new(0, 0, 0, 255)
      @shadow_data = ShadowData.new
      @shadow_data.src_rect = Rect.new(0, 0, 0, 0)
    end
    refresh_bitmaps
  end
  def dispose
    unless Disable_Lights
      @night_layer.bitmap.dispose
      @night_layer.dispose
      @lights.each_value {|sprite| sprite.dispose}
    end
    unless Disable_Shadows
      @shadows_layer.bitmap.dispose
      @shadows_layer.dispose
    end
  end
  def update(character_sprites)
    refresh_bitmaps if bitmaps_need_refresh?
    update_luminosity
    update_lights unless Disable_Lights
    update_shadows(character_sprites) unless Disable_Shadows
  end
    def refresh_bitmaps
      unless Disable_Lights
        @night_layer.bitmap.dispose if @night_layer.bitmap
        @night_layer.bitmap   = Bitmap.new(@viewport.rect.width, @viewport.rect.height)
      end
      unless Disable_Shadows
        @shadows_layer.bitmap.dispose if @shadows_layer.bitmap
        @shadows_layer.bitmap = Bitmap.new(@viewport.rect.width, @viewport.rect.height)
      end
    end
    def bitmaps_need_refresh?
      unless Disable_Lights
        return true if @night_layer.bitmap.width    != @viewport.rect.width or
                       @night_layer.bitmap.height   != @viewport.rect.height
      end
      unless Disable_Shadows
        return true if @shadows_layer.bitmap.width  != @viewport.rect.width or
                       @shadows_layer.bitmap.height != @viewport.rect.height
      end
      return false
    end
    def update_luminosity
      r, g, b = @viewport.tone.red, @viewport.tone.green, @viewport.tone.blue
      @luminosity = (30*r.to_i + 59*g.to_i + 11*b.to_i) / 100
    end
  def update_lights
    $game_map.lights.delete_if do |key, data|
      if data.active
        update_light_sprite(key, data)
      else
        sprite = @lights.delete(key) and sprite.dispose
      end
      !data.active
    end
    @night_color.set(0, 0, 0)
    unless no_lights?
      r, g, b = @viewport.tone.red, @viewport.tone.green, @viewport.tone.blue
      @viewport.tone.red   += @night_color.red   = -r if r < 0
      @viewport.tone.green += @night_color.green = -g if g < 0
      @viewport.tone.blue  += @night_color.blue  = -b if b < 0
    end
    if @night_color.red + @night_color.green + @night_color.blue == 0
      @night_layer.visible = false
      return
    end
    @night_layer.visible = true
    @night_layer.x = @viewport.ox
    @night_layer.y = @viewport.oy
    @night_layer.bitmap.fill_rect(@night_layer.bitmap.rect, @night_color)
    @lights.each_value do |sprite|
      draw_layer_sprite(@night_layer.bitmap, sprite) if sprite.visible
    end
  end
    def no_lights?
      @lights.all? {|key,sprite| !sprite.visible}
    end
    def update_light_sprite(key, data)
      sprite = @lights[key] ||= Sprite.new(@viewport)
      chara  = zls_get_character(data.chara_id)
      return unless sprite.visible = calculate_visible(data, chara)
      sprite.bitmap     = Cache.picture(data.filename)
      w = sprite.bitmap.width  / data.patterns
      h = sprite.bitmap.height / data.directions
      synchronize_direction_pattern(data, chara) if chara
      sprite.src_rect.set(data.pattern*w, data.direction*h, w, h)
      sprite.color      = data.color
      sprite.x          = calculate_x(data.x, data.parallax_x, chara)
      sprite.y          = calculate_y(data.y, data.parallax_y, chara)
      sprite.z          = data.z
      sprite.ox         = data.ox * w
      sprite.oy         = data.oy * h
      sprite.zoom_x     = data.zoom_x * data.flicker
      sprite.zoom_y     = data.zoom_y * data.flicker
      sprite.angle      = data.angle
      sprite.mirror     = data.mirror
      sprite.opacity    = data.opacity
      sprite.blend_type = data.blend_type
      if RPG_VERSION != :xp
        sprite.wave_amp    = data.wave_amp
        sprite.wave_length = data.wave_length
        sprite.wave_speed  = data.wave_speed
        sprite.wave_phase  = data.wave_phase
        sprite.update
        data.wave_phase    = sprite.wave_phase
      end
    end
    def draw_layer_sprite(layer, sprite)
      if sprite.zoom_x == 1 and sprite.zoom_y == 1
        x = sprite.x - sprite.ox - @viewport.ox
        y = sprite.y - sprite.oy - @viewport.oy
        layer.blt(x, y, sprite.bitmap, sprite.src_rect, sprite.opacity)
      else
        dest_rect = Rect.new(
          sprite.x - sprite.ox * sprite.zoom_x - @viewport.ox,
          sprite.y - sprite.oy * sprite.zoom_y - @viewport.oy,
          sprite.src_rect.width  * sprite.zoom_x,
          sprite.src_rect.height * sprite.zoom_y)
        layer.stretch_blt(dest_rect, sprite.bitmap, sprite.src_rect, sprite.opacity)
      end
    end
    
  def update_shadows(character_sprites)
    $game_map.shadows.delete_if {|key, data| !data.active}
    if @luminosity <= -64 or no_shadows?
      if @shadows_layer.visible
        @shadows_layer.visible = false
        character_sprites.each {|chara| chara.color.alpha = 0}
      end
      return
    end
    @shadows_layer.visible = true
    @shadows_layer.x = @viewport.ox
    @shadows_layer.y = @viewport.oy
    @shadows_layer.opacity = 128 + (@luminosity>0 ? @luminosity/2 : @luminosity*2)
    @shadows_layer.bitmap.clear
    $game_map.shadows.each_value do |data|
      update_shadow_data(data) if data.shadowable
    end
    draw_auto_shadows
    draw_airship_shadow if RPG_VERSION != :xp
    for sprite in character_sprites
      if !shadowable_character?(sprite.character)
        sprite.color.alpha = 0
      elsif sprite.x >= 0 and sprite.x < @shadows_layer.bitmap.width and
            sprite.y >= 4 and sprite.y < @shadows_layer.bitmap.height+4
      then
        sprite.color = @shadows_layer.bitmap.get_pixel(sprite.x, sprite.y-4)
        sprite.color.alpha = sprite.color.alpha * @shadows_layer.opacity / 255
      end
    end
    $game_map.shadows.each_value do |data|
      update_shadow_data(data) if !data.shadowable
    end
  end
    def no_shadows?
      $game_map.auto_shadows.empty? and
      $game_map.shadows.all? do |key,data|
        !calculate_visible(data, zls_get_character(data.chara_id))
      end
    end
    def shadowable_character?(chara)
      if RPG_VERSION != :xp and chara == $game_map.airship
      then chara.altitude < 16
      else chara.shadowable
      end
    end
    def draw_auto_shadows
      for x, y, w, h in $game_map.auto_shadows
        x = calculate_x(x, 1, nil) - @viewport.ox
        y = calculate_y(y, 1, nil) - @viewport.oy
        @shadows_layer.bitmap.fill_rect(x, y, w, h, @auto_shadows_color)
      end
    end
    def draw_airship_shadow
      return if $game_map.airship.transparent or $game_map.airship.altitude == 0
      bmp     = Cache.system("Shadow")
      opacity = [$game_map.airship.altitude * 8, 255].min
      x = $game_map.airship.screen_x - bmp.width / 2 - @viewport.ox
      y = $game_map.airship.screen_y - bmp.height - @viewport.oy +
          $game_map.airship.altitude + 4
      @shadows_layer.bitmap.blt(x, y, bmp, bmp.rect, opacity)
    end
    def update_shadow_data(data)
      chara = zls_get_character(data.chara_id)
      return unless calculate_visible(data, chara)
      if data.size
        @shadow_data.src_rect.set(0, 0, w=data.size.width, h=data.size.height)
        @shadow_data.color   = data.color
        @shadow_data.bitmap  = nil
      else
        @shadow_data.bitmap  = Cache.picture(data.filename)
        @shadow_data.opacity = data.opacity
        w = @shadow_data.bitmap.width  / data.patterns
        h = @shadow_data.bitmap.height / data.directions
        synchronize_direction_pattern(data, chara) if chara
        @shadow_data.src_rect.set(data.pattern*w, data.direction*h, w, h)
      end
      @shadow_data.x       = calculate_x(data.x, data.parallax_x, chara)
      @shadow_data.y       = calculate_y(data.y, data.parallax_y, chara)
      @shadow_data.ox      = data.ox * w
      @shadow_data.oy      = data.oy * h
      @shadow_data.zoom_x  = data.zoom_x
      @shadow_data.zoom_y  = data.zoom_y
      draw_layer_shadow(@shadows_layer.bitmap, @shadow_data)
    end
    def draw_layer_shadow(layer, shadow)
      if shadow.bitmap
        draw_layer_sprite(layer, shadow)
      else
        dest_rect = Rect.new(
          shadow.x - shadow.ox * shadow.zoom_x - @viewport.ox,
          shadow.y - shadow.oy * shadow.zoom_y - @viewport.oy,
          shadow.src_rect.width  * shadow.zoom_x,
          shadow.src_rect.height * shadow.zoom_y)
        layer.fill_rect(dest_rect, shadow.color)
      end
    end
  
  def synchronize_direction_pattern(data, chara)
    case data.directions
    when 2; data.direction = (chara.direction - 1) / 4
    when 4; data.direction = (chara.direction - 1) / 2
    when 8; data.direction =  chara.direction - 1 - chara.direction / 5
    end
    if data.anime_rate == 0
      data.pattern = chara.pattern < 3 || RPG_VERSION == :xp ? chara.pattern : 1
      data.pattern %= data.patterns
    end
  end
  def calculate_visible(data, chara)
    if chara
      return false if chara.transparent
      if chara.is_a?(Game_Event)
        return false unless chara.list
      elsif RPG_VERSION == :vxace and chara.is_a?(Game_Follower)
        return false unless chara.visible?
      end
    end
    return false unless data.visible and data.opacity > 0
    return true if !data.filename.empty?
    return true if data.is_a?(Game_Shadow) and data.size
    return false
  end
  def calculate_x(x, parallax_x, chara)
    if chara
      x + chara.screen_x
    elsif RPG_VERSION == :xp or parallax_x != 1 or !$game_map.loop_horizontal?
      case RPG_VERSION
      when :xp   ; x - $game_map.display_x * parallax_x / 4
      when :vx   ; x - $game_map.display_x * parallax_x / 8
      when :vxace; x - $game_map.display_x * parallax_x * 32
      end
    else
      case RPG_VERSION
      when :vx   ; $game_map.adjust_x(x * 8) / 8
      when :vxace; $game_map.adjust_x(x / 32.0) * 32
      end
    end
  end
  def calculate_y(y, parallax_y, chara)
    if chara
      y + chara.screen_y
    elsif RPG_VERSION == :xp or parallax_y != 1 or !$game_map.loop_vertical?
      case RPG_VERSION
      when :xp   ; y - $game_map.display_y * parallax_y / 4
      when :vx   ; y - $game_map.display_y * parallax_y / 8
      when :vxace; y - $game_map.display_y * parallax_y * 32
      end
    else
      case RPG_VERSION
      when :vx   ; $game_map.adjust_y(y * 8) / 8
      when :vxace; $game_map.adjust_y(y / 32.0) * 32
      end
    end
  end
  
end
 
class Spriteset_Map
  alias zeus_lights_shadows_dispose dispose
  def dispose
    zeus_lights_shadows_dispose
    @lights_shadows.dispose
  end
  alias zeus_lights_shadows_update update
  def update
    zeus_lights_shadows_update
    @lights_shadows ||= Spriteset_Lights_Shadows.new(@viewport1)
    @lights_shadows.update(@character_sprites)
  end
  if RPG_VERSION != :xp and !Zeus_Lights_Shadows::Disable_Shadows
    def create_shadow()  end
    def update_shadow()  end
    def dispose_shadow() end
  end
end
 
$imported[:Zeus_Weather_Viewport] ||= __FILE__ if RPG_VERSION != :xp
if $imported[:Zeus_Weather_Viewport] == __FILE__
  
  class Spriteset_Map
    alias zeus_weather_viewport_create_weather create_weather
    def create_weather
      zeus_weather_viewport_create_weather
      @weather.weather_viewport = @viewport1
    end
  end
  
  class Spriteset_Weather
    case RPG_VERSION
    when :vx
      def weather_viewport=(viewport)
        for sprite in @sprites
          sprite.viewport = viewport
          sprite.z = 0x8000
        end
      end
    when :vxace
      attr_accessor :weather_viewport
      alias zeus_weather_viewport_add_sprite add_sprite
      def add_sprite
        zeus_weather_viewport_add_sprite
        @sprites[-1].viewport = @weather_viewport
        @sprites[-1].z = 0x8000
      end
    end
  end
  
end
 
$imported[:Zeus_Event_Auto_Setup] ||= __FILE__
if $imported[:Zeus_Event_Auto_Setup] == __FILE__
  
  class Game_Map
    alias zeus_auto_setup setup
    def setup(map_id)
      zeus_auto_setup(map_id)
      @events.each_value {|event| event.auto_setup}
    end
  end
  
  class Game_Event
    alias zeus_auto_setup_refresh refresh
    def refresh
      zeus_auto_setup_refresh
      auto_setup if $game_map.events[@id]
    end
    def auto_setup
      @auto_setup ||= {}
      return unless @auto_setup[:list] != @list and @auto_setup[:list] = @list
      unless @auto_setup.has_key?(@list)
        flag_a, flag_b, a, b = '<setup>', '</setup>', nil, nil
        @list.each_with_index do |command, id|
          if command.code % 300 == 108 # comment
            b = id if  a and command.parameters[0].include?(flag_b)
            a = id if !a and command.parameters[0].include?(flag_a)
            break if a and b
          end
        end
        @auto_setup[@list] = a && b && @list.slice!(a, b-a+1).push(@list[-1])
      end
      if @auto_setup[@list]
        interpreter = Game_Interpreter.new
        interpreter.setup(@auto_setup[@list], @id)
        interpreter.update while interpreter.running?
      end
    end
  end
  
end




HuLijin - posté le 05/08/2020 à 18:50:45 (997 messages postés)

❤ 0

Yeoun, mage-archère-louve

Ça n'a pas l'air d'être celui-là après une rapide recherche.
C'est à toi de trouver le script qui pose problème. On ne peut rien faire sans avoir tous les autres scripts.

Cherche quelque chose du genre "def Tone" ou un alias de Tone.

HS : je me demande si Zeus est riche à l'heure qu'il est.

M.V.

Index du forum > Scripts > [RMVX] Erreur de compatibilité avec le script de brouillard de DeadlyDan

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers