Bienvenue visiteur !
|
![publicité RPG Maker!](interface/pub/lmda.gif)
Statistiques
Liste des membres
Contact
Mentions légales
305 connectés actuellement
30989310 visiteurs depuis l'ouverture
3088 visiteurs aujourd'hui
![Barre de séparation](interfacev2/fondgauchesepara.png)
Partenaires
![Indiexpo](https://www.rpg-maker.fr/interface/partenaires/freankexpo.gif)
![Akademiya RPG Maker](https://www.rpg-maker.fr/interface/partenaires/rmru.gif)
![Blog Alioune Fall](interface/partenaires/quest_fantasy.png)
![Fairy Tail Constellations](interface/partenaires/fairy_tail_constellations.png)
![Hellsoft](interface/partenaires/hellsoft.png)
![Lumen](https://www.rpg-maker.fr/interface/partenaires/lumen.png)
![New RPG Maker](https://www.rpg-maker.fr/interface/partenaires/newrpgmaker.png)
![Eclipso](https://www.rpg-maker.fr/interface/partenaires/eclipso.jpg)
Tous nos partenaires
Devenir partenaire
|
DeadPool98 -
posté le 24/09/2016 à 18:11:35 (47 messages postés)
| Je suis un carton... | Domaine concerné: Script/Event Logiciel utilisé: RPG Maker VX Ace Salut tout le monde ,
alors voilà, hier j'ai voulu installer le script "Light Effect 1.3.1": je l'essaye, il marche à merveille!
Comme le précise la description du script, on peut activer et désactiver l'effet de lumière grâce à des interrupteurs.
Le problème étant qu'en désactivant l'interrupteur, on désactive TOUS les effets de lumières...
Pour palier à cela, j'ai décidé de bidouiller un peut le script avec la base que je maîtrise en rgss. Je décide de créer un deuxième Interrupteur (il m'en faudra 14 au total) qui lui contrôlera les effets lumineux portant le nom de LIGHT 2.
En faisant cela, lorsque je fait "Nouvelle Partie", le jeu crash et me dit:
Citation: Script 'Light_Effects' line 91: NameError occured. uninitialized constant Spriteset_Map::Light_Effect_A. |
J'ai passé la journée à essayer de résoudre ce problème, et bien que je comprenne le sens du message d'erreur, je ne sais pas comment le résoudre...
Si quelqu'un pouvait m'apporter son aide, se serais merveilleux.
Bonne soirée les Maker
Script Original "Light Effects":
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
| #==============================================================================
# AUTOLIGHT 1.3.1 UNOFFICIAL PORTING VX ACE
# 12.27.2008
#------------------------------------------------------------------------------
# SCRIPT BY: Kylock
# PORTING BY: I don't want to be credited.
#
#==============================================================================
# INSTRUCTIONS
#
# Remember, you must have the file "le.png" in your "Graphics\Pictures" folder!
# If you're missing the file follow this link:
# <a href="http://imageshack.us/photo/my-images/189/81598086.png/" target="_blank">http://imageshack.us/photo/my-images/189/81598086.png/</a>
#
# To make an event glow, choose the desired event and comment with the applied
# term. If you want Light 1, comment "LIGHT 1".
#==============================================================================
# ? Change Log
#------------------------------------------------------------------------------
# 1.0 - Original Release
# 1.1 - New light modes added: LIGHT2, TORCHLIT 1, TORCHLIT 2
# - Changed sprite blend mode to ADD
# - Fire-based lights are now red in color
# 1.2 - Bug fixed with looping maps and lights displaying above message boxes
# 1.3 - More bugfixes
#==============================================================================
# ? Light Modes
#------------------------------------------------------------------------------
#LIGHT 1 - Lumière blanche régulière. (Petit)
#FIREPIT - Scintillement.
#LIGHT 2 - Lumière blanche régulière. (Grand)
#LIGHT 3 - Lumière blanche régulière.
#TORCHLIT 1 - Scintillement. (Lourd)
#TORCHLIT 2 - Scintillement. (Lumière)
#==============================================================================
module LES
#The switch used to turn lights ON/OFF
#If the Switch is ON the lights turn OFF
#If the Switch is OFF the lights turn ON
SWITCH = 30
end
#==============================================================================
# ¦ Spriteset_Map
#==============================================================================
class Spriteset_Map
alias les_spriteset_map_initalize initialize
def initialize
initialize_effects
les_spriteset_map_initalize
update
end
def initialize_effects
@light_effects = []
setup_lights
end
alias les_spriteset_map_dispose dispose
def dispose
les_spriteset_map_dispose
dispose_effects
end
def dispose_effects
for effect in @light_effects
effect.light.dispose
end
@light_effects = []
end
alias les_spriteset_map_update update
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 == ["LIGHT 1"]
type = "LIGHT 1"
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 == ["FIREPIT"]
type = "FIREPIT"
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 2"]
type = "LIGHT 2"
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 == ["LIGHT 3"]
type = "LIGHT 3"
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 == ["TORCHLIT 1"]
type = "TORCHLIT 1"
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 == ["TORCHLIT 2"]
type = "TORCHLIT 2"
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 "LIGHT 1"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
when "FIREPIT"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "LIGHT 2"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
effect.light.blend_type = 1
when "LIGHT 3"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.blend_type = 1
when "TORCHLIT 1"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCHLIT 2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
end
end
end #def setup_lights
def update_light_effects
if $game_switches[LES::SWITCH]
for effect in @light_effects
effect.light.visible = false
end
else
for effect in @light_effects
effect.light.visible = true
end
end
for effect in @light_effects
case effect.type
when "LIGHT 1"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
when "FIREPIT"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "LIGHT 2"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
when "LIGHT 3"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
when "TORCHLIT 1"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.opacity = rand(30) + 70
when "TORCHLIT 2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.opacity = rand(10) + 90
end
end
end #def update_light_effects
end #class Spriteset_Map
#==============================================================================
# ¦ Light_Effect
#==============================================================================
class Light_Effect
attr_accessor :light
attr_accessor :event
attr_accessor :type
def initialize(event, type)
@light = Sprite.new
@light.bitmap = Cache.picture("le.png")
@light.visible = true
@light.z = 190
@event = event
@type = type
end
end #class Light_Effect
#==============================================================================
# ¦ Scene_Map
#==============================================================================
class Scene_Map
alias les_pre_transfer pre_transfer
def pre_transfer
les_pre_transfer
@spriteset.dispose_effects
end
alias les_post_transfer post_transfer
def post_transfer
@spriteset.initialize_effects
les_post_transfer
end
end #Scene_Map
#==============================================================================
# END OF FILE
#============================================================================== |
Code que j'ai modifié :
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
| #==============================================================================
# AUTOLIGHT 1.3.1 UNOFFICIAL PORTING VX ACE
# 12.27.2008
#------------------------------------------------------------------------------
# SCRIPT BY: Kylock
# PORTING BY: I don't want to be credited.
#
#==============================================================================
# INSTRUCTIONS
#
# Remember, you must have the file "le.png" in your "Graphics\Pictures" folder!
# If you're missing the file follow this link:
# <a href="http://imageshack.us/photo/my-images/189/81598086.png/" target="_blank">http://imageshack.us/photo/my-images/189/81598086.png/</a>
#
# To make an event glow, choose the desired event and comment with the applied
# term. If you want Light 1, comment "LIGHT 1".
#==============================================================================
# ? Change Log
#------------------------------------------------------------------------------
# 1.0 - Original Release
# 1.1 - New light modes added: LIGHT2, TORCHLIT 1, TORCHLIT 2
# - Changed sprite blend mode to ADD
# - Fire-based lights are now red in color
# 1.2 - Bug fixed with looping maps and lights displaying above message boxes
# 1.3 - More bugfixes
#==============================================================================
# ? Light Modes
#------------------------------------------------------------------------------
#LIGHT 1 - Lumière blanche régulière. (Petit)
#FIREPIT - Scintillement.
#LIGHT 2 - Lumière blanche régulière. (Grand)
#LIGHT 3 - Lumière blanche régulière.
#TORCHLIT 1 - Scintillement. (Lourd)
#TORCHLIT 2 - Scintillement. (Lumière)
#==============================================================================
module LES
#The switch used to turn lights ON/OFF
#If the Switch is ON the lights turn OFF
#If the Switch is OFF the lights turn ON
SWITCHA = 1
SWITCHB = 2
end
#==============================================================================
# ¦ Spriteset_Map
#==============================================================================
class Spriteset_Map
alias les_spriteset_map_initalize initialize
def initialize
initialize_effects
les_spriteset_map_initalize
update
end
def initialize_effects
@light_effects_A = []
@light_effects_B = []
setup_lights
end
alias les_spriteset_map_dispose dispose
def dispose
les_spriteset_map_dispose
dispose_effects
end
def dispose_effects
for effect in @light_effects_A
effect.light.dispose
end
@light_effects_A = []
for effect in @light_effects_B
effect.light.dispose
end
@light_effects_B = []
end
alias les_spriteset_map_update update
def update
les_spriteset_map_update
update_light_effects_A
update_light_effects_B
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 == ["LIGHT 1"]
type = "LIGHT 1"
light_effects_A = Light_Effect_A.new(event,type)
light_effects_A.light.zoom_x = 2
light_effects_A.light.zoom_y = 2
light_effects_A.light.opacity = 100
@light_effects_A.push(light_effects_A)
end
if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT 2"]
type = "LIGHT 2"
light_effects_B = Light_Effect_B.new(event,type)
light_effects_B.light.zoom_x = 2
light_effects_B.light.zoom_y = 2
light_effects_B.light.opacity = 100
@light_effects_B.push(light_effects_B)
end
end
end
for effect in @light_effects_A
case effect.type
when "LIGHT 1"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
end
end
for effect in @light_effects_B
case effect.type
when "LIGHT 2"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
end
end
end #def setup_lights
def update_light_effects_A
if $game_switches[LES::SWITCHA]
for effect in @light_effects_A
effect.light.visible = false
end
else
for effect in @light_effects_A
effect.light.visible = true
end
end
for effect in @light_effects_A
case effect.type
when "LIGHT 1"
effect.light.x = effect.event.screen_x - 31
effect.light.y = effect.event.screen_y - 41
end
end
end #def update_light_effects
def update_light_effects_B
if $game_switches[LES::SWITCHB]
for effect in @light_effects_B
effect.light.visible = false
end
else
for effect in @light_effects_B
effect.light.visible = true
end
end
for effect in @light_effects_B
case effect.type
when "LIGHT 2"
effect.light.x = effect.event.screen_x - 31
effect.light.y = effect.event.screen_y - 41
end
end
end #def update_light_effects
end #class Spriteset_Map
#==============================================================================
# ¦ Light_Effect
#==============================================================================
class Light_Effect
attr_accessor :light
attr_accessor :event
attr_accessor :type
def initialize(event, type)
@light = Sprite.new
@light.bitmap = Cache.picture("le.png")
@light.visible = true
@light.z = 190
@event = event
@type = type
end
end #class Light_Effect
#==============================================================================
# ¦ Scene_Map
#==============================================================================
class Scene_Map
alias les_pre_transfer pre_transfer
def pre_transfer
les_pre_transfer
@spriteset.dispose_effects
end
alias les_post_transfer post_transfer
def post_transfer
@spriteset.initialize_effects
les_post_transfer
end
end #Scene_Map
#==============================================================================
# END OF FILE
#============================================================================== |
|
J'aime les shorts, ça garde les genoux bien au frais! |
arttroy -
posté le 26/09/2016 à 19:49:16 (2394 messages postés)
| Just working | Salut ^^ changes :
1
| light_effects_A = Light_Effect_A.new(event,type) |
par
1
| light_effects_A = Light_Effect.new(event,type) |
idem pour la ligne 100 (parce que tu vas avoir la même erreur) :
1
| light_effects_B = Light_Effect.new(event,type) |
Tu initie une variable qui découle d'une classe donc si tu change le nom de la classe le logiciel il aime pas ^^.
|
Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ? |
DeadPool98 -
posté le 28/09/2016 à 17:04:23 (47 messages postés)
| Je suis un carton... | Merci, merci, merci, merci, et je ne le redirais jamais assez MEEEERCI!!!
Voilà du coté de l'effet ce que ça peut donner une fois bien ajusté
et une dernière pour la route
Pas mal hein ![:bob](smileys/bob.gif)
|
J'aime les shorts, ça garde les genoux bien au frais! |
arttroy -
posté le 28/09/2016 à 17:06:51 (2394 messages postés)
| Just working | Content d'avoir pu t'aider bon courage pour la suite.
|
Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ? | Index du forum > Entraide > [RESOLU] [RPG Maker VX Ace] Problème avec le Script Autolight de Kylock
![up](interface/forum/up.jpg)
![](interface/titres/reprapide.jpg)
|
|
|