Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Folder zapisu gry
Autor Wiadomość
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Pią 24 Lip, 2009 15:27
Folder zapisu gry
~ Folder zapisu gry ~

Krótki opis
Skrypt pozwala na dodanie folderu, w którym umieszczane są zapisy gry (save).

Autor skryptu
TagTeam

Poprawki
Ayene [yurika@o2.pl]

Kompatybilność
Tylko VX. Skrypt może nie być kompatybilny z innymi ingerującymi w sposób zapisu gry.

Skrypt
Spoiler:

Kod:
# ==============================================
# ~ Folder Zapisu Gry ~
# Data publikacji: 24.07.2009
# Autor: TagTeam
# Poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronę Ultima Forum - http://www.ultimateam.pl
# =======================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =======================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Skrypt pozwala na dodanie folderu, w którym umieszczane są zapisy gry (save).

# --------------------------- POCZĄTEK SKRYPTU ---------------------------------
module TagTeam
# ---------------------------- POCZĄTEK EDYCJI ---------------------------------
  # Nazwa folderu, który musi zostać założony w folderze z grą.
  FolderZapisuGry = 'Zapisy Gry'
 
  # Nazwa pliku. Po 'nr' będzie dodawany kolejno numer zapisu.
  NazwaZapisu = 'Zapis nr '
 
# ----------------------------- KONIEC EDYCJI ----------------------------------   
end

# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^--------------------
class Scene_File
  def make_filename(file_index)
    return TagTeam::FolderZapisuGry + '/' + TagTeam::NazwaZapisu +
    (file_index + 1).to_s + '.rvdata'           
  end
end

class Scene_Title
  def check_continue
    @continue_enabled = (Dir.glob(TagTeam::FolderZapisuGry + '/' +
    TagTeam::NazwaZapisu + '*' + '.rvdata').size > 0)
  end
end
# --------------------------- KONIEC SKRYPTU -----------------------------------


Demo
niepotrzebne

Screenshot
brak

Instrukcja
1. Wklej skrypt nad "Main" w Edytorze Skryptu.
2. Załóż folder "Zapisy Gry" w folderze z grą.
3. Reszta instrukcji znajduje się w treści skryptu.

Piszcie w razie problemów.

folder_zapisu.txt
Pobierz Plik ściągnięto 419 raz(y) 1,7 KB

________________________


 
 
 
Melvin 




Preferowany:
RPG Maker XP

Ranga RM:
1 gra

Pomógł: 35 razy
Dołączył: 23 Paź 2009
Posty: 1063
Wysłany: Sob 03 Kwi, 2010 10:42
Super skrypt!
Da się coś takiego zrobić do XP?
________________________
MelvinClass:
Spoiler:

 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 03 Kwi, 2010 11:58
Melvin, to załóż osobny temat w odpowiednim dziale :!:
________________________


 
 
 
CreeperCrisis 



Preferowany:
RPG Maker VXAce

Pomógł: 32 razy
Dołączył: 01 Maj 2010
Posty: 395
Wysłany: Sob 01 Maj, 2010 18:36
Ayene, dzięki temu skryptowi teraz te save'y się tak nie walają. :-) Wreszcie jest jakiś oddzielny folder. :mrgreen:
 
 
cj2 




Preferowany:
RPG Maker VXAce

Ranga RM:
1 gra

Pomógł: 6 razy
Dołączył: 07 Mar 2010
Posty: 261
Skąd: Gliwice
Wysłany: Sob 01 Maj, 2010 18:55
A można zrobić by współdziałało z hasłem?
Bo jak robie hasło puste to zapisuje.Lecz odczytuje nawet gdy zamiast zostawić puste okienko wpisuje a
________________________
Porady dla twórców gier
Nie ma śniegu, a zgubiłem normalny avatar :I
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 01 Maj, 2010 19:01
jajco2, z jakim hasłem? Jaki dokładnie skrypt masz na myśli?
________________________


 
 
 
cj2 




Preferowany:
RPG Maker VXAce

Ranga RM:
1 gra

Pomógł: 6 razy
Dołączył: 07 Mar 2010
Posty: 261
Skąd: Gliwice
Wysłany: Sob 01 Maj, 2010 20:50
O to http://www.ultimateam.pl/viewtopic.php?t=3198
Tylko żeby był z polskim inferejsem bo przetłumaczyłem "Tu wpisz hasło do gry. Enter to ok" (obydwa)
________________________
Porady dla twórców gier
Nie ma śniegu, a zgubiłem normalny avatar :I
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 01 Maj, 2010 21:18
W takim razie usuń skrypt z folderem zapisów gry, a skrypt 'Personal Save Files' podmień na poniższy (są połączone w jeden):
Spoiler:

