[RPG-MAKER.FR] Oniromancie: tout l'univers de RPG Maker en français - Scripts - Neo Save System

Oniromancie: Scripts - Neo Save System


Découvrir
RPG Maker

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

Apprendre
RPG Maker

Guides
Tutoriels
Astuces
Making-of


Comment ça marche?

Aëdemphia
Par Sylvanor

Fighting Robots Quest
Par Boulon

Geex
Par roys

Inexistence
Par Falco

La Légende d'Ibabou
Par Zaitan

Nylu
Par NanakyTim

Sarcia
Par Kaëlar

Super Mario RPG - Lost Souls
Par Omegabowser

News: Game design: ouvrir son jeu aux (...) / News: Des jeux et des screens / News: Alex 2019 : tests et nominations (...) / Jeux: Wendy Whedon / Sorties: Wendy Whedon /

Chat  

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

128 connectés actuellement

10212677 visiteurs
depuis l'ouverture

1132 visiteurs
aujourd'hui

Groupe Facebook

Barre de séparation

Partenaires






TOP
GAMEMAKING


Les 5 plus
visités

Akademiya RPG Maker

Alex d'Or

Blog of Chaos17

BloGecko

ConsoleFun

Au hasard

RitoJS Blog

Leo-Games

Le Studio du Chat Vert

Les deux derniers

Zarok

Akademiya RPG Maker

Nos autres partenaires

Devenir
partenaire


Barre de séparation

Un site du réseau
War Paradise

Annuaires référenceurs




Neo Save System
Script pour RPG Maker VX
Ecrit par cari974

Réécriture partielle du Neo Save System de Wortana par Zangther et "inconnu".
L'avantage c'est qu'il ne dépend plus de DLL pour les captures d'écran et ne prend plus "parfois" le menu en screen.
Ce script a été modifié durant le "Pimp My Code" de VX bbActif.


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
 
#==========================================================================
# ● [VX] â—[ Neo Save System V â—[ □
#---------------------------------------------------------------------------
# â—[ Author: Woratana [woratana@hotmail.com], Zangther, Grim
# â—[ Thaiware RPG Maker Community
#    <a href="http://rpg-maker-vx.bbactif.com/" target="_blank">http://rpg-maker-vx.bbactif.com/</a> and <a href="http://funkywork.blogspot.com" target="_blank">http://funkywork.blogspot.com</a>
# â—[ Last Updated:
# â—[ Version: BBActif
 
#---------------------------------------------------------------------------
# â—[ Log 1:
# No DLL required (New Version)
#===========================================================================
 
#==============================================================================
# ** Wora_NSS
#------------------------------------------------------------------------------
#  Configruation
#==============================================================================
 
module Wora_NSS
  #==========================================================================
  # * START NEO SAVE SYSTEM - SETUP
  #--------------------------------------------------------------------------
  NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest)
 
  # If this is true then the scene will not change when you save the game
  SCENE_CHANGE = true  # Changes Scene to map if true
 
  MAX_SAVE_SLOT = 20 # Max save slots
  SLOT_NAME = 'SLOT {id}'
  # Name of the slot (show in save slots list), use {id} for slot ID
  SAVE_FILE_NAME = 'Save{id}.rvdata'
  # Save file name, you can also change its file type from .rvdata to other
 
  # Use {id} for save slot ID
  SAVE_PATH = '' # Path to store save file, e.g. 'Save/' or '' (for game folder)
  SAVED_SLOT_ICON = 133 # Icon Index for saved slot
  EMPTY_SLOT_ICON = 141 # Icon Index for empty slot
  EMPTY_SLOT_TEXT = 'Vide' # Text to show for empty slot's data
 
  DRAW_GOLD = true # Draw Gold
  DRAW_PLAYTIME = true # Draw Playtime
  DRAW_LOCATION = true # Draw location
  DRAW_FACE = true # Draw Actor's face
  DRAW_LEVEL = true # Draw Actor's level
  DRAW_NAME = true # Draw Actor's name
 
  PLAYTIME_TEXT = 'Temps de jeu: ' 
  LOCATION_TEXT = 'Localisation: '
  LV_TEXT = 'Lv. '
 
  MAP_NAME_TEXT_SUB = %w{}
  # Text that you want to remove from map name,
  # e.g. %w{[LN] [DA]} will remove text '[LN]' and '[DA]' from map name
  MAP_NO_NAME_LIST = [] # ID of Map that will not show map name, e.g. [1,2,3]
  MAP_NO_NAME = '???' # What you will use to call the map in the no name list
 
  # This is a switch that can activate or deactivate maps from being displayed as
  # MAP_NO_NAME. If it is off then maps will return back to normal.
  MAP_NO_NAME_SWITCH = 95 # This switch has to be on for MAP_NO_NAME_LIST to work
 
  MAP_BORDER = Color.new(0,0,0,200) # Map image border color (R,G,B,Opacity)
  FACE_BORDER = Color.new(0,0,0,200) # Face border color
 
  # Save confirmation window
  SFC_Text_Confirm = 'Confirmer' # Text to confirm to save file
  SFC_Text_Cancel = 'Annuler' # Text to cancel to save
  SFC_Window_Width = 200 # Width of Confirmation Window
  SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally
  SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically
 
  #-------------------------------------------------------------------------
  # END NEO SAVE SYSTEM - SETUP (Edit below at your own risk)
  #=========================================================================
 
