Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
639 connectés actuellement
30729216 visiteurs depuis l'ouverture
2833 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
❤ 0 Auteur : JmsPlDnl & Rataime
Logiciel : RPG Maker XP
Nombre de scripts : 1
Source : https://save-point.org/thread-2766.html
Installation
A placer au-dessus de Main.
Utilisation
Faites un évènement ayant comme commentaire :
- hero_r pour mettre le reflet du héros
- r pour mettre le reflet d'un évènement quelconque.
Pour afficher le reflet, allez dans la base de données et ensuite dans "gestion de chipset". Sélectionnez le tileset, cliquez sur "Terrain" et mettez "7" pour le carreau où vous voulez qu'il y est un reflet. Par exemple, mettez "7" sur le carreau représentant l'eau pour avoir un reflet dans l'eau.
Compatibilité
- Compatible avec le SDevelopment Kit.
- Compatible avec Train Actor system par fukuyama
- Compatible avec les SBABS et Squad Movement systems par Near Fantastica
- Compatible avec Ccoa's Caterpillar
- Compatible avec Trickster's Caterpillar.
Version modifiée (recommandée)
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
| #==============================================================================
# ** Sprite Reflection
#------------------------------------------------------------------------------
# Based on Sprite Mirror
# modified by JmsPlDnl
# rewritten entirely by Rataime
# New Edits by DerVVulfman
# February 12, 2013
#------------------------------------------------------------------------------
#
# Introduction:
# This system allows you and events to have their image reflected on various
# tagged surfaces.
#
#------------------------------------------------------------------------------
#
# Revisions to note:
#
# 1) Added formatted headers and comments throughout the script.
# 2) Compatability with Near Fantastica's Squad Movement systems.
# 3) Compatability with Ccoa's Caterpillar system.
# 4) Compatability with Trickster's Caterpillar system.
# 5) Added the REFLECT_TAG value into the configurables
# 6) Added REFLECT_EVENT and REFLECT_MAPS into configurables
# 7) Compatability with DerVVulfman's Lycan ABS.
#
#
#==============================================================================
#========================================================================
# ** C O N F I G U R A T I O N S Y S T E M ** #
#========================================================================
# Caterpillar Systems
CATERPILLAR_COMPATIBLE = true # Toggle for Fukuyama's original
SQUAD_MOVE_COMPATIBLE = false # Toggle for Near Fantastica's SBABS
CCOA_CATER_COMPATIBLE = false # Toggle for Ccoa's Caterpillar
TRICKSTER_CATER_COMPATIBLE = false # Toggle for Trickster's Caterpillar
LYCAN_ABS_COMPATIBLE = false # Toggle for DerVVulfman's Lycan ABS
# Reflection Comment in Events
REFLECT_EVENT = "hero_r" # Used in event that is reflected
# Reflection Specific Systems
REFLECT_TAG = 7 # Terrain tag used by reflective tiles
# Reflection Specific Maps
REFLECT_MAPS = [5] # IDs of Maps with reflective terrains
#========================================================================
# **** E N D O F C O N F I G U R A T I O N S Y S T E M **** #
#========================================================================
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :characters
end
#==============================================================================
# ** Sprite_Reflection
#------------------------------------------------------------------------------
# This sprite is used to position character reflection relative to map position.
# It observes the Game_Character class and automatically changes sprite
# conditions.
#==============================================================================
class Sprite_Reflection < RPG::Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :character
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
# character : character (Game_Character)
# self_angle : id
#--------------------------------------------------------------------------
def initialize(viewport=nil, character=nil, self_angle = 180)
super(viewport)
@character = character
@self_angle = self_angle
self.opacity = 0
@reflected = false
@former = false
@moving = false
if $game_map.terrain_tag(@character.real_x / 128,
@character.real_y / 128 + 1) == REFLECT_TAG
@reflected = true
@former = true
end
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If tile ID, file name, or hue are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# If tile ID value is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
sx = (@character.pattern) * @cw
sy = (@character.direction - 2) / 2 * @ch
sy = ( 4 - 2) / 2 * @ch if @character.direction == 6
sy = ( 6 - 2) / 2 * @ch if @character.direction== 4
if @character.direction != 4 and @character.direction != 6
sy = (@character.direction - 2) / 2 * @ch
end
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y-5
@moving =! (@character.real_x % 128 == 0 and @character.real_y % 128 == 0)
@d = @character.direction
@rect = [sx, sy, @cw, @ch]
if !(@moving)
if $game_map.terrain_tag(@character.real_x / 128,
@character.real_y / 128 + 1) == REFLECT_TAG
@reflected=true
@former=true
else
@reflected=false
@former=false
end
else
case @d
when 2
if $game_map.terrain_tag(@character.real_x / 128,
@character.real_y / 128 + 2) == REFLECT_TAG
@reflected=true
if @former == false
@offset = (@character.screen_y % 32) * @ch / 32
@rect = [sx, sy, @cw, @offset]
self.y = @character.screen_y - 5
end
else
@reflected = false
end
when 4
if $game_map.terrain_tag(@character.real_x / 128,
@character.real_y / 128 + 1) != REFLECT_TAG
@offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
@rect = [sx, sy, @offset, @ch]
self.x = @character.screen_x
else
@reflected = true
if @former == false
@offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
@rect = [sx + @offset, sy, @cw - @offset, @ch]
self.x = @character.screen_x - @offset
end
end
when 6
if $game_map.terrain_tag(@character.real_x / 128 + 1,
@character.real_y / 128 + 1) != REFLECT_TAG
@offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
@rect = [sx + @offset, sy, @cw - @offset, @ch]
self.x = @character.screen_x - @offset
else
@reflected = true
if @former == false
@offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
@rect = [sx, sy, @offset, @ch]
self.x = @character.screen_x
end
end
when 8
if $game_map.terrain_tag(@character.real_x / 128, @character.real_y / 128 + 2) == REFLECT_TAG
@reflected=true
if $game_map.terrain_tag(@character.real_x / 128, @character.real_y / 128 + 1) != REFLECT_TAG
@offset = (@character.screen_y%32)*@ch/32
@rect=[sx, sy, @cw, @offset]
self.y=@character.screen_y-5
end
else
@reflected=false
end
end
end
if @reflected
self.opacity=128
else
@rect=[sx, sy, @cw, @ch]
self.opacity=0
end
if $game_map.terrain_tag((@character.real_x + 64) / 128, @character.real_y / 128 + 2) != REFLECT_TAG
if $game_map.terrain_tag((@character.real_x + 64) / 128, @character.real_y / 128 + 2) != REFLECT_TAG
@rect[1]= @rect[1]+@ch/2
@rect[3]= @rect[3]/2
self.y = self.y - @ch/2
else
@reflected=false
end
end
self.src_rect.set(@rect[0],@rect[1],@rect[2],@rect[3])
@character.is_a?(Game_Player) ? self.z = 9 : self.z = 5
# Set opacity level, blend method, and bush depth
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
self.angle = @self_angle
end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display the character.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias reflect_initialize initialize
alias reflect_update update
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
# character : character (Game_Character)
#--------------------------------------------------------------------------
def initialize(viewport, character = nil)
@character = character
@reflection = []
super(viewport)
# Perform for Reflective Maps
if REFLECT_MAPS.include?($game_map.map_id)
# Initialize the Player
init_char_reflect(character, viewport, Game_Player)
# Initialize based on caterpillar / ABS
init_char_reflect(character, viewport, Game_Party_Actor) if CATERPILLAR_COMPATIBLE
init_char_reflect(character, viewport, Game_Ally) if SQUAD_MOVE_COMPATIBLE
init_char_reflect(character, viewport, Game_TrainActor) if CCOA_CATER_COMPATIBLE
init_char_reflect(character, viewport, Game_Follower) if TRICKSTER_CATER_COMPATIBLE
init_char_reflect(character, viewport, Game_ABS_Companion) if LYCAN_ABS_COMPATIBLE
# Any additional reflected sprites
if (character.is_a?(Game_Event) and character.list != nil and
character.list[0].code == 108 and
character.list[0].parameters == [REFLECT_EVENT])
init_char_reflect(character, viewport, Game_Event)
end
end
# Perform the original call
reflect_initialize(viewport, @character)
end
#--------------------------------------------------------------------------
# * Initialize Character Reflection Effect
# character : character (Game_Character)
# viewport : viewport
# char_class : type of character to test
#--------------------------------------------------------------------------
def init_char_reflect(character, viewport, char_class)
if character.is_a?(char_class)
@reflection.push(Sprite_Reflection.new(viewport, character))
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
reflect_update
if @reflection != nil
for reflect in @reflection
reflect.update
end
end
end
end |
Original (archive)
Spoiler (cliquez pour afficher)
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
| #==============================================================================
# ■ Sprite_Reflection
# Based on Sprite_Mirror, Modified By: JmsPlDnl, rewritten entirely by Rataime
#==============================================================================
CATERPILLAR_COMPATIBLE = true
class Game_Party
attr_reader :characters
end
class Sprite_Reflection < RPG::Sprite
attr_accessor :character
def initialize(viewport=nil, character=nil,self_angle = 180)
super(viewport)
@character = character
@self_angle=self_angle
self.opacity=0
@reflected=false
@former=false
@moving=false
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)==7
@reflected=true
@former=true
end
update
end
def update
super
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
self.visible = (not @character.transparent)
if @tile_id == 0
sx = (@character.pattern) * @cw
sy = (@character.direction - 2) / 2 * @ch
if @character.direction== 6
sy = ( 4- 2) / 2 * @ch
end
if @character.direction== 4
sy = ( 6- 2) / 2 * @ch
end
if @character.direction != 4 and @character.direction != 6
sy = (@character.direction - 2) / 2 * @ch
end
end
self.x = @character.screen_x
self.y = @character.screen_y-5
@moving=!(@character.real_x%128==0 and @character.real_y%128==0)
@d=@character.direction
@rect=[sx, sy, @cw, @ch]
if !(@moving)
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)==7
@reflected=true
@former=true
else
@reflected=false
@former=false
end
else
case @d
when 2
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+2)==7
@reflected=true
if @former==false
@offset = (@character.screen_y%32)*@ch/32
@rect=[sx, sy, @cw, @offset]
self.y=@character.screen_y-5
end
else
@reflected=false
end
when 4
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)!=7
@offset = ((@character.screen_x-@cw/2)%32)*@cw/32
@rect=[sx, sy, @offset, @ch]
self.x=@character.screen_x
else
@reflected=true
if @former==false
@offset = ((@character.screen_x-@cw/2)%32)*@cw/32
@rect=[sx+@offset, sy, @cw-@offset, @ch]
self.x=@character.screen_x-@offset
end
end
when 6
if $game_map.terrain_tag(@character.real_x/128+1,@character.real_y/128+1)!=7
@offset = ((@character.screen_x-@cw/2)%32)*@cw/32
@rect=[sx+@offset, sy, @cw-@offset, @ch]
self.x=@character.screen_x-@offset
else
@reflected=true
if @former==false
@offset = ((@character.screen_x-@cw/2)%32)*@cw/32
@rect=[sx, sy, @offset, @ch]
self.x=@character.screen_x
end
end
when 8
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+2)==7
@reflected=true
if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)!=7
@offset = (@character.screen_y%32)*@ch/32
@rect=[sx, sy, @cw, @offset]
self.y=@character.screen_y-5
end
else
@reflected=false
end
end
end
if @reflected
self.opacity=128
else
@rect=[sx, sy, @cw, @ch]
self.opacity=0
end
if $game_map.terrain_tag((@character.real_x+64)/128,@character.real_y/128+2)!=7
if $game_map.terrain_tag((@character.real_x+64)/128,@character.real_y/128+2)!=7
@rect[1]= @rect[1]+@ch/2
@rect[3]= @rect[3]/2
self.y = self.y - @ch/2
else
@reflected=false
end
end
self.src_rect.set(@rect[0],@rect[1],@rect[2],@rect[3])
@character.is_a?(Game_Player) ? self.z = 9 : self.z = 5
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
self.angle = @self_angle
end
end
#===================================================
# ▼ CLASS Sprite_Character edit
#===================================================
class Sprite_Character < RPG::Sprite
alias reflect_initialize initialize
def initialize(viewport, character = nil)
@character = character
@reflection = []
super(viewport)
if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["r"]
@reflection.push(Sprite_Reflection.new(viewport,@character))
end
if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["hero_r"]
@reflection.push(Sprite_Reflection.new(viewport,$game_player))
#===================================================
# ● Compatibility with fukuyama's caterpillar script
#===================================================
if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
for member in $game_party.characters
@reflection.push(Sprite_Reflection.new(viewport,member))
end
end
#===================================================
# ● End of the compatibility
#===================================================
end
reflect_initialize(viewport, @character)
end
alias reflect_update update
def update
reflect_update
if @reflection!=nil
for reflect in @reflection
reflect.update
end
end
end
end |
La démo
Mis à jour le 11 juillet 2020.
|
Samelio Navar -
posté le 07/01/2009 à 14:45:25 (2 messages postés)
| rpgmakeur | moi j'ai eu ce script par un autre site et il est bien pas de bug et tout et tou mais une seule chose que je trouve dommage c'est ( roulement de tambour ^^ ) des reflet sur le sol par exemple sur un pont qui passe au dessus un cour d'eau qui est sur la première couche il y a quand même un reflet qui se projette sur le pont ( comme si le pont etait lustré par des lutin qui sont venu la nuit ^^ mais bon pour une map on peut ne pas mettre de reflet
Sinon bon script a essayer
ps: faite la même chose pour la glace sa donne super bien enfin a mon avis vous avez tous eu la même idée
|
Amicalement Samelio |
Nanaya -
posté le 12/12/2010 à 21:44:42 (1 messages postés)
| | Bonsoir,
J'ai testé ce script avec RMXP Delta, en essayant de mettre tout comme indiqué (et plus : event en processus para., priorité 1 pour le tilset, 7 pour comme chiffre, ...).
Rien à faire, ça ne marche pas, le jeu se lance, y a pas de bug, mais pas non plus de reflet, et mes connaissance en ruby/rgss sont trop faible pour y remédier, quelqu'un pourrait-il m'aider svp ?
Bien à vous,
Nanaya
|
| J'aime les trains. | Et une syntax error, une !
|
Que Dieu vous garde, j'ai plus de place chez moi ... | |
|
|