Kod:
#---------------------
# Personal Save Files
# By: Polraudio
# Credits: Polraudio, RPG Advocate, Cybersam
# Version: 1.0
#---------------------
=begin
#----------------------------------------------------
Features:
- Allows you to have up to Unlimited save files
- You can have a name for your save files

Instructions:
Place above main

Contact:
If you have any questions or comments you can find me
at www.rmxpunlimited.net(Best Method)

Or email me polraudio@gmail.com
=end

module TagTeam
# ---------------------------- POCZĄTEK EDYCJI ---------------------------------
  # Nazwa folderu, który musi zostać założony w folderze z grą.
  FolderZapisuGry = 'Zapisy Gry'
 
  # Nazwa pliku. Po 'nr' będzie dodawany kolejno numer zapisu.
  NazwaZapisu = 'Zapis nr '
 
# ----------------------------- KONIEC EDYCJI ----------------------------------   
end


class Scene_File < Scene_Base
  def initialize(saving, from_title, from_event)
        @saving = saving
        @from_title = from_title
        @from_event = from_event
  end
  def start
        super
        create_menu_background
        @help_window = Window_Help.new
        create_savefile_windows
        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)
        end
        @savefile_windows[@index].selected = true
  end
  def terminate
        super
        dispose_menu_background
        @help_window.dispose
        dispose_item_windows
  end
  def return_scene
        if @from_title
          $scene = Scene_Title.new
        elsif @from_event
          $scene = Scene_Map.new
        else
          $scene = Scene_Menu.new(4)
        end
  end
  def update
        super
        update_menu_background
        @help_window.update
        update_savefile_windows
        update_savefile_selection
  end
  def create_savefile_windows
        @savefile_windows = []
        for i in 0..3
          @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
        end
        @item_max = 4
  end
  def dispose_item_windows
        for window in @savefile_windows
          window.dispose
        end
  end
  def update_savefile_windows
        for window in @savefile_windows
          window.update
        end
  end
  def update_savefile_selection
        if Input.trigger?(Input::C)
          determine_savefile
        elsif Input.trigger?(Input::B)
          Sound.play_cancel
          return_scene
        else
          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 @index != last_index
                Sound.play_cursor
                @savefile_windows[last_index].selected = false
                @savefile_windows[@index].selected = true
          end
        end
  end
  def determine_savefile
        if @saving
          Sound.play_save
          do_save
        else
          if @savefile_windows[@index].file_exist
                Sound.play_load
                do_load
          else
                Sound.play_buzzer
                return
          end
        end
        $game_temp.last_file_index = @index
  end
  def cursor_down(wrap)
        if @index < @item_max - 1 or wrap
          @index = (@index + 1) % @item_max
        end
  end
  def cursor_up(wrap)
        if @index > 0 or wrap
          @index = (@index - 1 + @item_max) % @item_max
        end
  end
  def make_filename(file_index)
    return TagTeam::FolderZapisuGry + '/' + TagTeam::NazwaZapisu +
    (file_index + 1).to_s + $savename 
  end   
     
  def latest_file_index
        index = 0
        latest_time = Time.at(0)
        for i in 0...@savefile_windows.size
          if @savefile_windows[i].time_stamp > latest_time
                latest_time = @savefile_windows[i].time_stamp
                index = i
          end
        end
        return index
  end
  def do_save
        file = File.open(@savefile_windows[@index].filename, "wb")
        write_save_data(file)
        file.close
        return_scene
  end
  def do_load
        file = File.open(@savefile_windows[@index].filename, "rb")
        read_save_data(file)
        file.close
        $scene = Scene_Map.new
        RPG::BGM.fade(1500)
        Graphics.fadeout(60)
        Graphics.wait(40)
        @last_bgm.play
        @last_bgs.play
  end
  def write_save_data(file)
        characters = []
        for actor in $game_party.members
          characters.push([actor.character_name, actor.character_index])
        end
        $game_system.save_count += 1
        $game_system.version_id = $data_system.version_id
        @last_bgm = RPG::BGM::last
        @last_bgs = RPG::BGS::last
        Marshal.dump(characters,                   file)
        Marshal.dump(Graphics.frame_count, file)
        Marshal.dump(@last_bgm,                 file)
        Marshal.dump(@last_bgs,                 file)
        Marshal.dump($game_system,               file)
        Marshal.dump($game_message,             file)
        Marshal.dump($game_switches,       file)
        Marshal.dump($game_variables,     file)
        Marshal.dump($game_self_switches,  file)
        Marshal.dump($game_actors,               file)
        Marshal.dump($game_party,                 file)
        Marshal.dump($game_troop,                 file)
        Marshal.dump($game_map,                 file)
        Marshal.dump($game_player,               file)
  end
  def read_save_data(file)
        characters                 = Marshal.load(file)
        Graphics.frame_count = Marshal.load(file)
        @last_bgm                       = Marshal.load(file)
        @last_bgs                       = Marshal.load(file)
        $game_system             = Marshal.load(file)
        $game_message           = Marshal.load(file)
        $game_switches     = Marshal.load(file)
        $game_variables   = Marshal.load(file)
        $game_self_switches  = Marshal.load(file)
        $game_actors             = Marshal.load(file)
        $game_party               = Marshal.load(file)
        $game_troop               = Marshal.load(file)
        $game_map                       = Marshal.load(file)
        $game_player             = Marshal.load(file)
        if $game_system.version_id != $data_system.version_id
          $game_map.setup($game_map.map_id)
          $game_player.center($game_player.x, $game_player.y)
        end
  end