end
 
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs common processing for the save screen and load screen.
#==============================================================================
 
class Scene_File
  #-------------------------------------------------------------------------
  # * Public instance variable
  #-------------------------------------------------------------------------
  attr_reader :window_slotdetail
  #-------------------------------------------------------------------------
  # * Alias
  #-------------------------------------------------------------------------
  alias old_write_save_data write_save_data
  #-------------------------------------------------------------------------
  # * Start processing
  #-------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @data = {}
    create_windows
    # Create Folder for Save file if needed
    if Wora_NSS::SAVE_PATH != '' && !FileTest.directory?(Wora_NSS::SAVE_PATH)
      Dir.mkdir(Wora_NSS::SAVE_PATH)
    end
  end
  #-------------------------------------------------------------------------
  # * Create the windows
  #-------------------------------------------------------------------------
  def create_windows
    # Help Window
    @help_window = Window_Help.new
    @help_window.set_text(@saving ? Vocab::SaveMessage : Vocab::LoadMessage)
    @help_window.opacity = Wora_NSS::NSS_WINDOW_OPACITY
    # Detail Window
    @window_slotdetail = Window_NSS_SlotDetail.new(160, 56, 384, 360)
    # Slots Window
    commands = []
    1.upto(Wora_NSS::MAX_SAVE_SLOT) do |num|
      commands << Wora_NSS::SLOT_NAME.gsub(/\{ID\}/i) { num.to_s }
    end
    y = @help_window.height
    height = Graphics.height - y
    @window_slotlist = Window_SlotList.new(0, y, 160, height, commands)
    @window_slotlist.commands.each_index do |index|
      file_exist = FileTest.exist?(make_filename(index + 1))
      if file_exist
        load_display_data(index + 1)
      else
        set_empty_state(index + 1)
        @window_slotlist.draw_item(index, file_exist)
      end
    end
    # Confirmation Window
    text1 = Wora_NSS::SFC_Text_Confirm
    text2 = Wora_NSS::SFC_Text_Cancel
    @confirm_window = Window_Command.new(Wora_NSS::SFC_Window_Width,[text1,text2])
    @confirm_window.x = ((544 - @confirm_window.width) / 2) + Wora_NSS::SFC_Window_X_Offset
    @confirm_window.y = ((416 - @confirm_window.height) / 2) + Wora_NSS::SFC_Window_Y_Offset
    @confirm_window.visible = @confirm_window.active = false
    # Starting with an non existant previous index
    @index = -1
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @window_slotlist.dispose
    @window_slotdetail.dispose
    @help_window.dispose
    @confirm_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if @confirm_window.active
      @confirm_window.update
      update_confirm_selection
    else
      @window_slotlist.update
      update_savefile_selection
      if slot_index != @index
        if @data[slot_index]['state'] == :present
          @window_slotdetail.draw_data(@data[slot_index])
        else
          @window_slotdetail.draw_empty
        end
        @index = slot_index
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      if @saving && FileTest.exist?(make_filename(slot_index))
        @confirm_window.visible = @confirm_window.active = true
        Sound.play_decision
      else
        determine_savefile
      end
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_confirm_selection
    if Input.trigger?(Input::C) || Input.trigger?(Input::B)
      if Input.trigger?(Input::C) && @confirm_window.index == 0
        Sound.play_decision
        determine_savefile
      else
        Sound.play_cancel
      end
      @confirm_window.visible = @confirm_window.active = false
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Save
  #--------------------------------------------------------------------------
  def do_save
    $game_temp.last_file_index = slot_index - 1
    File.open(make_filename(slot_index), "wb") do |file|
      write_save_data(file)
    end
    if Wora_NSS::SCENE_CHANGE
      $scene = Scene_Map.new
    else
      $scene = Scene_File.new(true, false, false)
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
    File.open(make_filename(slot_index), "rb") do |file|
      read_save_data(file)
    end
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if FileTest.exist?(make_filename(slot_index))
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Make Filename
  #    file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { file_index.to_s }
  end
  #--------------------------------------------------------------------------
  # * Write Save Data
  #    file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    old_write_save_data(file)
    Marshal.dump($game_temp.screenshot,        file)
  end
  #--------------------------------------------------------------------------
  # Slot Index
  #--------------------------------------------------------------------------
  def slot_index
    @window_slotlist.index + 1
  end
  #--------------------------------------------------------------------------
  # Set empty statev for slot
  #--------------------------------------------------------------------------
  def set_empty_state(slot_id)
    @data[slot_id] = { 'state' => :empty }
  end
  #--------------------------------------------------------------------------
  # Load data that will be displayed
  #--------------------------------------------------------------------------
  def load_display_data(slot_id)
    unless @data.has_key?(slot_id)
      @data[slot_id] = { 'state' => :present }
      file_name = make_filename(slot_id)
      # Start load data
      File.open(file_name, "r") do |file|
        @data[slot_id]['time'] = file.mtime
        @data[slot_id]['char'] = Marshal.load(file)
        @data[slot_id]['frame'] = Marshal.load(file)
        @data[slot_id]['last_bgm'] = Marshal.load(file)
        @data[slot_id]['last_bgs'] = Marshal.load(file)
        @data[slot_id]['gamesys'] = Marshal.load(file)
        @data[slot_id]['gamemes'] = Marshal.load(file)
        @data[slot_id]['gameswi'] = Marshal.load(file)
        @data[slot_id]['gamevar'] = Marshal.load(file)
        @data[slot_id]['gameselfvar'] = Marshal.load(file)
        @data[slot_id]['gameactor'] = Marshal.load(file)
        @data[slot_id]['gamepar'] = Marshal.load(file)
        @data[slot_id]['gametro'] = Marshal.load(file)
        @data[slot_id]['gamemap'] = Marshal.load(file)
        @data[slot_id]['player'] = Marshal.load(file)
        @data[slot_id]['screenshot'] = Marshal.load(file)
        @data[slot_id]['total_sec'] = @data[slot_id]['frame'] / Graphics.frame_rate
        @data[slot_id]['map_name'] = get_mapname(@data[slot_id]['gamemap'].map_id)
      end
    end
  end
  #-------------------------------------------------------------------------
  # * Get the Map name
  #-------------------------------------------------------------------------
  def get_mapname(map_id)
    @map_data ||= load_data("Data/MapInfos.rvdata")
    if Wora_NSS::MAP_NO_NAME_LIST.include?(map_id) && $game_switches[MAP_NO_NAME_SWITCH]
      map_name = MAP_NO_NAME
    else
      map_name = @map_data[map_id].name
    end
    Wora_NSS::MAP_NAME_TEXT_SUB.each_index do |i|
      map_name.sub!(MAP_NAME_TEXT_SUB[i], '')
    end
    map_name
  end
