Auf der Suche nach guten Save/Load scripts
Moin,
bin gerade über dieses Script gestolpert:
Neo Save System | RPG Studio
Leider ist das ja für den VX, daher meine Frage - Gibts ähnlich gute Scripts für den XP?
Suche einen Script der das Mapbild so wie in diesem Script mitanzeigt, aber für Rmxp.
Grüße
bin gerade über dieses Script gestolpert:
Neo Save System | RPG Studio
Leider ist das ja für den VX, daher meine Frage - Gibts ähnlich gute Scripts für den XP?
Suche einen Script der das Mapbild so wie in diesem Script mitanzeigt, aber für Rmxp.
Grüße
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Gjorsch« (23. März 2013, 08:59)
Es gab bereits einen Versuch, das ganze ordentlich zu übertragen, es scheint so weit auch zu funktionieren, am besten probierst du es einfach aus:
Woratana's Neo Save Script for RMXP (RGSS1)
Woratana's Neo Save Script for RMXP (RGSS1)
Danke für deine schnelle Antwort Avery,
Ich habe den Script gleich mal ausprobiert, scheint so "halbwegs?" zu funtionieren
Kurze erläuterung:
1.
Um den Script zu benutzen musste ich einen Ordner in Graphics anlegen : "System"
in diesen Ordner ein Png: "Iconset" reinpacken - Welches ich zum testen erst mal Transparent erstellt habe. Da ich nirgends ein Beispiel/Template für dieses Iconset gefunden habe.
1.2
Ich habe in das Hauptverzeichnis die Screenshot.dll von Neo Save System | RPG Studio reingepackt.
2.
In den Hauptordner habe ich einen Ordner: "Save" erstellt in diesem wird nun jeder Spielstand gespeichert mit Mapabbild.
(Ich habe die Datei "temp.png" in den Ordner Save gepackt (1x1 Pixel transparent). Die Datei "Save{id}_ss.png" wird automatisch erstellt als Abbild der Map)
Das Problem:
Mein jetziges Problem ligt darin wenn ich mehr als 2x speichere ohne das Save-Menü zu verlassen.
(Wenn ich Speichere und direkt Überschreibe
Wenn ich Überschreibe und direkt in einen andren Slot speicher
Wenn ich Überschreibe und direkt wieder Überschreibe
Wenn Ich Speicher und danach wieder in einen anderen Slot speicher)
kommt der fehler : Unable to find Save/temp.png or Save/Save{id}_ss.png ({id} bezieht sich hier auf die Nummer des Speicherstands)
Es wäre gut wenn man in den Script so eine Art Sperre einbauen könnte - sodass man Maximal 1x normal Speichern oder überschreiben kann und sich dann das Save-Window schließt -
(So ist es in der VX version von Neo Save System | RPG Studio)
Hier erstmal der Code: (Strings sind in Deutsch übersetzt :: Rest Original)
€Habe extra eine Demo angefertigt. In ihr ist alles enthalten was benötigt wird für das Script (Verbuggte Version)
SaveLoadSytem.rar
€ Problem selbst gelößt.
Gefixte Demo hab ich mal bereit gestellt.
- Das Save Window schließt jetzt nachdem man gespeichert hat. Somit kann der Fehler nicht mehr auftreten.
Neo-Save-System-VI-edited-and-fixed-for-RMXP.rar
Grüße
Ich habe den Script gleich mal ausprobiert, scheint so "halbwegs?" zu funtionieren
Kurze erläuterung:
1.
Um den Script zu benutzen musste ich einen Ordner in Graphics anlegen : "System"
in diesen Ordner ein Png: "Iconset" reinpacken - Welches ich zum testen erst mal Transparent erstellt habe. Da ich nirgends ein Beispiel/Template für dieses Iconset gefunden habe.
1.2
Ich habe in das Hauptverzeichnis die Screenshot.dll von Neo Save System | RPG Studio reingepackt.
2.
In den Hauptordner habe ich einen Ordner: "Save" erstellt in diesem wird nun jeder Spielstand gespeichert mit Mapabbild.
(Ich habe die Datei "temp.png" in den Ordner Save gepackt (1x1 Pixel transparent). Die Datei "Save{id}_ss.png" wird automatisch erstellt als Abbild der Map)
Das Problem:
Mein jetziges Problem ligt darin wenn ich mehr als 2x speichere ohne das Save-Menü zu verlassen.
(Wenn ich Speichere und direkt Überschreibe
Wenn ich Überschreibe und direkt in einen andren Slot speicher
Wenn ich Überschreibe und direkt wieder Überschreibe
Wenn Ich Speicher und danach wieder in einen anderen Slot speicher)
kommt der fehler : Unable to find Save/temp.png or Save/Save{id}_ss.png ({id} bezieht sich hier auf die Nummer des Speicherstands)
Es wäre gut wenn man in den Script so eine Art Sperre einbauen könnte - sodass man Maximal 1x normal Speichern oder überschreiben kann und sich dann das Save-Window schließt -
(So ist es in der VX version von Neo Save System | RPG Studio)
Hier erstmal der Code: (Strings sind in Deutsch übersetzt :: Rest Original)
|
|
Quellcode |
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 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 |
#==========================================================================
# ? [XP/VX] ? Neo Save System VI edited
#---------------------------------------------------------------------------
# ? Author: Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Last Updated:
# ? Version: III -> VI (By Helladen)
# ? Screenshot image credit Andreas21, and Cybersam
# ? Commerical usage ask Woratana.
#---------------------------------------------------------------------------
# ? Converted to XP by LiTTleDRAgo
#---------------------------------------------------------------------------
# ? Features:
# - Unlimited save slots, you can choose max save slot
# - Many configuration options
# - Swap tile support
# - You can use image for scene's background
# - Choose your save file's name, and folder to store save files
# - Choose to show only information you want
# - Editable text for information's title
# - Draw tile map for map that player is currently on.
# - Remove text you don't want from map's name (e.g. tags for special script)
# - Choose map that you don't want to show the name on
# - Include save confirmation window before overwrite old save
#
# For XP :
# Put face into folder Graphics/Faces/ and name them into Actor{id}.png
# ex = Actor1.png
# the faceset must 80x80
#
# Put Iconset.png in VX RTP and put it into folder Graphics/System
#
# Don't forget this script need screenshot.dll
#
#===========================================================================
VX = defined?(Window_BattleMessage)
module Wora_NSS Wora_NSS
#==========================================================================
# * START NEO SAVE SYSTEM - SETUP
#--------------------------------------------------------------------------
OPACITY_DEFAULT = true # This will use the default opacity for windows.
# Please note that this will affect both opacitys below.
NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest).
# You can change this to 0 in case you want to use image for background.
NSS_IMAGE_BG = '' # Background image file name, it must be in folder picture
# use '' for no background.
NSS_IMAGE_BG_OPACITY = 255 # Opacity for background image.
CENTER_NAME = true
# Set this to true will make Actor name center-aligned,
# if false will become left-aligned
# If you use the screenshot method this does not matter.
SWAP_TILE = false # Make this false if you don't use the swap_tile script
SWAP_TILE_SWITCH = 0 # The switch needs to be the same as your swap tile
# switch, but if SWAP_TILE is false it does not matter.
# If this is true it will screenshot the map, if false it will draw it.
SCREENSHOT_IMAGE = true # Drawing the map is good because it doesn't require
# a .DLL or images for the screenshot, and it will have tone and
# weather. If you are using SwapXT and this value is false you need to turn
# on swap tile.
# Do you want to use your own custom images for each map via map name.
PREMADE_IMAGE = false # If this is true it sets its priority over
# screenshots/etc.
# Image type for screenshot '.bmp', or '.jpg', or '.png'.
IMAGE_FILETYPE = '.png'
# If this is true then the scene will not change when you save the game.
SCENE_CHANGE = false # Changes scene to map instead of remaining in Save screen.
MAX_SAVE_SLOT = 20 # Max save slots.
SLOT_NAME = 'Datei {id}'
# Name of the slot (show in save slots list), use {id} for slot ID.
SAVE_FILE_NAME = VX ? 'Save{id}.rvdata' : 'Save{id}.rxdata'
# Save file name, you can also change its file type from .rvdata to other.
# Use {id} for save slot ID.
SAVE_PATH = 'Save/' # 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 = 'Leer' # 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.
DRAW_TEXT_GOLD = false # Draw the vocab::Gold text to the right of the number.
PLAYTIME_TEXT = 'Spielzeit: '
GOLD_TEXT = 'Gold: '
LOCATION_TEXT = 'Region: '
LV_TEXT = 'Stufe: '
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.
# Do we want to use corresponding variables for each map number in MAP_NO_NAME_LIST?
MAP_NO_NAME_VARIABLE = false # You just apply the value one to the variable which
# is the map number to change it from MAP_NO_NAME.
MAP_NO_NAME_LIST = [2] # 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 = nil #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 = 'überschreiben' # Text to confirm to save file.
SFC_Text_Cancel = 'abbrechen' # 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)
#=========================================================================
#-------------------------------------------------------------
# Screenshot V2 by Andreas21 and Cybersam
#-------------------------------------------------------------
@screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
module_function
def self.shot(file_name)
case IMAGE_FILETYPE
when '.bmp'; typid = 0
when '.jpg'; typid = 1
when '.png'; typid = 2
end
# Get Screenshot
filename = file_name + IMAGE_FILETYPE
if VX
@screen.call(0, 0, Graphics.width, Graphics.height, filename,
self.handel, typid)
else
@screen.call(0, 0, 640, 480, filename, self.handel,typid)
end
end
def self.handel
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return @findwindow.call('RGSS Player',game_name)
end
end
unless VX
#==============================================================================
# ** Vocab
#------------------------------------------------------------------------------
# This module defines terms and messages. It defines some data as constant
# variables. Terms in the database are obtained from $data_system.
#==============================================================================
DataSystem = load_data("Data/System.rxdata")
module Vocab
SaveMessage = "Speichern"
LoadMessage = "Laden"
File = "Datei"
def self.gold
return DataSystem.words.gold
end
end
#===============================================================================
# * Sound Module *
# This is a module used by RPG Maker VX - it has been modified to process XP
# sound commands.
#===============================================================================
module Sound
def self.play_cursor() $game_system.se_play($data_system.cursor_se) end
def self.play_decision() $game_system.se_play($data_system.decision_se) end
def self.play_cancel() $game_system.se_play($data_system.cancel_se) end
def self.play_buzzer() $game_system.se_play($data_system.buzzer_se) end
def self.play_equip() $game_system.se_play($data_system.equip_se)end
def self.play_save() $game_system.se_play($data_system.save_se) end
def self.play_load() $game_system.se_play($data_system.load_se) end
end
module Graphics
def self.width() 640 end
def self.height() 480 end
end
class Bitmap
#--------------------------------------------------------------------------
# * Clear Rectangle
# by poccil
#--------------------------------------------------------------------------
def clear_rect(*arg)
if arg.length == 4
fill_rect(arg[0], arg[1], arg[2], arg[3], Color.new(0,0,0,0))
elsif arg.length == 1
fill_rect(arg[0], Color.new(0,0,0,0))
else
raise ArgumentError.new
end
end
end
#==============================================================================
# ** Cache
#------------------------------------------------------------------------------
# This module loads each of graphics, creates a Bitmap object, and retains it.
# To speed up load times and conserve memory, this module holds the created
# Bitmap object in the internal hash, allowing the program to return
# preexisting objects when the same bitmap is requested again.
#==============================================================================
module Cache
#--------------------------------------------------------------------------
# * Get Face Graphic
# filename : Filename
#--------------------------------------------------------------------------
def self.face(f) load_bitmap("Graphics/Faces/", f) end
#--------------------------------------------------------------------------
# * Get System Graphic
# filename : Filename
#--------------------------------------------------------------------------
def self.system(f) load_bitmap("Graphics/System/", f) end
#--------------------------------------------------------------------------
# * Clear Cache
#--------------------------------------------------------------------------
def self.clear
@cache = {} if @cache == nil
@cache.clear
GC.start
end
#--------------------------------------------------------------------------
# * Load Bitmap
#--------------------------------------------------------------------------
def self.load_bitmap(folder_name, filename, hue = 0)
@cache = {} if @cache == nil
path = folder_name + filename
if not @cache.include?(path) or @cache[path].disposed?
if filename.empty?
@cache[path] = Bitmap.new(32, 32)
else
@cache[path] = Bitmap.new(path)
end
end
if hue == 0
return @cache[path]
else
key = [path, hue]
if not @cache.include?(key) or @cache[key].disposed?
@cache[key] = @cache[path].clone
@cache[key].hue_change(hue)
end
return @cache[key]
end
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================
class Window_Base_Neo < Window
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
WLH = 24 # Window Line Height
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super()
unless VX
@windowskin_name = $game_system.windowskin_name
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
else
self.windowskin = Cache.system("Window")
end
self.x = x
self.y = y
self.width = width
self.height = height
self.z = 100
self.back_opacity = 200
self.opacity = 255
create_contents
@opening = false
@closing = false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
self.contents.dispose
super
end
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose if self.contents
self.contents = Bitmap.new(width - 32, height - 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if @opening
self.opacity += 48
@opening = false if self.opacity >= 255
elsif @closing
self.opacity -= 48
@closing = false if self.opacity <= 0
end
end
#--------------------------------------------------------------------------
# * Open Window
#--------------------------------------------------------------------------
def open
@opening = true if self.opacity < 255
@closing = false
end
#--------------------------------------------------------------------------
# * Close Window
#--------------------------------------------------------------------------
def close
@closing = true if self.opacity > 0
@opening = false
end
#--------------------------------------------------------------------------
# * Get Text Color
# n : text color number (0-7)
#--------------------------------------------------------------------------
def text_color(n)
case n
when 0 then Color.new(255, 255, 255, 255)
when 1 then Color.new(128, 128, 255, 255)
when 2 then Color.new(255, 128, 128, 255)
when 3 then Color.new(128, 255, 128, 255)
when 4 then Color.new(128, 255, 255, 255)
when 5 then Color.new(255, 128, 255, 255)
when 6 then Color.new(255, 255, 128, 255)
when 7 then Color.new(192, 192, 192, 255)
else
normal_color
end
end
#--------------------------------------------------------------------------
# * Get Normal Text Color
#--------------------------------------------------------------------------
def normal_color() text_color(0) end
#--------------------------------------------------------------------------
# * Get System Text Color
#--------------------------------------------------------------------------
def system_color() Color.new(192, 224, 255, 255) end
#--------------------------------------------------------------------------
# * Draw number with currency unit
# value : Number (gold, etc)
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_currency_value(value, x, y, width)
cx = contents.text_size(Vocab::gold).width
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width-cx-2, WLH, value, 2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, width, WLH, Vocab::gold, 2)
end
#--------------------------------------------------------------------------
# * Draw Icon
# icon_index : Icon number
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_icon(icon_index, x, y, enabled = true)
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# face_name : Face graphic filename
# face_index : Face graphic index
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# size : Display size
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, size = 96)
bitmap = Cache.face(face_name)rescue Cache.face('')
rect = Rect.new(0, 0, 0, 0)
if VX
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 + (96 - size) / 2
else
rect.x = 0
rect.y = 0
end
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect)
bitmap.dispose
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window contains cursor movement and scroll functions.
#==============================================================================
class Window_Selectable_Neo < Window_Base_Neo
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :item_max # item count
attr_reader :column_max # digit count
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
# width : window width
# height : window height
# spacing : width of empty space when items are arranged horizontally
#--------------------------------------------------------------------------
def initialize(x, y, width, height, spacing = 32)
@item_max = 1
@column_max = 1
@index = -1
@spacing = spacing
super(x, y, width, height)
end
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose if self.contents
self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max)
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
update_cursor
call_update_help
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max()(@item_max + @column_max - 1) / @column_max end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row() self.oy / WLH end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * WLH
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max() (self.height - 32) / WLH end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max() page_row_max * @column_max end
#--------------------------------------------------------------------------
# * Get bottom row
#--------------------------------------------------------------------------
def bottom_row() top_row + page_row_max - 1 end
#--------------------------------------------------------------------------
# * Set bottom row
# row : Row displayed at the bottom
#--------------------------------------------------------------------------
def bottom_row=(row) self.top_row = row - (page_row_max - 1) end
#--------------------------------------------------------------------------
# * Get rectangle for displaying items
# index : item number
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = WLH
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * WLH
return rect
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
call_update_help
end
#--------------------------------------------------------------------------
# * Determine if cursor is moveable
#--------------------------------------------------------------------------
def cursor_movable?
return false if (not visible or not active)
return false if (index < 0 or index > @item_max or @item_max == 0)
return false if (@opening or @closing)
return true
end
#--------------------------------------------------------------------------
# * Move cursor down
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
if (@index < @item_max - @column_max) or (wrap and @column_max == 1)
@index = (@index + @column_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor up
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
if (@index >= @column_max) or (wrap and @column_max == 1)
@index = (@index - @column_max + @item_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor right
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_right(wrap = false)
if (@column_max >= 2) and
(@index < @item_max - 1 or (wrap and page_row_max == 1))
@index = (@index + 1) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor left
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_left(wrap = false)
if (@column_max >= 2) and
(@index > 0 or (wrap and page_row_max == 1))
@index = (@index - 1 + @item_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor one page down
#--------------------------------------------------------------------------
def cursor_pagedown
if top_row + page_row_max < row_max
@index = [@index + page_item_max, @item_max - 1].min
self.top_row += page_row_max
end
end
#--------------------------------------------------------------------------
# * Move cursor one page up
#--------------------------------------------------------------------------
def cursor_pageup
if top_row > 0
@index = [@index - page_item_max, 0].max
self.top_row -= page_row_max
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if cursor_movable?
last_index = @index
if Input.repeat?(Input::DOWN)
cursor_down(Input.trigger?(Input::DOWN))
end
if Input.repeat?(Input::UP)
cursor_up(Input.trigger?(Input::UP))
end
if Input.repeat?(Input::RIGHT)
cursor_right(Input.trigger?(Input::RIGHT))
end
if Input.repeat?(Input::LEFT)
cursor_left(Input.trigger?(Input::LEFT))
end
if Input.repeat?(Input::R)
cursor_pagedown
end
if Input.repeat?(Input::L)
cursor_pageup
end
if @index != last_index
Sound.play_cursor
end
end
update_cursor
call_update_help
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
if @index < 0 # If the cursor position is less than 0
self.cursor_rect.empty # Empty cursor
else # If the cursor position is 0 or more
row = @index / @column_max # Get current row
if row < top_row # If before the currently displayed
self.top_row = row # Scroll up
end
if row > bottom_row # If after the currently displayed
self.bottom_row = row # Scroll down
end
rect = item_rect(@index) # Get rectangle of selected item
rect.y -= self.oy # Match rectangle to scroll position
self.cursor_rect = rect # Refresh cursor rectangle
end
end
#--------------------------------------------------------------------------
# * Call help window update method
#--------------------------------------------------------------------------
def call_update_help
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update help window (contents are defined by the subclasses)
#--------------------------------------------------------------------------
def update_help() end
end
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
# This window deals with general command choices.
#==============================================================================
class Window_Command_Neo < Window_Selectable_Neo
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :commands # command
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command string array
# column_max : digit count (if 2 or more, horizontal selection)
# row_max : row count (0: match command count)
# spacing : blank space when items are arrange horizontally
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
if row_max == 0
row_max = (commands.size + column_max - 1) / column_max
end
super(0, 0, width, row_max * WLH + 32, spacing)
@commands = commands
@item_max = commands.size
@column_max = column_max
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
end
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This is a superclass for the save screen and load screen.
#==============================================================================
class Scene_File
include Wora_NSS
attr_reader :window_slotdetail
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
start # Start processing
perform_transition # Perform transition
Input.update # Update input information
loop do
Graphics.update # Update game screen
Input.update # Update input information
update # Update frame
break if $scene != self # When screen is switched, interrupt loop
end
Graphics.update
Graphics.freeze # Prepare transition
terminate # Termination processing
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition() Graphics.transition(10) end
#--------------------------------------------------------------------------
# * Create Snapshot for Using as Background of Another Screen
#--------------------------------------------------------------------------
def snapshot_for_background
$game_temp.background_bitmap.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
$game_temp.background_bitmap.blur
end
#--------------------------------------------------------------------------
# * Create Background for Menu Screen
#--------------------------------------------------------------------------
def create_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color.set(16, 16, 16, 128)
update_menu_background
end
#--------------------------------------------------------------------------
# * Dispose of Background for Menu Screen
#--------------------------------------------------------------------------
def dispose_menu_background() @menuback_sprite.dispose end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background() end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
create_menu_background
if NSS_IMAGE_BG != ''
@bg = Sprite.new
if VX
@bg.bitmap = Cache.picture(NSS_IMAGE_BG)
else
@bg.bitmap = RPG::Cache.picture(NSS_IMAGE_BG)
end
@bg.opacity = NSS_IMAGE_BG_OPACITY
end
@help_window = Window_Help.new
command = []
(1..MAX_SAVE_SLOT).each do |i|
command << SLOT_NAME.clone.gsub!(/\{ID\}/i) { i.to_s }
end
@window_slotdetail = Window_NSS_SlotDetail.new
@window_slotlist = Window_SlotList.new(160, command)
@window_slotlist.y = @help_window.height
@window_slotlist.height = Graphics.height - @help_window.height
if !OPACITY_DEFAULT
@help_window.opacity = NSS_WINDOW_OPACITY
@window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY
end
# Create folder for save file
if SAVE_PATH != ''
Dir.mkdir(SAVE_PATH) if !FileTest.directory?(SAVE_PATH)
end
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
(1..MAX_SAVE_SLOT).each do |i|
@window_slotlist.draw_item(i-1, false) if !@window_slotdetail.file_exist?(i)
end
end
@window_slotlist.index = @index
# Draw information
@last_slot_index = @window_slotlist.index
@window_slotdetail.draw_data(@last_slot_index + 1)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
dispose_menu_background
unless @bg.nil?
@bg.bitmap.dispose
@bg.dispose
end
@window_slotlist.dispose
@window_slotdetail.dispose
@help_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if !@confirm_window.nil?
@confirm_window.update
if Input.trigger?(Input::C)
if @confirm_window.index == 0
determine_savefile
@confirm_window.dispose
@confirm_window = nil
else
Sound.play_cancel
@confirm_window.dispose
@confirm_window = nil
end
elsif Input.trigger?(Input::B)
Sound.play_cancel
@confirm_window.dispose
@confirm_window = nil
end
else
update_menu_background
@window_slotlist.update
if @window_slotlist.index != @last_slot_index
@last_slot_index = @window_slotlist.index
@window_slotdetail.draw_data(@last_slot_index + 1)
end
@help_window.update
update_savefile_selection
end
end
#--------------------------------------------------------------------------
# * Update Save File Selection
#--------------------------------------------------------------------------
def update_savefile_selection
if Input.trigger?(Input::C)
if @saving and @window_slotdetail.file_exist?(@last_slot_index + 1)
Sound.play_decision
text1 = SFC_Text_Confirm
text2 = SFC_Text_Cancel
@confirm_window = Window_Command.new(SFC_Window_Width,[text1,text2])
@confirm_window.x = ((544 - @confirm_window.width) / 2) + SFC_Window_X_Offset
@confirm_window.y = ((416 - @confirm_window.height) / 2) + SFC_Window_Y_Offset
@confirm_window.z = 9999
else
determine_savefile
end
elsif Input.trigger?(Input::B)
Sound.play_cancel
return_scene
end
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
if @from_title || $game_temp.call_from_title
$game_temp.call_from_title = false
$scene = Scene_Title.new
elsif @from_event || $game_temp.call_from_event
$game_temp.call_from_event = false
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(4)
end
end
#--------------------------------------------------------------------------
# * Execute Save
#--------------------------------------------------------------------------
def do_save
if SCREENSHOT_IMAGE
File.rename(SAVE_PATH + 'temp' + IMAGE_FILETYPE,
make_filename(@last_slot_index).gsub(/\..*$/){ '_ss' } + IMAGE_FILETYPE)
end
file = File.open(make_filename(@last_slot_index), "wb")
write_save_data(file)
file.close
$game_temp.call_from_title = false
$game_temp.call_from_event = false
# Alter the scene after the saving is done
if SCENE_CHANGE
$scene = Scene_Map.new
else
if VX
$scene = Scene_File.new(true, false, false)
else
$scene = Scene_Save.new
end
end
end
#--------------------------------------------------------------------------
# * Execute Load
#--------------------------------------------------------------------------
def do_load
file = File.open(make_filename(@last_slot_index), "rb")
read_save_data(file)
file.close
unless VX
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
end
$scene = Scene_Map.new
if VX
RPG::BGM.fade(1500)
Graphics.fadeout(60)
Graphics.wait(40)
@last_bgm.play
@last_bgs.play
end
$game_temp.call_from_title = false
$game_temp.call_from_event = false
end
#--------------------------------------------------------------------------
# * Confirm Save File
#--------------------------------------------------------------------------
def determine_savefile
if @saving
Sound.play_save
do_save
else
if @window_slotdetail.file_exist?(@last_slot_index + 1)
Sound.play_load
do_load
else
Sound.play_buzzer
return
end
end
$game_temp.last_file_index = @last_slot_index
end
#--------------------------------------------------------------------------
# * Create Filename
# file_index : save file index (0-3)
#--------------------------------------------------------------------------
def make_filename(file_index)
return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index + 1).to_s }
end
#--------------------------------------------------------------------------
# * Select File With Newest Timestamp
#--------------------------------------------------------------------------
def latest_file_index
latest_index = 0
latest_time = Time.at(0)
(1..MAX_SAVE_SLOT).each do |i|
file_name = make_filename(i - 1)
next if !@window_slotdetail.file_exist?(i)
file_time = File.mtime(file_name)
if file_time > latest_time
latest_time = file_time
latest_index = i - 1
end
end
return latest_index
end
class Window_SlotList < Window_Command_Neo
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
icon_index = 0
self.contents.clear_rect(rect)
if $scene.window_slotdetail.file_exist?(index + 1)
icon_index = Wora_NSS::SAVED_SLOT_ICON
else
icon_index = Wora_NSS::EMPTY_SLOT_ICON
end
if !icon_index.nil?
rect.x -= 4
draw_icon(icon_index, rect.x, rect.y, enabled) # Draw Icon
rect.x += 26
rect.width -= 20
end
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
def cursor_down(wrap = false)
if @index < @item_max - 1 or wrap
@index = (@index + 1) % @item_max
end
end
def cursor_up(wrap = false)
if @index > 0 or wrap
@index = (@index - 1 + @item_max) % @item_max
end
end
end
class Window_NSS_SlotDetail < Window_Base_Neo
include Wora_NSS
def initialize
if VX
super(160, 56, 384, 360)
else
super(160, 65, 480, 415)
end
@data = []
@exist_list = []
@bitmap_list = {}
@map_name = []
end
def dispose
dispose_tilemap
super
end
def draw_data(slot_id)
contents.clear # 352, 328
dispose_tilemap
load_save_data(slot_id) if @data[slot_id].nil?
if @exist_list[slot_id]
save_data = @data[slot_id]
if VX
contents.fill_rect(0,30,352,152, MAP_BORDER)
else
contents.fill_rect(0,30,458,160, MAP_BORDER)
end
if PREMADE_IMAGE
bitmap = get_bitmap("Graphics/Save/" + @data[slot_id]['map_name'] + IMAGE_FILETYPE)
if VX
rect = Rect.new((Graphics.width-348)/2,(Graphics.height-156)/2,348,156)
else
rect = Rect.new((640-348)/2,(480-156)/2,448,156)
end
contents.blt(2,32,bitmap,rect)
elsif SCREENSHOT_IMAGE and save_data['ss']
bitmap = get_bitmap(save_data['ss_path'])
if VX
rect = Rect.new((Graphics.width-348)/2,(Graphics.height-156)/2,348,156)
else
rect = Rect.new((640-348)/2,(480-156)/2,448,156)
end
contents.blt(2,32,bitmap,rect)
elsif SWAP_TILE and $game_switches[SWAP_TILE_SWITCH]
create_swaptilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
save_data['gamemap'].display_y)
else
create_tilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
save_data['gamemap'].display_y)
end
if DRAW_GOLD
gold_textsize = contents.text_size(save_data['gamepar'].gold.to_s).width
goldt_textsize = contents.text_size(GOLD_TEXT).width
contents.font.color = system_color
contents.draw_text(0, 0, goldt_textsize, WLH, GOLD_TEXT)
contents.font.color = normal_color
contents.draw_text(goldt_textsize, 0, gold_textsize, WLH, save_data['gamepar'].gold.to_s)
if DRAW_TEXT_GOLD
contents.draw_text(goldt_textsize + gold_textsize, 0, 200, WLH, Vocab::gold)
else
gold_textsize = 0
goldt_textsize = 0
end
end
if DRAW_PLAYTIME
hour = save_data['total_sec'] / 60 / 60
min = save_data['total_sec'] / 60 % 60
sec = save_data['total_sec'] % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
pt_textsize = contents.text_size(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, PLAYTIME_TEXT)
contents.draw_text(goldt_textsize + gold_textsize,0,200,WLH, Vocab::gold)
contents.font.color = normal_color
contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
end
if DRAW_LOCATION
lc_textsize = contents.text_size(LOCATION_TEXT).width
mn_textsize = contents.text_size(save_data['map_name']).width
contents.font.color = system_color
y = VX ? 190 : 190+35
contents.draw_text(0, y, contents.width, WLH, LOCATION_TEXT)
contents.font.color = normal_color
contents.draw_text(lc_textsize, y, contents.width, WLH, save_data['map_name'])
end
# Draw level & name
game_party = VX ? save_data['gamepar'].members : save_data['gamepar'].actors
game_party.each_index do |i|
actor = save_data['gameactor'][game_party[i].id]
face_x_base = (i*80) + (i*(8+ (VX ? 0 : 18)))
face_x_base = (i*80) + (i*(8+18)) # ADD
face_y_base = 216
face_y_base += 40 if !VX
lvn_y_plus = 10
lv_textsize = contents.text_size(actor.level.to_s).width
lvt_textsize = contents.text_size(LV_TEXT).width
if DRAW_FACE
contents.fill_rect(face_x_base, face_y_base, 84, 84, FACE_BORDER)
unless VX
draw_face('Actor'+actor.id.to_s, 1, face_x_base + 2, face_y_base + 2, 80)
else
draw_face(actor.face_name, actor.face_index, face_x_base + 2,
face_y_base + 2, 80)
end
end
if 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, 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.to_s)
end
if DRAW_NAME
contents.draw_text(face_x_base, face_y_base + 2 + 80 + lvn_y_plus - 6, 84,
WLH, actor.name, CENTER_NAME ? 1 : 4)
end
end
else
contents.draw_text(0,0, contents.width, contents.height - WLH, EMPTY_SLOT_TEXT, 1)
end
end
def load_save_data(slot_id)
file_name = make_filename(slot_id)
if file_exist?(slot_id) or FileTest.exist?(file_name)
@exist_list[slot_id] = true
@data[slot_id] = {}
# Start load data
file = File.open(file_name, "r")
@data[slot_id]['time'] = file.mtime
@data[slot_id]['char'] = Marshal.load(file)
@data[slot_id]['frame'] = Marshal.load(file)
if VX
@data[slot_id]['last_bgm'] = Marshal.load(file)
@data[slot_id]['last_bgs'] = Marshal.load(file)
end
@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]['total_sec'] = @data[slot_id]['frame'] / Graphics.frame_rate
# Save the image
if SCREENSHOT_IMAGE
@data[slot_id]['ss_path'] = file_name.gsub(/\..*$/){'_ss'} + IMAGE_FILETYPE
@data[slot_id]['ss'] = FileTest.exist?(@data[slot_id]['ss_path'])
end
@data[slot_id]['map_name'] = get_mapname(@data[slot_id]['gamemap'].map_id)
file.close
else
@exist_list[slot_id] = false
@data[slot_id] = -1
end
end
def make_filename(file_index)
return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index).to_s }
end
def file_exist?(slot_id)
return @exist_list[slot_id] if !@exist_list[slot_id].nil?
@exist_list[slot_id] = FileTest.exist?(make_filename(slot_id))
return @exist_list[slot_id]
end
def get_bitmap(path)
if !@bitmap_list.include?(path)
@bitmap_list[path] = Bitmap.new(path)
end
return @bitmap_list[path]
end
def get_mapname(map_id)
if @map_data.nil?
if VX
@map_data = load_data("Data/MapInfos.rvdata")
else
@map_data = load_data("Data/MapInfos.rxdata")
end
end
if @map_name[map_id].nil?
if MAP_NO_NAME_LIST.include?(map_id) && MAP_NO_NAME_SWITCH &&
(!$game_switches.nil? && $game_switches[MAP_NO_NAME_SWITCH])
if $game_variables[map_id] == 0 or !MAP_NO_NAME_VARIABLE
@map_name[map_id] = MAP_NO_NAME
else
@map_name[map_id] = @map_data[map_id].name
end
else
@map_name[map_id] = @map_data[map_id].name rescue ''
end
MAP_NAME_TEXT_SUB.each_index do |i|
@map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '')
@mapname = @map_name[map_id]
end
end
return @map_name[map_id]
end
def create_tilemap(map_data, ox, oy)
@viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
@viewport.z = self.z
return unless VX
@tilemap = Tilemap.new(@viewport)
@tilemap.bitmaps[0] = Cache.system("TileA1")
@tilemap.bitmaps[1] = Cache.system("TileA2")
@tilemap.bitmaps[2] = Cache.system("TileA3")
@tilemap.bitmaps[3] = Cache.system("TileA4")
@tilemap.bitmaps[4] = Cache.system("TileA5")
@tilemap.bitmaps[5] = Cache.system("TileB")
@tilemap.bitmaps[6] = Cache.system("TileC")
@tilemap.bitmaps[7] = Cache.system("TileD")
@tilemap.bitmaps[8] = Cache.system("TileE")
@tilemap.map_data = map_data
@tilemap.ox = ox / 8 + 99
@tilemap.oy = oy / 8 + 90
end
def create_swaptilemap(map_data, ox, oy)
@viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
@viewport.z = self.z
return unless VX
@tilemap = Tilemap.new(@viewport)
tile1 = Cache_Swap_Tiles.swap($tileA1 + ".png") rescue nil
tile2 = Cache_Swap_Tiles.swap($tileA2 + ".png") rescue nil
tile3 = Cache_Swap_Tiles.swap($tileA3 + ".png") rescue nil
tile4 = Cache_Swap_Tiles.swap($tileA4 + ".png") rescue nil
tile5 = Cache_Swap_Tiles.swap($tileA5 + ".png") rescue nil
tile6 = Cache_Swap_Tiles.swap($tileB + ".png") rescue nil
tile7 = Cache_Swap_Tiles.swap($tileC + ".png") rescue nil
tile8 = Cache_Swap_Tiles.swap($tileD + ".png") rescue nil
tile9 = Cache_Swap_Tiles.swap($tileE + ".png") rescue nil
if $tileA1 != nil
@tilemap.bitmaps[0] = tile1
else
@tilemap.bitmaps[0] = Cache.system("TileA1")
end
if $tileA2 != nil
@tilemap.bitmaps[1] = tile2
else
@tilemap.bitmaps[1] = Cache.system("TileA2")
end
if $tileA3 != nil
@tilemap.bitmaps[2] = tile3
else
@tilemap.bitmaps[2] = Cache.system("TileA3")
end
if $tileA4 != nil
@tilemap.bitmaps[3] = tile4
else
@tilemap.bitmaps[3] = Cache.system("TileA4")
end
if $tileA5 != nil
@tilemap.bitmaps[4] = tile5
else
@tilemap.bitmaps[4] = Cache.system("TileA5")
end
if $tileB != nil
@tilemap.bitmaps[5] = tile6
else
@tilemap.bitmaps[5] = Cache.system("TileB")
end
if $tileC != nil
@tilemap.bitmaps[6] = tile7
else
@tilemap.bitmaps[6] = Cache.system("TileC")
end
if $tileD != nil
@tilemap.bitmaps[7] = tile8
else
@tilemap.bitmaps[7] = Cache.system("TileD")
end
if $tileE != nil
@tilemap.bitmaps[8] = tile9
else
@tilemap.bitmaps[8] = Cache.system("TileE")
end
@tilemap.map_data = map_data
@tilemap.ox = ox / 8 + 99
@tilemap.oy = oy / 8 + 90
end
def dispose_tilemap
unless @tilemap.nil?
@tilemap.dispose
@tilemap = nil
end
end
end
end
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@saving = true
super('')
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@saving = false
super('')
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
name = VX ? "< Scene_Base" : ""
eval_text = "
class Scene_Title #{name}
#--------------------------------------------------------------------------
# * Check Continue
#--------------------------------------------------------------------------
def check_continue
unless @checked
@checked = true
file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' }
@continue_enabled = (Dir.glob(file_name).size > 0)
return @checked = true if VX
if @continue_enabled
@command_window.index = 1
@command_window.draw_item(1, Color.new(255, 255, 255, 255))
else
@command_window.index = 0
@command_window.disable_item(1)
end
end
end
unless VX
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
alias update_nss update
def update
check_continue
update_nss
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
alias command_continue_nss command_continue
def command_continue
$game_temp = Game_Temp.new
$game_temp.call_from_title = true
command_continue_nss
end
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map #{name}
if VX
#--------------------------------------------------------------------------
# * Terminate
#--------------------------------------------------------------------------
alias wora_nss_scemap_ter terminate
def terminate
Wora_NSS.shot(Wora_NSS::SAVE_PATH + 'temp')
wora_nss_scemap_ter
end
else
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
alias wora_nss_scemap_ter main
def main
wora_nss_scemap_ter
Wora_NSS.shot(Wora_NSS::SAVE_PATH + 'temp')
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
alias wora_nss_scemap_callsave call_save
def call_save
$game_temp.save_calling = false
$game_temp.call_from_event = true
wora_nss_scemap_callsave
end
end
end#"
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
attr_accessor :background_bitmap,:call_from_event,:call_from_title
end
eval(eval_text)
#======================================================================
# END - NEO SAVE SYSTEM by Woratana and Helladen
#====================================================================== |
zum Lesen den Text mit der Maus markieren
€Habe extra eine Demo angefertigt. In ihr ist alles enthalten was benötigt wird für das Script (Verbuggte Version)
SaveLoadSytem.rar
zum Lesen den Text mit der Maus markieren
€ Problem selbst gelößt.
Gefixte Demo hab ich mal bereit gestellt.
- Das Save Window schließt jetzt nachdem man gespeichert hat. Somit kann der Fehler nicht mehr auftreten.
Neo-Save-System-VI-edited-and-fixed-for-RMXP.rar
Grüße
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Requiem« (24. März 2013, 10:56)
Ähnliche Themen
-
Taverne zum philosophischen Phönix »-
Die RPG-WG
(16. Mai 2010, 20:48)
-
RGSS 1 Probleme & Talk »-
Speichern/Laden per Call Script
(24. März 2010, 08:12)
-
Programmierhilfen »-
Quick Save / Load / Delete V1.2
(16. Mai 2009, 19:03)
-
RGSS 1 Probleme & Talk »-
Werte in Variablen
(18. Juni 2006, 10:28)
-
RGSS Archiv »-
Fehler beim Laden
(14. Mai 2005, 16:20)