end

class Scene_Title < Scene_Base
  def main
        if $BTEST
          battle_test
        else
          super
        end
  end
  def start
        super
        load_database
        create_game_objects
        check_continue
        create_title_graphic
        create_command_window
        play_title_music
  end
  def perform_transition
        Graphics.transition(20)
  end
  def post_start
        super
        open_command_window
  end
  def pre_terminate
        super
        close_command_window
  end
  def terminate
        super
        dispose_command_window
        snapshot_for_background
        dispose_title_graphic
  end
  def update
        super
        @command_window.update
        if Input.trigger?(Input::C)
          case @command_window.index
          when 0        #New game
                command_new_game
          when 1        # Continue
                command_continue
          when 2        # Shutdown
                command_shutdown
          end
        end
  end
  def load_database
        $data_actors            = load_data("Data/Actors.rvdata")
        $data_classes      = load_data("Data/Classes.rvdata")
        $data_skills            = load_data("Data/Skills.rvdata")
        $data_items              = load_data("Data/Items.rvdata")
        $data_weapons      = load_data("Data/Weapons.rvdata")
        $data_armors            = load_data("Data/Armors.rvdata")
        $data_enemies      = load_data("Data/Enemies.rvdata")
        $data_troops            = load_data("Data/Troops.rvdata")
        $data_states            = load_data("Data/States.rvdata")
        $data_animations        = load_data("Data/Animations.rvdata")
        $data_common_events = load_data("Data/CommonEvents.rvdata")
        $data_system            = load_data("Data/System.rvdata")
        $data_areas              = load_data("Data/Areas.rvdata")
  end
  def load_bt_database
        $data_actors            = load_data("Data/BT_Actors.rvdata")
        $data_classes      = load_data("Data/BT_Classes.rvdata")
        $data_skills            = load_data("Data/BT_Skills.rvdata")
        $data_items              = load_data("Data/BT_Items.rvdata")
        $data_weapons      = load_data("Data/BT_Weapons.rvdata")
        $data_armors            = load_data("Data/BT_Armors.rvdata")
        $data_enemies      = load_data("Data/BT_Enemies.rvdata")
        $data_troops            = load_data("Data/BT_Troops.rvdata")
        $data_states            = load_data("Data/BT_States.rvdata")
        $data_animations        = load_data("Data/BT_Animations.rvdata")
        $data_common_events = load_data("Data/BT_CommonEvents.rvdata")
        $data_system            = load_data("Data/BT_System.rvdata")
  end
  def create_game_objects
        $game_temp                = Game_Temp.new
        $game_message      = Game_Message.new
        $game_system            = Game_System.new
        $game_switches    = Game_Switches.new
        $game_variables  = Game_Variables.new
        $game_self_switches = Game_SelfSwitches.new
        $game_actors            = Game_Actors.new
        $game_party              = Game_Party.new
        $game_troop              = Game_Troop.new
        $game_map                  = Game_Map.new
        $game_player            = Game_Player.new
  end
     
  def check_continue
    @continue_enabled = (Dir.glob(TagTeam::FolderZapisuGry + '/' +
    TagTeam::NazwaZapisu + '*' + '.rvdata').size > 0)
  end
 
  def create_title_graphic
        @sprite = Sprite.new
        @sprite.bitmap = Cache.system("Title")
  end
  def dispose_title_graphic
        @sprite.bitmap.dispose
        @sprite.dispose
  end
  def create_command_window
        s1 = Vocab::new_game
        s2 = Vocab::continue
        s3 = Vocab::shutdown
        @command_window = Window_Command.new(172, [s1, s2, s3])
        @command_window.x = (544 - @command_window.width) / 2
        @command_window.y = 288
        @command_window.openness = 0
        @command_window.open
  end
  def dispose_command_window
        @command_window.dispose
  end
  def open_command_window
        @command_window.open
        begin
          @command_window.update
          Graphics.update
        end until @command_window.openness == 255
  end
  def close_command_window
        @command_window.close
        begin
          @command_window.update
          Graphics.update
        end until @command_window.openness == 0
  end
  def play_title_music
        $data_system.title_bgm.play
        RPG::BGS.stop
        RPG::ME.stop
  end
  def confirm_player_location
        if $data_system.start_map_id == 0
          print "Player start location not set."
          exit
        end
  end
  def command_new_game
        data = []
        top_text = "Tu wpisz hasło do gry. Enter to ok"
        text = ""
        font = "Arial"
        max = 9
        size = 24
        $savename = Text_input.new(top_text, text, font, max, size).text
        confirm_player_location
        Sound.play_decision
        $game_party.setup_starting_members
        $game_map.setup($data_system.start_map_id)
        $game_player.moveto($data_system.start_x, $data_system.start_y)
        $game_player.refresh
        $scene = Scene_Map.new
        RPG::BGM.fade(1500)
        close_command_window
        Graphics.fadeout(60)
        Graphics.wait(40)
        Graphics.frame_count = 0
        RPG::BGM.stop
        $game_map.autoplay
  end
  def command_continue
        data = []
        top_text = "Tu wpisz hasło do gry. Enter to ok"
        text = ""
        font = "Arial"
        max = 9
        size = 24
        $savename = Text_input.new(top_text, text, font, max, size).text
        Sound.play_decision
        $scene = Scene_File.new(false, true, false)
  end
  def command_shutdown
        Sound.play_decision
        RPG::BGM.fade(800)
        RPG::BGS.fade(800)
        RPG::ME.fade(800)
        $scene = nil
  end
  def battle_test
        load_bt_database
        create_game_objects
        Graphics.frame_count = 0
        $game_party.setup_battle_test_members
        $game_troop.setup($data_system.test_troop_id)
        $game_troop.can_escape = true
        $game_system.battle_bgm.play
        snapshot_for_background
        $scene = Scene_Battle.new
  end