end
 
 
#==============================================================================
# ** Window_SlotList
#------------------------------------------------------------------------------
#  Define a Save Slot List
#==============================================================================
class Window_SlotList < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height, commands)
    super(width.to_i, commands)
    self.x = x.to_i
    self.y = y.to_i
    self.height = height.to_i
    self.opacity = Wora_NSS::NSS_WINDOW_OPACITY
    @index = $game_temp.last_file_index
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    icon_index = enabled ? Wora_NSS::SAVED_SLOT_ICON :  Wora_NSS::EMPTY_SLOT_ICON
    draw_icon(icon_index, rect.x, rect.y, enabled) # Draw Icon
    rect.x += 26
    rect.width -= 20
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index])
  end
end
 
#==============================================================================
# ** Window_SlotList
#------------------------------------------------------------------------------
#  Define a Save Slot detail
#==============================================================================
 
class Window_NSS_SlotDetail < Window_Base
  #-------------------------------------------------------------------------
  # * Object initialisation
  #-------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
  end
  #-------------------------------------------------------------------------
  # * Draw empty slot content
  #-------------------------------------------------------------------------
  def draw_empty
    contents.clear
    contents.draw_text(0,0, contents.width, contents.height - WLH, Wora_NSS::EMPTY_SLOT_TEXT, 1)
  end
  #-------------------------------------------------------------------------
  # * Draw data in a slot
  #-------------------------------------------------------------------------
  def draw_data(data)
    contents.clear
    draw_screenshot(data['screenshot'])
    draw_gold(data['gamepar'].gold) if Wora_NSS::DRAW_GOLD
    draw_playtime(data['total_sec']) if Wora_NSS::DRAW_PLAYTIME
    draw_location(data['map_name']) if Wora_NSS::DRAW_LOCATION
    draw_actor_data(data['gamepar'].members)
  end
  #-------------------------------------------------------------------------
  # * Draw Screenshot
  #-------------------------------------------------------------------------
  def draw_screenshot(screenshot)
    inside_rect = Rect.new(0, 30, 352, 160)
    width = inside_rect.width - 4
    height = inside_rect.height - 4
    x = (Graphics.width - width) / 2
    y = (Graphics.height - height) / 2
    screenshot_rect = Rect.new(x, y, width, height)
    contents.fill_rect(inside_rect, Wora_NSS::MAP_BORDER)
    contents.blt(2, 32, screenshot, screenshot_rect)
  end
  #-------------------------------------------------------------------------
  # * Draw gold value
  #-------------------------------------------------------------------------
  def draw_gold(gold)
    contents.font.color = system_color
    contents.draw_text(0, 0, 150, WLH, Vocab::gold)
    contents.font.color = normal_color
    contents.draw_text(0, 0, 125, WLH, gold, 2)
  end
  #-------------------------------------------------------------------------
  # * Draw playtime
  #-------------------------------------------------------------------------
  def draw_playtime(time)
    hour = time / 60 / 60
    min = time / 60 % 60
    sec = time % 60
    time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
    pt_textsize = contents.text_size(Wora_NSS::PLAYTIME_TEXT).width
    ts_textsize = contents.text_size(time_string).width
    contents.font.color = system_color
    contents.draw_text(contents.width - ts_textsize - pt_textsize, 0,
    pt_textsize, WLH, Wora_NSS::PLAYTIME_TEXT)
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
  end
  #-------------------------------------------------------------------------
  # * Draw location
  #-------------------------------------------------------------------------
  def draw_location(mapname)
    lc_textsize = contents.text_size(Wora_NSS::LOCATION_TEXT).width
    mn_textsize = contents.text_size(mapname).width
    contents.font.color = system_color
    contents.draw_text(0, 190, contents.width, WLH, Wora_NSS::LOCATION_TEXT)
    contents.font.color = normal_color
    contents.draw_text(lc_textsize, 190, contents.width, WLH, mapname)
  end
  #-------------------------------------------------------------------------
  # * Draw actors' data
  #-------------------------------------------------------------------------
  def draw_actor_data(actors)
    actors.each_index do |i|
      actor = actors[i]
      face_x_base = (i*80) + (i*8)
      face_y_base = 216
      lvn_y_plus = 10
      lv_textsize = contents.text_size(actor.level).width
      lvt_textsize = contents.text_size(Wora_NSS::LV_TEXT).width
      if Wora_NSS::DRAW_FACE
        # Draw Face
        contents.fill_rect(face_x_base, face_y_base, 84, 84, Wora_NSS::FACE_BORDER)
        draw_face(actor.face_name, actor.face_index, face_x_base + 2,
        face_y_base + 2, 80)
      end
      if Wora_NSS::DRAW_LEVEL
        # Draw Level
        contents.font.color = system_color
        contents.draw_text(face_x_base + 2 + 80 - lv_textsize - lvt_textsize,
        face_y_base + 2 + 80 - WLH + lvn_y_plus, lvt_textsize, WLH, Wora_NSS::LV_TEXT)
        contents.font.color = normal_color
        contents.draw_text(face_x_base + 2 + 80 - lv_textsize,
        face_y_base + 2 + 80 - WLH + lvn_y_plus, lv_textsize, WLH, actor.level)
      end
      if Wora_NSS::DRAW_NAME
        # Draw Name
        contents.draw_text(face_x_base, face_y_base + 2 + 80 + lvn_y_plus - 6, 84,
        WLH, actor.name, 1)
      end
    end
  end
 
