❤ 0 Auteur : f1rstone
Logiciel : RPG Maker VX Ace
Nombre de scripts : 2
Ce script vous permet de lancer une vidéo ou une animation à partir d'une série d'image à condition de les numéroter dans le bon ordre. L'avantage par rapport à Scene_Movie est que grâce au format png, vous pourriez gérer la transparence et vous n'auriez pas à entrer les images une par une comme dans le mode event.
Voici la démo : Télécharger (Archive)
Voici la procédure que vous devez suivre afin de l'adapter à votre jeu :
**Remplacez Scene_Map par ceci :
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
| #==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
$game_player.straighten
$game_map.refresh
$game_message.visible = false
create_spriteset
create_all_windows
@menu_calling = false
end
#--------------------------------------------------------------------------
# * Execute Transition
# Performs a fade in when the screen has been blacked out, such as
# immediately after a battle or load.
#--------------------------------------------------------------------------
def perform_transition
if Graphics.brightness == 0
Graphics.transition(0)
fadein(fadein_speed)
else
super
end
end
#--------------------------------------------------------------------------
# * Get Transition Speed
#--------------------------------------------------------------------------
def transition_speed
return 15
end
#--------------------------------------------------------------------------
# * Pre-Termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
pre_battle_scene if SceneManager.scene_is?(Scene_Battle)
pre_title_scene if SceneManager.scene_is?(Scene_Title)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
dispose_spriteset
perform_battle_transition if SceneManager.scene_is?(Scene_Battle)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if $game_switches[20] == true
$scene = Sequence_Images.new
else
if $fin_de_la_sequence ==true
$image.dispose
$fin_de_la_sequence = false
end
end
super
$game_map.update(true)
$game_player.update
$game_timer.update
@spriteset.update
update_scene if scene_change_ok?
end
#--------------------------------------------------------------------------
# * Determine if Scene Transition Is Possible
#--------------------------------------------------------------------------
def scene_change_ok?
!$game_message.busy? && !$game_message.visible
end
#--------------------------------------------------------------------------
# * Update Scene Transition
#--------------------------------------------------------------------------
def update_scene
check_gameover
update_transfer_player unless scene_changing?
update_encounter unless scene_changing?
update_call_menu unless scene_changing?
update_call_debug unless scene_changing?
end
#--------------------------------------------------------------------------
# * Update Frame (for Fade In)
#--------------------------------------------------------------------------
def update_for_fade
update_basic
$game_map.update(false)
@spriteset.update
end
#--------------------------------------------------------------------------
# * General-Purpose Fade Processing
#--------------------------------------------------------------------------
def fade_loop(duration)
duration.times do |i|
yield 255 * (i + 1) / duration
update_for_fade
end
end
#--------------------------------------------------------------------------
# * Fadein Screen
#--------------------------------------------------------------------------
def fadein(duration)
fade_loop(duration) {|v| Graphics.brightness = v }
end
#--------------------------------------------------------------------------
# * Fadeout Screen
#--------------------------------------------------------------------------
def fadeout(duration)
fade_loop(duration) {|v| Graphics.brightness = 255 - v }
end
#--------------------------------------------------------------------------
# * Screen Fade In (White)
#--------------------------------------------------------------------------
def white_fadein(duration)
fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, 255 - v) }
end
#--------------------------------------------------------------------------
# * Screen Fade Out (White)
#--------------------------------------------------------------------------
def white_fadeout(duration)
fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, v) }
end
#--------------------------------------------------------------------------
# * Create Sprite Set
#--------------------------------------------------------------------------
def create_spriteset
@spriteset = Spriteset_Map.new
end
#--------------------------------------------------------------------------
# * Free Sprite Set
#--------------------------------------------------------------------------
def dispose_spriteset
@spriteset.dispose
end
#--------------------------------------------------------------------------
# * Create All Windows
#--------------------------------------------------------------------------
def create_all_windows
create_message_window
create_scroll_text_window
create_location_window
end
#--------------------------------------------------------------------------
# * Create Message Window
#--------------------------------------------------------------------------
def create_message_window
@message_window = Window_Message.new
end
#--------------------------------------------------------------------------
# * Create Scrolling Text Window
#--------------------------------------------------------------------------
def create_scroll_text_window
@scroll_text_window = Window_ScrollText.new
end
#--------------------------------------------------------------------------
# * Create Map Name Window
#--------------------------------------------------------------------------
def create_location_window
@map_name_window = Window_MapName.new
end
#--------------------------------------------------------------------------
# * Update Player Transfer
#--------------------------------------------------------------------------
def update_transfer_player
perform_transfer if $game_player.transfer?
end
#--------------------------------------------------------------------------
# * Update Encounter
#--------------------------------------------------------------------------
def update_encounter
SceneManager.call(Scene_Battle) if $game_player.encounter
end
#--------------------------------------------------------------------------
# * Determine if Menu is Called due to Cancel Button
#--------------------------------------------------------------------------
def update_call_menu
if $game_system.menu_disabled || $game_map.interpreter.running?
@menu_calling = false
else
@menu_calling ||= Input.trigger?(:B)
call_menu if @menu_calling && !$game_player.moving?
end
end
#--------------------------------------------------------------------------
# * Call Menu Screen
#--------------------------------------------------------------------------
def call_menu
Sound.play_ok
SceneManager.call(Scene_Menu)
Window_MenuCommand::init_command_position
end
#--------------------------------------------------------------------------
# * Determine if Debug Call by F9 key
#--------------------------------------------------------------------------
def update_call_debug
SceneManager.call(Scene_Debug) if $TEST && Input.press?(:F9)
end
#--------------------------------------------------------------------------
# * Player Transfer Processing
#--------------------------------------------------------------------------
def perform_transfer
pre_transfer
$game_player.perform_transfer
post_transfer
end
#--------------------------------------------------------------------------
# * Preprocessing for Transferring Player
#--------------------------------------------------------------------------
def pre_transfer
@map_name_window.close
case $game_temp.fade_type
when 0
fadeout(fadeout_speed)
when 1
white_fadeout(fadeout_speed)
end
end
#--------------------------------------------------------------------------
# * Post Processing for Transferring Player
#--------------------------------------------------------------------------
def post_transfer
case $game_temp.fade_type
when 0
Graphics.wait(fadein_speed / 2)
fadein(fadein_speed)
when 1
Graphics.wait(fadein_speed / 2)
white_fadein(fadein_speed)
end
@map_name_window.open
end
#--------------------------------------------------------------------------
# * Preprocessing for Battle Screen Transition
#--------------------------------------------------------------------------
def pre_battle_scene
Graphics.update
Graphics.freeze
@spriteset.dispose_characters
BattleManager.save_bgm_and_bgs
BattleManager.play_battle_bgm
Sound.play_battle_start
end
#--------------------------------------------------------------------------
# * Preprocessing for Title Screen Transition
#--------------------------------------------------------------------------
def pre_title_scene
fadeout(fadeout_speed_to_title)
end
#--------------------------------------------------------------------------
# * Execute Pre-Battle Transition
#--------------------------------------------------------------------------
def perform_battle_transition
Graphics.transition(60, "Graphics/System/BattleStart", 100)
Graphics.freeze
end
#--------------------------------------------------------------------------
# * Get Fade Out Speed
#--------------------------------------------------------------------------
def fadeout_speed
return 30
end
#--------------------------------------------------------------------------
# * Get Fade In Speed
#--------------------------------------------------------------------------
def fadein_speed
return 30
end
#--------------------------------------------------------------------------
# * Get Fade Out Speed for Title Screen Transition
#--------------------------------------------------------------------------
def fadeout_speed_to_title
return 60
end
end |
**Puis insérez un nouveau script au dessus de main et nommez-le : Sequence_Images
et mettez ceci:
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
| #==============================================================================
# ** Nom du script : Sequence_Image
#------------------------------------------------------------------------------
# Créé par : f1rstone
# Version : 1.0
# Date de création : 2014-10-31
# Support : Rpg maker VX ACE
# Description : Ce script permet de transformer une série d'image en une animation.
#==============================================================================
#--------------------------------------------------------------------------
# * Remplacez "" par "Titre du fichier" (sans le numéro ni son extension)
#--------------------------------------------------------------------------
$titre_de_la_sequence = ""
#--------------------------------------------------------------------------
# * Modifie la longueur de la trame
#--------------------------------------------------------------------------
$numero_image_debut = 0
$numero_image_fin = 80
#--------------------------------------------------------------------------
# * Une vitesse < 1 ralentit la séquence et >1 l'accélère
#--------------------------------------------------------------------------
$vitesse_de_lecture = 0.2
#--------------------------------------------------------------------------
# * Active le suiveur d'écran
#--------------------------------------------------------------------------
$animation_sur_ecran = false
#--------------------------------------------------------------------------
# * Active la lecture en boucle
#--------------------------------------------------------------------------
$boucle = true
#--------------------------------------------------------------------------
# * Modifie les coordonées
#--------------------------------------------------------------------------
$animation_x=360
$animation_y=260
$animation_z=2
class Sequence_Images
def initialize
Graphics.transition
$image = Sprite.new
#--------------------------------------------------------------------------
# * Divers paramètres
#--------------------------------------------------------------------------
$image.zoom_x= 1
$image.zoom_y= 1
$image.opacity = 255
#--------------------------------------------------------------------------
update
end
def update
$image.bitmap = Cache.picture($titre_de_la_sequence.to_s + ($numero_image_debut.to_i).to_s)
if $animation_sur_ecran == false
$image.x = $animation_x - $game_map.display_x*32
$image.y = $animation_y - $game_map.display_y*32
else
$image.x = $animation_x
$image.y = $animation_y
end
$image.z = $animation_z
if $numero_image_debut < $numero_image_fin
Cache.clear
$numero_image_debut += $vitesse_de_lecture
else
if $boucle == false
$fin_de_la_sequence=true
$game_switches[20] == false
$image.dispose
else
$numero_image_debut = 1
end
end
$fin_de_la_sequence=true
end
end |
**Mettez vos images dans le dossier pictures de votre jeu et numérotez les dans l'ordre croissant comme ceci: nom_du_fichiernuméro : par exemple: image1 ; image2 ; image3 ...etc
**Enfin suivez les instructions et paramétrez Sequence_Images en fonction de vos préférences.
Si vous n'avez pas encore de séquence d'image prète, téléchargez la démo pour vous familiarisez avec ce script.
Mis à jour le 21 novembre 2020.
|