end
#======================================
# &#9632; Keyboard Script
#---------------------------------------------------------------------------
# &#12288;By: Cybersam
#   Date: 25/05/05
#   Version 4
#======================================
# How to use
# if Kboard.keyboard($R_Key_A)
#
module Kboard
 #--------------------------------------------------------------------------
 $RMouse_BUTTON_L = 0x01                # left mouse button
 $RMouse_BUTTON_R = 0x02                # right mouse button
 $RMouse_BUTTON_M = 0x04                # middle mouse button
 $RMouse_BUTTON_4 = 0x05                # 4th mouse button
 $RMouse_BUTTON_5 = 0x06                # 5th mouse button
 #--------------------------------------------------------------------------
 $R_Key_BACK      = 0x08                # BACKSPACE key
 $R_Key_TAB        = 0x09               # TAB key
 $R_Key_RETURN  = 0x0D          # ENTER key
 $R_Key_SHIFT    = 0x10         # SHIFT key
 $R_Key_CTLR      = 0x11                # CTLR key
 $R_Key_ALT        = 0x12               # ALT key
 $R_Key_PAUSE    = 0x13         # PAUSE key
 $R_Key_CAPITAL   = 0x14                # CAPS LOCK key
 $R_Key_ESCAPE  = 0x1B          # ESC key
 $R_Key_SPACE    = 0x20         # SPACEBAR
 $R_Key_PRIOR    = 0x21         # PAGE UP key
 $R_Key_NEXT      = 0x22                # PAGE DOWN key
 $R_Key_END        = 0x23               # END key
 $R_Key_HOME      = 0x24                # HOME key
 $R_Key_LEFT      = 0x25                # LEFT ARROW key
 $R_Key_UP              = 0x26          # UP ARROW key
 $R_Key_RIGHT    = 0x27         # RIGHT ARROW key
 $R_Key_DOWN      = 0x28                # DOWN ARROW key
 $R_Key_SELECT  = 0x29          # SELECT key
 $R_Key_PRINT    = 0x2A         # PRINT key
 $R_Key_SNAPSHOT  = 0x2C                # PRINT SCREEN key
 $R_Key_INSERT  = 0x2D          # INS key
 $R_Key_DELETE  = 0x2E          # DEL key
 #--------------------------------------------------------------------------
 $R_Key_0                = 0x30         # 0 key
 $R_Key_1                = 0x31         # 1 key
 $R_Key_2                = 0x32         # 2 key
 $R_Key_3                = 0x33         # 3 key
 $R_Key_4                = 0x34         # 4 key
 $R_Key_5                = 0x35         # 5 key
 $R_Key_6                = 0x36         # 6 key
 $R_Key_7                = 0x37         # 7 key
 $R_Key_8                = 0x38         # 8 key
 $R_Key_9                = 0x39         # 9 key
 #--------------------------------------------------------------------------
 $R_Key_A                = 0x41         # A key
 $R_Key_B                = 0x42         # B key
 $R_Key_C                = 0x43         # C key
 $R_Key_D                = 0x44         # D key
 $R_Key_E                = 0x45         # E key
 $R_Key_F                = 0x46         # F key
 $R_Key_G                = 0x47         # G key
 $R_Key_H                = 0x48         # H key
 $R_Key_I                = 0x49         # I key
 $R_Key_J                = 0x4A         # J key
 $R_Key_K                = 0x4B         # K key
 $R_Key_L                = 0x4C         # L key
 $R_Key_M                = 0x4D         # M key
 $R_Key_N                = 0x4E         # N key
 $R_Key_O                = 0x4F         # O key
 $R_Key_P                = 0x50         # P key
 $R_Key_Q                = 0x51         # Q key
 $R_Key_R                = 0x52         # R key
 $R_Key_S                = 0x53         # S key
 $R_Key_T                = 0x54         # T key
 $R_Key_U                = 0x55         # U key
 $R_Key_V                = 0x56         # V key
 $R_Key_W                = 0x57         # W key
 $R_Key_X                = 0x58         # X key
 $R_Key_Y                = 0x59         # Y key
 $R_Key_Z                = 0x5A         # Z key
 #--------------------------------------------------------------------------
 $R_Key_LWIN      = 0x5B                # Left Windows key (Microsoft Natural keyboard)
 $R_Key_RWIN      = 0x5C                # Right Windows key (Natural keyboard)
 $R_Key_APPS      = 0x5D                # Applications key (Natural keyboard)
 #--------------------------------------------------------------------------
 $R_Key_NUMPAD0   = 0x60                # Numeric keypad 0 key
 $R_Key_NUMPAD1   = 0x61                # Numeric keypad 1 key
 $R_Key_NUMPAD2   = 0x62                # Numeric keypad 2 key
 $R_Key_NUMPAD3   = 0x63                # Numeric keypad 3 key
 $R_Key_NUMPAD4   = 0x64                # Numeric keypad 4 key
 $R_Key_NUMPAD5   = 0x65                # Numeric keypad 5 key
 $R_Key_NUMPAD6   = 0x66                # Numeric keypad 6 key
 $R_Key_NUMPAD7   = 0x67                # Numeric keypad 7 key
 $R_Key_NUMPAD8   = 0x68                # Numeric keypad 8 key
 $R_Key_NUMPAD9   = 0x69                # Numeric keypad 9 key
 $R_Key_MULTIPLY  = 0x6A                # Multiply key (*)
 $R_Key_ADD        = 0x6B               # Add key (+)
 $R_Key_SEPARATOR = 0x6C                # Separator key
 $R_Key_SUBTRACT  = 0x6D                # Subtract key (-)
 $R_Key_DECIMAL   = 0x6E                # Decimal key
 $R_Key_DIVIDE  = 0x6F          # Divide key (/)
 #--------------------------------------------------------------------------
 $R_Key_F1              = 0x70          # F1 key
 $R_Key_F2              = 0x71          # F2 key
 $R_Key_F3              = 0x72          # F3 key
 $R_Key_F4              = 0x73          # F4 key
 $R_Key_F5              = 0x74          # F5 key
 $R_Key_F6              = 0x75          # F6 key
 $R_Key_F7              = 0x76          # F7 key
 $R_Key_F8              = 0x77          # F8 key
 $R_Key_F9              = 0x78          # F9 key
 $R_Key_F10        = 0x79               # F10 key
 $R_Key_F11        = 0x7A               # F11 key
 $R_Key_F12        = 0x7B               # F12 key
 #--------------------------------------------------------------------------
 $R_Key_NUMLOCK   = 0x90                # NUM LOCK key
 $R_Key_SCROLL  = 0x91          # SCROLL LOCK key
 #--------------------------------------------------------------------------
 $R_Key_LSHIFT  = 0xA0          # Left SHIFT key
 $R_Key_RSHIFT  = 0xA1          # Right SHIFT key
 $R_Key_LCONTROL  = 0xA2                # Left CONTROL key
 $R_Key_RCONTROL  = 0xA3                # Right CONTROL key
 $R_Key_L_ALT    = 0xA4         # Left ALT key
 $R_Key_R_ALT    = 0xA5         # Right ALT key
 #--------------------------------------------------------------------------
 $R_Key_SEP        = 0xBC               # , key
 $R_Key_DASH      = 0xBD                # - key
 $R_Key_DOTT      = 0xBE                # . key
 #--------------------------------------------------------------------------
 GetKeyState = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
 GetKeyboardState = Win32API.new("user32","GetKeyState",['i'],'i')
 GetSetKeyState = Win32API.new("user32","SetKeyboardState",['i'],'i')
 #--------------------------------------------------------------------------
 module_function
 #--------------------------------------------------------------------------
 def keyb(rkey)
        if GetKeyState.call(rkey) != 0
          return 1
        end
        return 0
 end
  #--------------------------------------------------------------------------
 def keyboard(rkey)
   GetKeyState.call(rkey) & 0x01 == 1  #
 end
 #--------------------------------------------------------------------------
 def key(rkey, key = 0)
   GetKeyboardState.call(rkey) & 0x01 == key #
 end