end
 
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================
 
class Scene_Title
  #-------------------------------------------------------------------------
  # * Check "continue" state
  #-------------------------------------------------------------------------
  def check_continue
    file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' }
    @continue_enabled = (Dir.glob(file_name).size > 0)
  end
end
 
#==============================================================================
# ** Marshal implementations in Font & Bitmap.
#------------------------------------------------------------------------------
#  Writed by Yeyinde
#  Improved by Grim (FunkyWork)
#==============================================================================
class Font
  def marshal_dump;end
  def marshal_load(obj);end
end
 
class Bitmap
  #--------------------------------------------------------------------------
  # * Win32API
  #--------------------------------------------------------------------------
  @@RtlMoveMemorySave = Win32API.new('kernel32','RtlMoveMemory','pii','i')
  @@RtlMoveMemoryLoad = Win32API.new('kernel32','RtlMoveMemory','ipi','i')
  #--------------------------------------------------------------------------
  # * Marshall dump
  #--------------------------------------------------------------------------
  def _dump(limit)
    data = "rgba"*width*height
    @@RtlMoveMemorySave.call(data,address,data.length)
    [width,height,Zlib::Deflate.deflate(data)].pack("LLa*")
  end
 
  #--------------------------------------------------------------------------
  # * Marshall load
  #--------------------------------------------------------------------------
  def self._load(str)
    w,h,zdata = str.unpack("LLa*")
    bitmap = new(w,h)
    @@RtlMoveMemoryLoad.call(bitmap.address,Zlib::Inflate.inflate(zdata),w*h*4)
    return bitmap
  end
 
  #--------------------------------------------------------------------------
  # * Récupère l'adresse
  #--------------------------------------------------------------------------
  def address
    buffer,ad="xxxx",object_id*2+16
    @@RtlMoveMemorySave.call(buffer,ad,4)
    ad=buffer.unpack("L")[0]+8
    @@RtlMoveMemorySave.call(buffer,ad,4)
    ad=buffer.unpack("L")[0]+16
    @@RtlMoveMemorySave.call(buffer,ad,4)
    return buffer.unpack("L")[0]
  end
