Jump to content
Rpg²S Forum

..::Dark::..

Utenti
  • Posts

    209
  • Joined

  • Last visited

Posts posted by ..::Dark::..

  1. Book Scene

    Descrizione


    Permette al giocatore di leggere/vedere libri che ha raccolto durante il gioco, praticamente grazie ad un documento esterno il programmatore può decidere di far leggere ad esempio il libro che hanno trovato in biblioteca i pg configurando lo script


    Autore


    ForeverZer0
    Blizzard per lo "slice_text"
    Taiine per averlo richiesto

     

    Allegati


    Demo


    Istruzioni per l'uso


    Classe sopra main per copiaincollare lo script.

     

     

    #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    # Book/Library Scene
    # Author: ForeverZer0
    # Version: 1.2
    # Date: 9.1.2010
    #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    #
    # Version History:
    # v. 1.0 9.1.2010
    # - Original version
    # v. 1.1 9.3.2010
    # - Added option for full-screen text
    # - Made the page number window slightly wider
    # v. 1.2 9.25.2010
    # - Added option to simply call scene with the book ID argument and have
    # that book already displayed.
    #
    # Introduction:
    # Calls a scene that will allow player to read through books that they have
    # collected.
    #
    # Features:
    # - Easy to configure, text is read from an external text document
    # - Text will automatically fit itself into the proper size for the window
    # width and pages, regardless of font or font size.
    #
    # Instructions:
    # 1. Fill in the configuration below.
    # 2. Create a new folder within the "Data" folder, and name it "Books".
    # 3. Within this folder, create simple text documents (.txt).
    # 4. Name them EXACTLY as you did for its respective title (below).
    # 5. Turn word-wrap OFF.
    # 6. Create as large as document as you would like, but only break to a new
    # line in between paragraphs, not when the text reaches the edge of the
    # window. Every time a new line is started, it guarantees that the current
    # line will start on a new line in the scene, regardless of the font size.
    #
    # Use the following Script Calls:
    # Books.unlock(BOOK_ID)
    # - Unlocks the book with BOOK_ID
    # $scene = Scene_Book.new
    # - Calls the Book scene.
    # $scene = Scene_Book.new(BOOK_ID)
    # - Calls the book scene. The book with BOOK_ID will already be displayed.
    # This will also disable the book list feature. The book does not have
    # to be unlocked to call this way.
    #
    # Credits/Thanks:
    # ForeverZer0, for the script
    # Blizzard, for the "slice_text" method
    #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    module Books
    	#===============================================================================
    	# BEGIN CONFIGURATION
    	#===============================================================================
    	RETURN_SCENE = Scene_Map
    	# Class of the scene that the game return to after you exit the book scene.
    	SORT_BY_ID = true
    	# If true, the books will be listed in order of their Book ID, else they will
    	# be listed in the order they were aquired.
    	PAGE_TURN_SE = ['046-Book01', 80, 100]
    	# Set to the name of the SE that will be played when a player turns a page.
    	# Set to nil to disable this feature. [FILENAME, VOLUME, PITCH]
    	FULLSCREEN_TEXT = false
    	# If true, the text window will extend over the book list and take up the
    	# entire screen (minus the header).
    	def self.title(book_id)
    		# Here is where you define the labels used for the books. The titles will
    		# be used as the filename to be loaded as well.
    		# when BOOK_ID then 'TITLE'
    		return case book_id
    	when 0 then 'Genesis'
    	when 1 then 'Exodus'
    	when 2 then 'Leviticus'
    	when 3 then 'Numbers'
    	when 4 then 'Deuteronomy'
    	end
    end
    #===============================================================================
    # END CONFIGURATION
    #===============================================================================
    def self.unlock(book_id)
    	# Adds the Book ID to the array.
    	unless $game_system.books.include?(book_id)
    		$game_system.books.push(book_id)
    		# Sorts the array by the Book IDs if so configured.
    		if SORT_BY_ID
    			$game_system.books.sort!
    		end
    	end
    end
    def self.get_text(book_id)
    	# Opens a text document, makes an array whose elements consist of the lines
    	# of the document, and returns it.
    	filename = 'Data/Books/' + title(book_id) + '.txt'
    	begin
    		file = File.open(filename, 'r')
    		rescue
    		raise("Error occured while attempting to open the following file:nn" +
    		"t#{filename}nn" +
    		"Please make sure that the file exist before you continue.")
    	end
    	book = []
    	file.each_line {|line| book.push(line)}
    	file.close
    	return book
    end
    end
    #===============================================================================
    # ** Game_System
    #===============================================================================
    class Game_System
    attr_accessor :books # Array: Stores the IDs of all unlocked books.
    alias zer0_book_init initialize
    def initialize
    	zer0_book_init
    	@books = []
    end
    end
    #===============================================================================
    # ** Scene_Book
    #===============================================================================
    class Scene_Book
    def initialize(book_id = nil)
    	@book_id = book_id
    	@no_list = @book_id != nil
    end
    def main
    	# Create a variable that is set to the window width (depending on config)
    	@window_width = Books::FULLSCREEN_TEXT ? 640 : 512
    	@window_width = 640 if @no_list
    	# Create a blank dummy window.
    	@dummy_window = Window_Base.new(128, 64, 512, 416)
    	# Create Help_Window to display the book titles.
    	@help_window = Window_Base.new(0, 0, 448, 64)
    	@help_window.contents = Bitmap.new(416, 32)
    	# Create the page number window
    	@page_window = Window_Base.new(448, 0, 192, 64)
    	@page_window.contents = Bitmap.new(160, 32)
    	# Create the window that text will be displayed on.
    	x = @window_width == 640 ? 0 : 128
    	@text_window = Window_Base.new(x, 64, @window_width, 416)
    	@text_window.contents = Bitmap.new(@window_width - 32, 384)
    	@text_window.z = @help_window.z + 20
    	@text_window.visible = false
    	# Make a copy of the Books array.
    	@books = $game_system.books.clone
    	# Create instance variable for updating the text window.
    	@update_text = false
    	# Make list of all books, if possible, else make list empty.
    	if @books.empty?
    		help_string = 'No books are currently available.'
    		@command_window = Window_Base.new(0, 64, 128, 416)
    	else
    		help_string = 'Whick book would you like to read?'
    		@titles = []
    		@books.each {|book_id| @titles.push(Books.title(book_id))}
    		@command_window = Window_Command.new(128, @titles)
    		@command_window.height, @command_window.y = 416, 64
    	end
    	# Display text on the help screen
    	@help_window.contents.draw_text(0, 0, 416, 32, help_string, 1)
    	# Create array that holds all the windows
    	@windows = [@dummy_window, @help_window, @text_window,
    	@command_window, @page_window]
    	if @no_list
    		@page_number = 1
    		$game_system.se_play($data_system.decision_se)
    		@help_window.contents.clear
    		@help_window.contents.draw_text(0, 0, 416, 32, Books.title(@book_id), 1)
    		@command_window.active, @update_text = false, true
    		compile_text
    		@text_window.visible = true
    	end
    	Graphics.transition
    	# Main loop
    	loop {Graphics.update; Input.update; update; break if $scene != self}
    	Graphics.freeze
    	@windows.each {|window| window.dispose}
    end
    def update
    	# Update windows.
    	@windows.each {|window| window.update}
    	if @command_window.is_a?(Window_Command) && @command_window.active
    		update_command_window
    		return
    	elsif @update_text
    		update_text_window
    		return
    	end
    	if Input.trigger?(Input::B)
    		$game_system.se_play($data_system.cancel_se)
    		$scene = Books::RETURN_SCENE.new
    	end
    end
    def update_command_window
    	if Input.trigger?(Input::B)
    		$game_system.se_play($data_system.cancel_se)
    		$scene = Books::RETURN_SCENE.new
    	elsif Input.trigger?(Input::C)
    		@page_number = 1
    		$game_system.se_play($data_system.decision_se)
    		@book_id = @books[@command_window.index]
    		@help_window.contents.clear
    		@help_window.contents.draw_text(0, 0, 416, 32, Books.title(@book_id), 1)
    		@command_window.active, @update_text = false, true
    		compile_text
    		@text_window.visible = true
    	end
    end
    def update_text_window
    	if Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
    		old_page = @page_number
    		@page_number += Input.trigger?(Input::LEFT) ? -1 : 1
    		@page_number = [[@page_number, @pages.size].min, 1].max
    		# Play SE if configured as such.
    		if old_page != @page_number && Books::PAGE_TURN_SE != nil
    			se = Books::PAGE_TURN_SE
    			audio = RPG::AudioFile.new(se[0], se[1], se[2])
    			$game_system.se_play(audio)
    		end
    		# Refresh the window
    		refresh_text
    	elsif Input.trigger?(Input::B)
    		$game_system.se_play($data_system.cancel_se)
    		if @no_list
    			$scene = Books::RETURN_SCENE.new
    		else
    			@update_text, @command_window.active = false, true
    			@text_window.visible = false
    		end
    	end
    end
    def compile_text
    	# Gets an array whose elements are the lines of the text document.
    	text = Books.get_text(@book_id)
    	# Iterate over each line of the text. Break each line up into segments that
    	# will fit into the window, then add them all together.
    	@pages, lines = [], []
    	text.each {|paragraph|
    	segment = @text_window.contents.slice_text(paragraph, @window_width - 32)
    	segment.each {|line| lines.push(line)}
    	}
    	# Organizes the lines (12 per page) into pages.
    	page_numbers = (lines.size / 12) + 1
    	(0...page_numbers).each {|i| @pages[i] = lines[i*12, 12]}
    	refresh_text
    end
    def refresh_text
    	[@text_window.contents, @page_window.contents].each {|bitmap| bitmap.clear}
    	# Displays the lines of the current page onto the window.
    	page = @pages[@page_number - 1]
    	page.each_index {|i|
    	@text_window.contents.draw_text(0, i*32, @window_width - 32, 32, page[i])}
    	# Set the proper text to the page screen.
    	string = "Page #{@page_number}/#{@pages.size}"
    	@page_window.contents.draw_text(0, 0, 160, 32, string, 1)
    end
    end
    class Bitmap
    # The slice_text method was created by Blizzard. I take no credit for it.
    def slice_text(text, width)
    	words = text.split(' ')
    	return words if words.size == 1
    	result, current_text = [], words.shift
    	words.each_index {|i|
    	if self.text_size("#{current_text} #{words[i]}").width > width
    		result.push(current_text)
    		current_text = words[i]
    	else
    		current_text = "#{current_text} #{words[i]}"
    	end
    	result.push(current_text) if i >= words.size - 1}
    	return result
    end
    end
    

     



    Bugs e Conflitti Noti

     

    N/A


    Altri Dettagli


    Solo in inglese purtroppo D:

  2. Title Skip

    Descrizione

    Permette di saltare la schermata del titolo

     

    Autore

    Xenres

     

    Allegati

    //

     

    Istruzioni per l'uso

    Creare una nuova classe sopra main e copiaincollare

    #==============================================================================   2.	  # Xenres' Title Skip   3.	  # Version 1.0   4.	  # 2010-11-24   5.	  #------------------------------------------------------------------------------   6.	  # Loads necessary objects and skips to the start map to use as a title screen   7.	  # or whatever.   8.	  #==============================================================================   9.   10.	  class Scene_Title < Scene_Base  11.	  #--------------------------------------------------------------------------  12.	  # * Main Processing  13.	  #--------------------------------------------------------------------------  14.	  def main  15.	  if $BTEST # If battle test  16.	  battle_test # Start battle test  17.	  else # If normal play  18.	  load_database # Load database  19.	  create_game_objects # Create game objects  20.	  load_title_screen # Load title screen ( loads first map )  21.	  end  22.	  end  23.	  #--------------------------------------------------------------------------  24.	  # * Command: Load Title Screen  25.	  #--------------------------------------------------------------------------  26.	  def load_title_screen  27.	  confirm_player_location  28.	  Sound.play_decision  29.	  $game_party.setup_starting_members # Initial party  30.	  $game_map.setup($data_system.start_map_id) # Initial map position  31.	  $game_player.moveto($data_system.start_x, $data_system.start_y)  32.	  $game_player.refresh  33.	  $scene = Scene_Map.new  34.	  Graphics.frame_count = 0  35.	  $game_map.autoplay  36.	  end  37.	  end

     

    Bugs e Conflitti Noti

    N/A

  3. Hai perso tutta la mia stima, per due motivi:

    1)Chrono Trigger è sacro e inviolabile! Chiunque rippi da "IL capolavoro" verrà odiato a vita dal sottoscritto

    2)Esistono già centinaia di migliaia di rip in centinaia di migliaia di topic...

    3)Se rippavate da Chrono Trigger Character Library (gioco per Satellaview) vi sareste risparmiati molta fatica...

     

    Se non si è notato sono un fan di CT che ha finito il gioco almeno (almeno significa "ho perso il conto, ma i finali sono 12 ma è certo che almeno una volta per finale lo ho finito") 12 volte (13 per DS, visto il finale aggiuntivo) per console (tranne per PS1 perché la console mi da problemi) e in due lingue diverse (purtroppo se non fosse stato per lo SNES che si è rotto l'avrei finito anche in giapponese ç.ç) :P

    Credito un certo Kinger556 che sembra colui che le ha uploadate °-°

    Penso di aver detto tutto.

    Lui le ha uploadate, non ho idea di chi sia colui che le ha rippate, trovate e attaccate qua, a qualcuno potrebbero far comodo, stop^^

    OMG guardian mi ha contagiato ;_;

  4. Versus è in progetto da anni, che finiscano prima quello no?

    Comunque il trailer ha solo 4 secondi di nuovo con Lightning in sexy armatura e quel tizio che somiglia in modo impressionante a Xemnas di KH O_O

    Ma mi attira comunque, e se è vero che uscirà prima di Vs...

    Tutti contro la residenza della SE!

  5. Alcuni characters presi da Chrono Trigger.
    Credito un certo Kinger556 che sembra colui che le ha uploadate ?-?


    Ayla:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_210.png
    Lucca:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_3347.png
    Marle:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_4854.png
    Robo:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_2746.png
    Frog:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_822.png
    Chrono:
    http://rpgrevolution.com/forums/uploads/1221178576/gallery_8528_72_376.png



    Se volete elimino lo sfondo in modo da renderlo trasparente. http://www.rpg2s.net/forum/public/style_emoticons/default/sisi.gif

  6. Chissà che non siano stati postati, ?-?
    Girando ho trovato questi chara, spero siano utili a qualcuno *>*
    Super mario:

    http://rpgrevolution.com/forums/uploads/1291242860/gallery_100991_72_3568.pnghttp://rpgrevolution.com/forums/uploads/1291242860/gallery_100991_72_2989.png



    Sora KH
    http://rpgrevolution.com/forums/uploads/1277506408/gallery_27117_72_7412.png

    Vari(vampiro)
    http://rpgrevolution.com/forums/uploads/1237558754/gallery_231_72_14634.png

  7. Bello come bs, ma se per caso ci fosse qualche bug o problema il brutto è che bisogna rivolgersi ad uno scripter esperto, consiglio di farlo ad eventi il bs.

    Non rilevo alcun bug, ed è un bs abbastanza completo.

    A farteo ad eventi hai voglia X°D

     

    E poi qua di scripter non ne mancano ^^

  8. Provata la demo.

    Dopo mesi, secoli(??), anni(???) che non commentavo X°D

    Beh, l'idea di base è molto carina, mi piace la trama, anche se non sono riuscito a passare il boss, ergo il primo consiglio che ti dò è questo: abbassa le statistiche al boss X°D

    Metti che qualcuno abbia evitato un paio di farfalle(io)non riuscirà mai a battere il boss a meno che non abbia trecento kit di soccorso XD

    Poi un altro consiglio: non cercare di mixare insieme risoluzioni diverse.

    Vedere gli alberi sgranati e il resto perfettamente non è il massimo.

    Poi, mhhh...

    Ah, c'era ancora il salva nel menù, se vuoi che si salvi nella casa e nelle statue rimuovilo, ci sono diverse guide su come fare nella sezione tutorial.

    Per il resto molto carino e curato, complimenti^^

    Ah, ci sono anche degli errori nel mapping oltre a quelli sopra citati, ad esempio nella caverna, in cui il pavimento "continua" verso il basso in un rilievo(non sapevo come screennare dal portatile T_T), senza che però continui anche la colonna su cui esso si appoggia.

    Spero di essere stato chiaro, aspetto ulteriori demo ^^

  9. Quello che ho fatto io è così ^^ quello di Guardian è così ^ ^ !^^

    Dai fine OT...

     

    comunque avrei decisamente preferito un disegno su pergamena o su un qualunque altro materiale però senza colori, cioè solo il tratto (non so cono cosa disegnano, matite?XD)... poi fai te!^^

    Hai ragione... per un rpg stile antico sarebbe stato meglio usare una pergamena, mi pare di avere una texture del genere °°

  10. Avete ragione, devo commentare u_u

    Hai trovato chi non se ne intende, quindi non metterti a tirarmi i sorrisi dell'assassino irael *guarda la firma di irael e fugge lontano*

    Beh, la storia non è nè troppo scontata nè originalissima. Invece trovo interessante il fatto degli approfondimenti sulle religioni, le credenze e tutte queste cose qua °ò°

    Molte razze, a quanto vedo o_o

    Cristo, pure le stagioni :lol:

    Ok, chiudo. Appena proverò la demo(è già uscita?)commenterò un po' di più *si rimette ad oziare*

×
×
  • Create New...