end
#===============================================================================
#
# Text-Input Script v1                                                                   created by: cybersam
#
# hi boys and ladys.... and whatever else ^-^
#
# here comes the script that allows you to insert text with the keyboard
# in your game... ^-^
#
# i didnt make it work with the default name edit/input script
# but with this it should be easier for you guys to do it...
# the reason ?!.. i said it already in other scripts... ^-^
#
# "i dont wana do a complete script that you can post in your games and it works
# without a single modification"...
#
# since there are people here that just dont even wont try to learn ruby...
# this script works perfect of its own....
# but it wont let you edit the character name without modification...
# so go on and try it out...
#
# if you need help to edit something just ask...
# i would gladly help but i wont do all the work for you...
#
# thats it from my side...
# as for now... this will be the last update
# for this script (keyboard/mouse script) from my side...
# if you find any bugs please contact me... you should already now how... ^-^
# and dont tell me "there is a bug in you script!"
# that alone is not enough... ^-^
#
# cya all ^-^
# sam
#
#===============================================================================

class Text_input < Window_Base

  def initialize(top_text = "Here comes the new Version of the keyboard script", text = "Keyboad - Script v3", font = "Arial", max = 20, size = 16, free = "_")
        @toptext = top_text
        @text =  text
        @font = font
        @max = max
        @size = size
        @free = free
        super(320 - (@max*@size+@size)/2, 240-@size*2-32, @max * @size + 32, 128)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = @font
        self.contents.font.size = @size
        self.z = 256
        @twidth = @max*@size
        refresh
        update
  end
  def refresh
        self.contents.clear
        self.contents.font.color = system_color
        self.contents.draw_text(0, 0, @twidth, @size, @toptext, 1)
        for i in 0...@max
          text = @text[i]
          if text == nil
                text = @free
          else
                text = text.chr
          end
          self.contents.font.color = normal_color
          self.contents.draw_text(@size * i, @size + 24, @size, @size, text, 1)
        end
  end
        def update
          loop do
                Graphics.update
                refresh
                if Kboard.keyboard($R_Key_BACK) # delete (with backspace)
                  text = ""
                  if @text.size != 0
                        for i in 0...@text.size - 1
                          text  += @text[i].chr
                        end
                  @text = text
                  else
                  end
                end
                if Kboard.keyboard($R_Key_RETURN) # Enter key... to end...
                  #$game_variables[1]=@text
                  return
                end

                if @text.size < @max