end
 
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  Added, make snapshot in pre_terminate
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias
  #--------------------------------------------------------------------------
  alias old_pre_terminate pre_terminate
  #--------------------------------------------------------------------------
  # * Pre-termination Processing
  #--------------------------------------------------------------------------
  def pre_terminate
    old_pre_terminate
    make_snapshot
  end
end
 
#==============================================================================
# ** Scene_Base
#------------------------------------------------------------------------------
#  Added, make snapshot
#==============================================================================
class Scene_Base
  #--------------------------------------------------------------------------
  # * Pre-termination Processing
  #--------------------------------------------------------------------------
  def make_snapshot
    $game_temp.screenshot = Graphics.snap_to_bitmap
  end
end
 
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Alias
  #--------------------------------------------------------------------------
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :screenshot        # background bitmap
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @screenshot = Bitmap.new(1,1)
  end
end
 




Vous pouvez aussi avoir le code ici :
https://github.com/RPGMakerVX-BBactif/Pimp-My-Code/blob/master/Episode%201.rb

Aucun commentaire n'a été posté pour le moment.

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 | News | Forum | Flash-news | Sorties | Chat | Commentaires | Galerie | Blogs | Articles perso | Screen de la semaine | Palmarès | Livre d'or | Recherche | Interviews | OST | L'Annuaire | Divers
Apprendre: Le Wiki | Tutoriels | Guides | Gaming-Live | Tests | Making-of
Télécharger: Programmes | Scripts | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Index jeux séparés | Top Classiques | Top Originaux | Les autres | Collection Oniro | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Jeux complets | Proposer
Hébergés: Aëdemphia | Fighting Robots Quest | Geex | Inexistence | La Légende d'Ibabou | Nylu | Sarcia | Super Mario RPG - Lost Souls
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