# putting Key's to the text


                  if Kboard.keyboard($R_Key_SPACE) # space key (to insert space between the chars... ^-^)
                        @text += " " # space.. you can set anything else if you want ^-^'
                  end
                  if Kboard.key($R_Key_CAPITAL, 1) # if caps lock is active then write the chars in higher case
                        if Kboard.keyboard($R_Key_A)
                          @text += "A"
                        end
                        if Kboard.keyboard($R_Key_B)
                          @text += "B"
                        end
                        if Kboard.keyboard($R_Key_C)
                        @text += "C"
                        end
                        if Kboard.keyboard($R_Key_D)
                          @text += "D"
                        end               
                        if Kboard.keyboard($R_Key_E)
                          @text += "E"
                        end
                        if Kboard.keyboard($R_Key_F)
                          @text += "F"
                        end
                        if Kboard.keyboard($R_Key_G)
                          @text += "G"
                        end
                        if Kboard.keyboard($R_Key_H)
                          @text += "H"
                        end
                        if Kboard.keyboard($R_Key_I)
                          @text += "I"
                        end
                        if Kboard.keyboard($R_Key_J)
                          @text += "J"
                        end
                        if Kboard.keyboard($R_Key_K)
                          @text += "K"
                        end
                        if Kboard.keyboard($R_Key_L)
                          @text += "L"
                        end
                        if Kboard.keyboard($R_Key_M)
                          @text += "M"
                        end
                        if Kboard.keyboard($R_Key_N)
                          @text += "N"
                        end
                        if Kboard.keyboard($R_Key_O)
                          @text += "O"
                        end
                        if Kboard.keyboard($R_Key_P)
                          @text += "P"
                        end
                        if Kboard.keyboard($R_Key_Q)
                          @text += "Q"
                        end
                        if Kboard.keyboard($R_Key_R)
                          @text += "R"
                        end
                        if Kboard.keyboard($R_Key_S)
                          @text += "S"
                        end
                        if Kboard.keyboard($R_Key_T)
                          @text += "T"
                        end
                        if Kboard.keyboard($R_Key_U)
                          @text += "U"
                        end
                        if Kboard.keyboard($R_Key_V)
                          @text += "V"
                        end
                        if Kboard.keyboard($R_Key_W)
                          @text += "W"
                        end
                        if Kboard.keyboard($R_Key_X)
                          @text += "X"
                        end
                        if Kboard.keyboard($R_Key_Y)
                          @text += "Y"
                        end
                        if Kboard.keyboard($R_Key_Z)
                          @text += "Z"
                        end

                  elsif Kboard.key($R_Key_CAPITAL) # if caps lock is deactivated then write in lower case

                        if Kboard.keyboard($R_Key_A)
                          @text += "a"
                        end
                        if Kboard.keyboard($R_Key_B)
                          @text += "b"
                        end
                        if Kboard.keyboard($R_Key_C)
                        @text += "c"
                        end
                        if Kboard.keyboard($R_Key_D)
                          @text += "d"
                        end               
                        if Kboard.keyboard($R_Key_E)
                          @text += "e"
                        end
                        if Kboard.keyboard($R_Key_F)
                          @text += "f"
                        end
                        if Kboard.keyboard($R_Key_G)
                          @text += "g"
                        end
                        if Kboard.keyboard($R_Key_H)
                          @text += "h"
                        end
                        if Kboard.keyboard($R_Key_I)
                          @text += "i"
                        end
                        if Kboard.keyboard($R_Key_J)
                          @text += "j"
                        end
                        if Kboard.keyboard($R_Key_K)
                          @text += "k"
                        end
                        if Kboard.keyboard($R_Key_L)
                          @text += "l"
                        end
                        if Kboard.keyboard($R_Key_M)
                          @text += "m"
                        end
                        if Kboard.keyboard($R_Key_N)
                          @text += "n"
                        end
                        if Kboard.keyboard($R_Key_O)
                          @text += "o"
                        end
                        if Kboard.keyboard($R_Key_P)
                          @text += "p"
                        end
                        if Kboard.keyboard($R_Key_Q)
                          @text += "q"
                        end
                        if Kboard.keyboard($R_Key_R)
                          @text += "r"
                        end
                        if Kboard.keyboard($R_Key_S)
                          @text += "s"
                        end
                        if Kboard.keyboard($R_Key_T)
                          @text += "t"
                        end
                        if Kboard.keyboard($R_Key_U)
                          @text += "u"
                        end
                        if Kboard.keyboard($R_Key_V)
                          @text += "v"
                        end
                        if Kboard.keyboard($R_Key_W)
                          @text += "w"
                        end
                        if Kboard.keyboard($R_Key_X)
                          @text += "x"
                        end
                        if Kboard.keyboard($R_Key_Y)
                          @text += "y"
                        end
                        if Kboard.keyboard($R_Key_Z)
                          @text += "z"
                        end
                  end
   
# numbers

                  if Kboard.keyboard($R_Key_0)
                        @text += "0"
                  end
                  if Kboard.keyboard($R_Key_1)
                        @text += "1"
                  end
                  if Kboard.keyboard($R_Key_2)
                        @text += "2"
                  end
                  if Kboard.keyboard($R_Key_3)
                        @text += "3"
                  end
                  if Kboard.keyboard($R_Key_4)
                        @text += "4"
                  end
                  if Kboard.keyboard($R_Key_5)
                        @text += "5"
                  end
                  if Kboard.keyboard($R_Key_6)
                        @text += "6"
                  end
                  if Kboard.keyboard($R_Key_7)
                        @text += "7"
                  end
                  if Kboard.keyboard($R_Key_8)
                        @text += "8"
                  end
                  if Kboard.keyboard($R_Key_9)
                        @text += "9"
                  end
                 
         
                 
# numpad
                  if Kboard.keyboard($R_Key_NUMPAD0)
                        @text += "0"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD1)
                        @text += "1"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD2)
                        @text += "2"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD3)
                        @text += "3"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD4)
                        @text += "4"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD5)
                        @text += "5"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD6)
                        @text += "6"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD7)
                        @text += "7"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD8)
                        @text += "8"
                  end
                  if Kboard.keyboard($R_Key_NUMPAD9)
                        @text += "9"
                  end

                  if Kboard.keyboard($R_Key_ADD) # + (numpad)
                        @text += "+"
                  end
                  if Kboard.keyboard($R_Key_SUBTRACT) # - (numpad)
                        @text += "-"
                  end
                  if Kboard.keyboard($R_Key_DIVIDE) # / (numpad)
                        @text += "/"
                  end
                  if Kboard.keyboard($R_Key_MULTIPLY) # * (numpad)
                        @text += "*"
                  end
                 
                  if Kboard.key($R_Key_CAPITAL) # since i dont want to change my keyboard layout you need to test it for you'r self...
                        if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
                          @text += ","
                        end
                        if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
                          @text += "-"
                        end
                        if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
                          @text += "."
                        end
                  elsif Kboard.key($R_Key_CAPITAL, 1)
                        if Kboard.keyboard($R_Key_SEP) # , (key) (tested german keyboard layout)
                          @text += ";"
                        end
                        if Kboard.keyboard($R_Key_DASH) # - (key) (tested german keyboard layout)
                          @text += "_"
                        end
                        if Kboard.keyboard($R_Key_DOTT) # . (key) (tested german keyboard layout)
                          @text += ":"
                        end
                  end

                else
                end
          refresh
        end
  end
  def text()
        self.contents.dispose
        self.dispose
        return @text
  end
end

________________________


 
 
 
mjack1234 




Preferowany:
RPG Maker VX

Dołączył: 02 Kwi 2010
Posty: 18
Wysłany: Nie 02 Maj, 2010 19:41
Czy jest możliwość zmodyfikować ten skrypt aby można zwiększyć ilość zapisów gry??
________________________
Chrono Cross.
 
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Nie 02 Maj, 2010 20:56
mjack1234, musiałbyś skorzystać ze skryptu, który całkowicie modyfikuje klasę Scene_File.
Przykładowo :arrow: http://www.ultimateam.pl/viewtopic.php?t=2078
________________________


 
 
 
Tym3k 



Preferowany:
RPG Maker VX

Dołączył: 02 Cze 2010
Posty: 2
Wysłany: Wto 22 Cze, 2010 21:52
A mi nawet jak zrobię ten plik "Zapisy Gry" to pokazuje, że go nadal niema :-(
 
 
BezimiennyKot1 




Preferowany:
RPG Maker VX

Pomógł: 2 razy
Dołączył: 10 Lut 2012
Posty: 36
Skąd: Equestria
Wysłany: Sob 16 Cze, 2012 14:38
Nareszcie wszystkie zapisy w jednym miejscu! :-)
________________________
Pomogłem? Daj "Pomógł"


Spoiler:

 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene