Jump to content
Rpg²S Forum

DonDante

Utenti
  • Posts

    464
  • Joined

  • Last visited

Posts posted by DonDante

  1. Premettendo che sto ancora cercando di capire bene l'RGSS3, e che sono totalmente astemio di ogni

    genere di linguaggio di programmazione, mi domandavo se fosse possibile creare uno script per permettere di fare un po d'ordine nel Database.

    Mi spiego meglio:

    Spesso, programmando un gioco, non sappiamo quanti e quali saranno gli oggetti, le armi e le armature totali nel gioco, quindi andiamo ad inserire gli oggetti nel Database in ordine totalmente casuale (almeno per quanto mi riguarda)

    Il problema è che poi, una volta in game, gli oggetti vengono inseriti nell' inventario in ordine crescente di ID creando una certa confusione.

    Non sarebbe possibile creare uno script in cui inserire un Array degli ID per mostrarli poi in quell'ordine?

    Es.:

    L'ID della pozione è il 4.

    Quella della Pozione Superiore è il 3.

    Quella della Pozione Suprema è il 7.

    Quella dell' Antidoto il 5.

    Quindi nello script inseriremo: Mostra[4,3,7,5] E le avremo in quest'ordine.

    Non sono sicuro che sia fattibile, ma sarebbe utile...

     

  2. Ecco, proprio di questo tipo di aiuto avevo bisogno.

    Un dungeon del mio gioco è ambientato tra delle antiche rovine, ormai popolate da piante ed erbacce, tra cui sbucano sporadicamente dei pezzi di muro e di colonne.

    Quello che non riesco a trovare è un indovinello per una statua.

    In pratica, in giro troveremo diverse statuette ed una di queste dovrebbe essere la risposta, che una volta piazzata sul piedistallo apre una porta.

    Quindi, la risposta ll' indovinello dovrebbe essere una cosa che può essere rappresentata da una statuetta e che possa avere delle

    statuette "simili", come ad esempio se la risposta fosse "Leone" potrei fare una statuetta Leone, una statuetta Orso ed una statuetta Lupo.

    E vorrei anche che non fosse un indovinello troppo banale o conosciuto.

     

    Spero di essermi spiegato ed attendo suggerimenti!

  3. Ah, giusto...

     

    Il primo è il Quest Item Based Journal (Shadowmaster):

     

     

    =begin
    ===============================================================================
     Item Based Quest Journal (05/02/2013)
    -------------------------------------------------------------------------------
     Created By: Shadowmaster/Shadowmaster9000/Shadowpasta
     (www.crimson-castle.co.uk)
     Special Thanks: marillmau5 (For coming up with the idea of a item based quest
                                system)
     
    ===============================================================================
     Information
    -------------------------------------------------------------------------------
     This script adds a Quest based Journal, that can be accessed from the main
     menu, or through a script call. Unlike most other Journals, Quests are added
     as items.
     
     Items tagged as Quests will not show up in the normal item scene, and will
     instead show up in the journal scene with new information that can be changed
     to your liking.
     
    ===============================================================================
     How to Use
    -------------------------------------------------------------------------------
     Place this script under Materials, preferably below any item altering scripts.
     If you are using my Expanded Item Categories script, place this one below the
     Expanded Item Categories script.
     
     You can call the journal scene by using the script call:
     
     SceneManager.call(Scene_Journal)
     
     Further down are some options you can change to your liking.
    
    ===============================================================================
     Note Tags
    -------------------------------------------------------------------------------
     Place any of these note tags within a normal item in the database.
     
     <quest>
     Labels the item as a quest to allow it to show up in the Journal Quest List.
     This quest will appear within the Active Quests Category.
     
     <completed>
     Labels the item as a completed quest to allow it to show up in the Journal
     Quest List. This quest will appear within the Completed Quests Category.
     
     <failed>
     Labels the item as a failed quest to allow it to show up in the Journal Quest
     List. This quest will appear within the Failed Quests Category.
     
     <client: "string">
     Replace string with anything you want. You can set a new line within a string
     by using \N.
     
     <location: "string">
     Replace string with anything you want. You can set a new line within a string
     by using \N.
     
     <reward: "string">
     Replace string with anything you want. You can set a new line within a string
     by using \N.
     
     <questdesc: "string">
     Replace string with anything you want. You can set a new line within a string
     by using \N.
     
     TIP: If you leave client, location, reward or questdesc for a quest blank.
     that attribute's name will not show up in the Journal scene. So if you do
     not quests to show for example, the rewards, simply do not tag any of your
     quest items with the <reward: "string"> note tag.
    
    ===============================================================================
     Required
    -------------------------------------------------------------------------------
     Nothing.
     
    ===============================================================================
     Change log
    -------------------------------------------------------------------------------
     v1.1: Fixed quest list text from getting cut off (05/02/2013)
     v1.0: First release. (03/02/2013)
    
    ===============================================================================
     Terms of Use
    -------------------------------------------------------------------------------
     * Free to use for both commercial and non-commerical projects.
     * Do not claim this as your own.
     * You're free to post this on other websites, but please credit me and keep
     the header intact.
     * Creditting me in the game's credits would be appreciated.
    
    ===============================================================================
    =end
    $imported = {} if $imported.nil?
    $imported["JournalQuestItems"] = true
    
    module Journal
      
    #==============================================================================
    # ** Menu Access
    #------------------------------------------------------------------------------
    #  If set to true, the Journal can be accessed from the main menu, and will be
    #  placed under all of the main commands (Item, Skill, Equip and Status). If
    #  set to false, you will need to call the journal scene through a script call:
    #  
    #  SceneManager.call(Scene_Journal)
    #==============================================================================
      
      Menu_Access = true
      
    #==============================================================================
    # ** Journal Name
    #------------------------------------------------------------------------------
    #  Sets the name of the Journal in the main menu. You don't need to worry about
    #  this if you have set Menu Access to false.
    #==============================================================================
      
     Journal_Name = "Quest"  
    
    #==============================================================================
    # ** List of Categories
    #------------------------------------------------------------------------------
    #  Below are the list of categories available in this script. You can change
    #  the order of the categories to your pleasing, as well as their names and
    #  even remove any categories you don't want. I will record the list of all
    #  available categories here if in case you forget any of them.
    #
    #  :all              (Displays all quests)
    #  :active           (Displays active quests)
    #  :completed        (Displays completed quests)
    #  :failed           (Displays all failed quests)
    #==============================================================================  
    
      Categories =[ # Do not remove this.
          [:all, "Tutte le missioni"],
          [:active, "Attive"],
          [:completed, "Complete"],
          [:failed, "Fallite"],
        ] # Do not remove this.
    
    #==============================================================================
    # ** Vocab Info
    #------------------------------------------------------------------------------
    #  This allows you to change the names of the different atrributes given to
    #  quests. Because the quests will not show their attributes if they are not
    #  given any, there's no reason to remove any of the atrributes from the list
    #  below. I will record all of the attributes here anyways if in case you
    #  delete any of them and forgot what they were.
    #
    #  :client     => "Client:",      (Text used for Client)
    #  :location   => "Location:",    (Text used for Location)
    #  :reward     => "Rewards:",     (Text used for Rewards)
    #==============================================================================     
    
      Vocab_Info ={ # Do not remove this.
          :client     => "Cliente:",      # Text used for Client.
          :location   => "Luogo:",    # Text used for Location.
          :reward     => "Ricompensa:",     # Text used for Rewards.
        } # Do not remove this.
        
    #==============================================================================
    # ** Quest Description Font Sizes
    #------------------------------------------------------------------------------
    #  Sets the font size of the text displayed for a quest's descripton.
    #==============================================================================
      
     QuestDesc_FontSize = 20 
    
    #==============================================================================
    # ** DO NOT edit anything below this unless if you know what you're doing!
    #==============================================================================    
        
    end
    
    #==============================================================================
    # ** Vocab
    #------------------------------------------------------------------------------
    #  This module defines terms and messages. It defines some data as constant
    # variables. Terms in the database are obtained from $data_system.
    #==============================================================================
    
    module Vocab
      #--------------------------------------------------------------------------
      # Defining Journal Vocab Type
      #--------------------------------------------------------------------------
      def self.JournalVocab(type)
        return Journal::Vocab_Info[type]
      end
    end
    
    #==============================================================================
    # ** RPG::BaseItem
    #------------------------------------------------------------------------------
    #  This class defines attributes for various objects. It is the  superclass of
    #  actor, class, skill, item, weapon, armor, enemy, and state classes.
    #==============================================================================
    
    class RPG::UsableItem
      #--------------------------------------------------------------------------
      # Public Instance Variables
      #--------------------------------------------------------------------------
      attr_accessor :client
      attr_accessor :location
      attr_accessor :reward
      attr_accessor :questdes
      #--------------------------------------------------------------------------
      # Defining Quest Attribute
      #--------------------------------------------------------------------------
      def quest?
    	if @note =~ /<quest>/
    	  return true
    	else
    	  return false
    	end
      end
      #--------------------------------------------------------------------------
      # Defining Quest Completed Attribute
      #--------------------------------------------------------------------------
      def quest_completed?
    	if @note =~ /<completed>/
    	  return true
    	else
    	  return false
    	end
      end
      #--------------------------------------------------------------------------
      # Defining Quest Failed Attribute
      #--------------------------------------------------------------------------
      def quest_failed?
    	if @note =~ /<failed>/
    	  return true
    	else
    	  return false
    	end
      end
      #--------------------------------------------------------------------------
      # Defining Client Attribute
      #--------------------------------------------------------------------------
      def client
        if note[/<(client: )\"(.+?)\">/im]
            @client = $2
            @client.gsub!(/[\r\n]/, "")
            @client.gsub!(/\\[Nn]/, "\n")
          end
          @client = "" unless @client.is_a?(String)
        @client
      end
      #--------------------------------------------------------------------------
      # Defining Location Attribute
      #--------------------------------------------------------------------------
      def location
        if note[/<(location: )\"(.+?)\">/im]
            @location = $2
            @location.gsub!(/[\r\n]/, "")
            @location.gsub!(/\\[Nn]/, "\n")
          end
          @location = "" unless @location.is_a?(String)
        @location
      end
      #--------------------------------------------------------------------------
      # Defining Reward Attribute
      #--------------------------------------------------------------------------  
      def reward
        if note[/<(reward: )\"(.+?)\">/im]
            @reward = $2
            @reward.gsub!(/[\r\n]/, "")
            @reward.gsub!(/\\[Nn]/, "\n")
          end
          @reward = "" unless @reward.is_a?(String)
        @reward
      end
      #--------------------------------------------------------------------------
      # Defining Quest Description Attribute
      #--------------------------------------------------------------------------
      def questdesc
        if note[/<(questdesc: )\"(.+?)\">/im]
            @questdesc = $2
            @questdesc.gsub!(/[\r\n]/, "")
            @questdesc.gsub!(/\\[Nn]/, "\n")
          end
          @questdesc = "" unless @questdesc.is_a?(String)
        @questdesc
      end
    end
      
    #==============================================================================
    # ** DO NOT edit anything below this unless if you know what you're doing!
    #==============================================================================
    
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  This command window appears on the menu screen.
    #==============================================================================
    
    class Window_MenuCommand < Window_Command
      #--------------------------------------------------------------------------
      # * Add Main Commands to List
      #--------------------------------------------------------------------------
      alias journal_add_main_commands add_main_commands
      def add_main_commands
        journal_add_main_commands
        if Journal::Menu_Access
          add_command(Journal::Journal_Name, :game_journal)
        end
      end
    end
    
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #  This class performs the menu screen processing.
    #==============================================================================
    
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Create Command Window
      #--------------------------------------------------------------------------
      alias journal_create_command_window create_command_window
      def create_command_window
        journal_create_command_window
        @command_window.set_handler(:game_journal, method(:command_game_journal))
      end
      #--------------------------------------------------------------------------
      # * [Journal] Command
      #--------------------------------------------------------------------------
      def command_game_journal
        SceneManager.call(Scene_Journal)
      end
    end
    
    #==============================================================================
    # ** Window_HorzCommand
    #------------------------------------------------------------------------------
    #  This is a command window for the horizontal selection format.
    #==============================================================================
    
    class Window_HorzCommand < Window_Command
      #--------------------------------------------------------------------------
      # * Set Leading Digits
      #--------------------------------------------------------------------------
      def top_col=(col)
        col = 0 if col < 0
        self.ox = col * (item_width + spacing)
      end
    end
    
    #==============================================================================
    # ** Window_ItemList
    #------------------------------------------------------------------------------
    #  This window displays a list of party items on the item screen.
    #==============================================================================
    
    class Window_ItemList < Window_Selectable
      #--------------------------------------------------------------------------
      # * Include in Item List?
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :all_item
          item.is_a?(RPG::Item) && !item.quest? && !item.quest_completed? && !item.quest_failed? || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
        when :item
          item.is_a?(RPG::Item) && !item.key_item? && !item.quest? && !item.quest_completed? && !item.quest_failed? 
        when :weapon
          item.is_a?(RPG::Weapon)
        when :armor
          item.is_a?(RPG::Armor)
        when :armor_shield
          item.is_a?(RPG::Armor) && item.armor_shield?
        when :armor_head
          item.is_a?(RPG::Armor) && item.armor_head?
        when :armor_body
          item.is_a?(RPG::Armor) && item.armor_body?
        when :armor_accessory
          item.is_a?(RPG::Armor) && item.armor_accessory?
        when :key_item
          item.is_a?(RPG::Item) && item.key_item? && !item.quest? && !item.quest_completed? && !item.quest_failed? 
        else
          false
        end
      end
    end
    
    #==============================================================================
    # ** Window_JournalCategory
    #------------------------------------------------------------------------------
    #  This window is for selecting a category of quests on the journal screen.
    #==============================================================================
    
    class Window_JournalCategory < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Public Instance Variables
      #--------------------------------------------------------------------------
      attr_reader   :item_window
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0)
      end
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
        192
      end
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        1
      end
      #--------------------------------------------------------------------------
      # * Move Cursor Right
      #--------------------------------------------------------------------------
      def cursor_right(wrap = false)
        if col_max >= 1 && (index < item_max - 1 || (wrap && horizontal?))
          select((index + 1) % item_max)
        end
      end
      #--------------------------------------------------------------------------
      # * Move Cursor Left
      #--------------------------------------------------------------------------
      def cursor_left(wrap = false)
        if col_max >= 1 && (index > 0 || (wrap && horizontal?))
          select((index - 1 + item_max) % item_max)
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        super
        @item_window.category = current_symbol if @item_window
      end
      #--------------------------------------------------------------------------
      # * Create Command List
      #--------------------------------------------------------------------------
      def make_command_list
        Journal::Categories.each { |symbol, label|
              add_command(label, symbol)
            }
      end
      #--------------------------------------------------------------------------
      # * Set Item Window
      #--------------------------------------------------------------------------
      def item_window=(item_window)
        @item_window = item_window
        update
      end
    end
    
    #==============================================================================
    # ** Window_JournalList
    #------------------------------------------------------------------------------
    #  This window displays a list of quests on the journal screen.
    #==============================================================================
    
    class Window_JournalList < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(x, y, width, height)
        super
        @category = :none
        @data = []
      end
      #--------------------------------------------------------------------------
      # * Set Category
      #--------------------------------------------------------------------------
      def category=(category)
        return if @category == category
        @category = category
        refresh
        self.oy = 0
      end
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        return 1
      end
      #--------------------------------------------------------------------------
      # * Get Number of Items
      #--------------------------------------------------------------------------
      def item_max
        @data ? @data.size : 1
      end
      #--------------------------------------------------------------------------
      # * Get Item
      #--------------------------------------------------------------------------
      def item
        @data && index >= 0 ? @data[index] : nil
      end
      #--------------------------------------------------------------------------
      # * Get Activation State of Selection Item
      #--------------------------------------------------------------------------
      def current_item_enabled?
        enable?(@data[index])
      end
      #--------------------------------------------------------------------------
      # * Include in Item List?
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :all
          item.is_a?(RPG::Item) && item.quest? || item.is_a?(RPG::Item) && item.quest_completed? || item.is_a?(RPG::Item) && item.quest_failed?
        when :active
          item.is_a?(RPG::Item) && item.quest?
        when :completed
          item.is_a?(RPG::Item) && item.quest_completed?
        when :failed
          item.is_a?(RPG::Item) && item.quest_failed?
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Display in Enabled State?
      #--------------------------------------------------------------------------
      def enable?(item)
        $game_party.usable?(item)
      end
      #--------------------------------------------------------------------------
      # * Create Item List
      #--------------------------------------------------------------------------
      def make_item_list
        @data = $game_party.all_items.select {|item| include?(item) }
        @data.push(nil) if include?(nil)
      end
      #--------------------------------------------------------------------------
      # * Restore Previous Selection Position
      #--------------------------------------------------------------------------
      def select_last
        select(@data.index($game_party.last_item.object) || 0)
      end
      #--------------------------------------------------------------------------
      # * Draw Item
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
        if item
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(item, rect.x, rect.y)
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Item Name
      #     enabled : Enabled flag. When false, draw semi-transparently.
      #--------------------------------------------------------------------------
      def draw_item_name(item, x, y, width = 180)
        return unless item
        change_color(normal_color)
        draw_text(x, y, width, line_height, item.name)
      end
      #--------------------------------------------------------------------------
      # * Processing When OK Button Is Pressed
      #--------------------------------------------------------------------------
      def process_ok
      end
      #--------------------------------------------------------------------------
      # * Update Help Text
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_item(item)
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        make_item_list
        create_contents
        draw_all_items
      end
    end
    
    #==============================================================================
    # ** Window_JournalStatus
    #------------------------------------------------------------------------------
    #  This window displays full quest information on the journal screen.
    #==============================================================================
    
    class Window_JournalStatus < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(dx, dy, item_window)
        super(dx, dy, Graphics.width - dx, Graphics.height)
        @item_window = item_window
        @item = nil
        refresh
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        super
        update_item(@item_window.item)
      end
      #--------------------------------------------------------------------------
      # * Update Item Window
      #--------------------------------------------------------------------------
      def update_item(item)
        return if @item == item
        @item = item
        refresh
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        reset_font_settings
        draw_quest_info
      end
      #--------------------------------------------------------------------------
      # * Draw Text with Control Characters
      #--------------------------------------------------------------------------
      def draw_text_ex(x, y, text)
        text = convert_escape_characters(text)
        pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
        process_character(text.slice!(0, 1), text, pos) until text.empty?
      end
      #--------------------------------------------------------------------------
      # * Character Processing
      #     c    : Characters
      #     text : A character string buffer in drawing processing (destructive)
      #     pos  : Draw position {:x, :y, :new_x, :height}
      #--------------------------------------------------------------------------
      def process_character(c, text, pos)
        case c
        when "\n"   # New line
          process_new_line(text, pos)
          @line_mult += 1
        when "\f"   # New page
          process_new_page(text, pos)
        when "\e"   # Control character
          process_escape_character(obtain_escape_code(text), text, pos)
        else        # Normal character
          process_normal_character(c, pos)
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Quest Information
      #--------------------------------------------------------------------------
      def draw_quest_info
        return unless @item.is_a?(RPG::Item)
        dx = 0; dy = 0
        dw = contents.width - 96
        @line_mult = 0
        contents.font.size = 28
        draw_name(dx, dy + line_height * @line_mult, dw)
        draw_horz_line(line_height * @line_mult)
        contents.font.size = 20
        draw_client(dx, dy + line_height * @line_mult, dw)
        draw_location(dx, dy + line_height * @line_mult, dw)
        draw_reward(dx, dy + line_height * @line_mult, dw)
        if @item.questdesc != ""
        draw_horz_line(line_height * @line_mult) if @item.client != "" || @item.location != "" || @item.reward != ""
        end
        contents.font.size = Journal::QuestDesc_FontSize
        draw_description(dx, dy + line_height * @line_mult, dw)
      end
      #--------------------------------------------------------------------------
      # * Draw Horizontal Line
      #--------------------------------------------------------------------------
      def draw_horz_line(y)
        line_y = y + line_height / 2 - 1
        contents.fill_rect(0, line_y, contents_width, 2, line_color)
        @line_mult += 1
      end
      #--------------------------------------------------------------------------
      # * Get Color of Horizontal Line
      #--------------------------------------------------------------------------
      def line_color
        color = normal_color
        color.alpha = 48
        color
      end
      #--------------------------------------------------------------------------
      # * Draw Quest Name
      #--------------------------------------------------------------------------
      def draw_name(dx, dy, dw)
        change_color(system_color)
        change_color(normal_color)
        draw_text(dx+4, dy, contents.width, line_height + 4, @item.name, 1)
        @line_mult += 1
      end
      #--------------------------------------------------------------------------
      # * Draw Clients
      #--------------------------------------------------------------------------
      def draw_client(dx, dy, dw)
        change_color(system_color)
        if @item.client != ""
        draw_text(dx+4, dy, dw-152, line_height, Vocab::JournalVocab(:client))
        change_color(normal_color)
        draw_text_ex(dx+88, dy, @item.client)
        @line_mult += 1
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Locations
      #--------------------------------------------------------------------------
      def draw_location(dx, dy, dw)
        change_color(system_color)
        if @item.location != ""
        draw_text(dx+4, dy, dw-152, line_height, Vocab::JournalVocab(:location))
        change_color(normal_color)
        draw_text_ex(dx+88, dy, @item.location)
        @line_mult += 1
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Rewards
      #--------------------------------------------------------------------------
      def draw_reward(dx, dy, dw)
        change_color(system_color)
        if @item.reward != ""
        draw_text(dx+4, dy, dw-152, line_height, Vocab::JournalVocab(:reward))
        change_color(normal_color)
        draw_text_ex(dx+88, dy, @item.reward)
        @line_mult += 1
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Quest Description
      #--------------------------------------------------------------------------
      def draw_description(dx, dy, dw)
        if @item.questdesc != ""
        change_color(normal_color)
        draw_text_ex(dx+4, dy, @item.questdesc)
        end
      end
    end
    
    #==============================================================================
    # ** Scene_Journal
    #------------------------------------------------------------------------------
    #  This class performs the journal screen processing.
    #==============================================================================
    
    class Scene_Journal < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Start Processing
      #--------------------------------------------------------------------------
      def start
        super
        create_category_window
        create_item_window
        create_status_window
      end
      #--------------------------------------------------------------------------
      # * Create Category Window
      #--------------------------------------------------------------------------
      def create_category_window
        @category_window = Window_JournalCategory.new
        @category_window.viewport = @viewport
        @category_window.set_handler(:ok,     method(:on_category_ok))
        @category_window.set_handler(:cancel, method(:return_scene))
      end
      #--------------------------------------------------------------------------
      # * Create Item Window
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @category_window.y + @category_window.height
        wh = Graphics.height - wy
        @item_window = Window_JournalList.new(0, wy, 192, wh)
        @item_window.viewport = @viewport
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @category_window.item_window = @item_window
      end
      #--------------------------------------------------------------------------
      # * Create Status Window
      #--------------------------------------------------------------------------
      def create_status_window
        wx = @category_window.width
        wy = @category_window.y
        @status_window = Window_JournalStatus.new(wx, wy, @item_window)
        @status_window.viewport = @viewport
      end
      #--------------------------------------------------------------------------
      # * Category [OK]
      #--------------------------------------------------------------------------
      def on_category_ok
        @item_window.activate
        @item_window.select_last
      end
      #--------------------------------------------------------------------------
      # * Item [Cancel]
      #--------------------------------------------------------------------------
      def on_item_cancel
        @item_window.unselect
        @category_window.activate
      end
    end
    

     

     

     

     

    Il secondo, invece è l' Item Command (Victor)

     

     

    #==============================================================================
    # ** Victor Engine - Item Command
    #------------------------------------------------------------------------------
    # Author : Victor Sant
    #
    # Version History:
    #  v 1.00 - 2012.08.05 > First release
    #------------------------------------------------------------------------------
    #  This scripts allows to setup different item types and to setup commands
    # where the player can select only items from a pre-defined type. It
    # also allows to setup different items cattegories on the item menu
    #------------------------------------------------------------------------------
    # Compatibility
    #   Requires the script 'Victor Engine - Basic Module' v 1.00 or higher
    #
    # * Overwrite methods
    #   class RPG::Item < RPG::UsableItem
    #     def key_item?
    #
    #   class Window_ItemCategory < Window_HorzCommand
    #     def col_max
    #     def make_command_list
    #
    #   class Window_ItemList < Window_Selectable
    #     def include?(item)
    #
    #   class Window_BattleItem < Window_ItemList
    #     def include?(item)
    #
    #   class Window_ActorCommand < Window_Command
    #     def add_item_command
    #
    # * Alias methods
    #   class Game_System
    #     def initialize
    #
    #   class Scene_Battle < Scene_Base
    #     def command_item
    #
    #------------------------------------------------------------------------------
    # Instructions:
    #  To instal the script, open you script editor and paste this script on
    #  a new section bellow the Materials section. This script must also
    #  be bellow the script 'Victor Engine - Basic'
    #
    #------------------------------------------------------------------------------
    # Actors, Classes, Weapons, Armors and States note tags:
    #   Tags to be used on Actors, Classes, Weapons, Armors and States note boxes.
    #
    #  <usable item type: x>
    #  <usable item type: x, x>
    #   Setup a list of usable item type for the actor.
    #     x : item type id
    #
    #------------------------------------------------------------------------------
    # Items, Weapons and Armors note tags:
    #   Tags to be used on Items, Weapons and Armors note boxes.
    #
    #  <item type: x>
    #  <item type: x, x>
    #   Setup a list of item type ids for the item.
    #     x : item type id
    #
    #------------------------------------------------------------------------------
    # Additional instructions:
    #
    #  When adding the <usable item type: x> tag, the default item command will
    #  be removed, if you want to have the custom item types + the default
    #  item command, add the default command as a usable type with the tag.
    #
    #  When adding the <item type: x> tag, the database setup for item will be
    #  ignored, if you want to add multiple types while keeping the database type
    #  (Normal or Key Item), add them as item type using the tag
    #
    #  Assigin the tag <item type: x> for equipment will not make them usable.
    #  Just will list them within the item type set.
    #
    #==============================================================================
    
    #==============================================================================
    # ** Victor Engine
    #------------------------------------------------------------------------------
    #   Setting module for the Victor Engine
    #==============================================================================
    
    module Victor_Engine
      #--------------------------------------------------------------------------
      # * Initializing $data_system. Don't change.
      #--------------------------------------------------------------------------
      $data_system = load_data('Data/System.rvdata2')
      #--------------------------------------------------------------------------
      # * Setup the list of options available on the Items menu
      #   add the item type set on VE_ITEM_TYPES.
      #--------------------------------------------------------------------------
      VE_MENU_LIST = [ :cure, :arnesi, :weapon, :equip, :acc, 
      :materiale, :key_item ]
      #--------------------------------------------------------------------------
      # * Setup the item types
      #   Set here the values for the new item types.
      #     type: {id: x, name: y, help: z},
      #     type:    : item type, used on the VE_MENU_LIST
      #     id: x    : type id, used on the note tags to assign a item type
      #     name: y  : Name displayed on the command and category windows
      #     help: z  : Help message displayed on the item menu
      #--------------------------------------------------------------------------
      VE_ITEM_TYPES = {
        # These are the settings for default items and key items, avoid change
        item:      {id: 1, name: Vocab::item,     help: "List of all Items"},
        key_item:  {id: 2, name: Vocab::key_item, help: "Oggetti Missione"},
        weapon:    {id: 3, name: Vocab::weapon,   help: "Tutte le armi"},
        armor:     {id: 4, name: Vocab::armor,    help: "Tutti gli Equipaggiamenti"},
        # type:   {id: x, name: y, help: z},
        cure:      {id: 5, name: "Cure", help: "Raccolta di Cure"},
        arnesi:    {id: 6, name: "Arnesi",  help: "Arnesi utili in battaglia"},
        materiale: {id: 7, name: "Grezzi",  help: "Lista di materiali"},
        acc:       {id: 8, name: "Equip",  help: "Lista di accessori"},
        equip:     {id: 9, name: "Corpo",  help: "Lista di equipaggiamento per il corpo"},
       
        
        
      } # Don't remove
      #--------------------------------------------------------------------------
      # * Setup non usable item display on battle
      #   If true, not usable items will be displayed in battle.
      #--------------------------------------------------------------------------
      VE_SHOW_NON_USABLE = false
      #--------------------------------------------------------------------------
      # * required
      #   This method checks for the existance of the basic module and other
      #   VE scripts required for this script to work, don't edit this
      #--------------------------------------------------------------------------
      def self.required(name, req, version, type = nil)
        if !$imported[:ve_basic_module]
          msg = "The script '%s' requires the script\n"
          msg += "'VE - Basic Module' v%s or higher above it to work properly\n"
          msg += "Go to http://victorscripts.wordpress.com/ to download this script."
          msgbox(sprintf(msg, self.script_name(name), version))
          exit
        else
          self.required_script(name, req, version, type)
        end
      end
      #--------------------------------------------------------------------------
      # * script_name
      #   Get the script name base on the imported value
      #--------------------------------------------------------------------------
      def self.script_name(name, ext = "VE")
        name = name.to_s.gsub("_", " ").upcase.split
        name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
        name.join(" ")
      end
    end
    
    $imported ||= {}
    $imported[:ve_item_command] = 1.00
    Victor_Engine.required(:ve_item_command, :ve_basic_module, 1.00, :above)
    
    #==============================================================================
    # ** RPG::Item
    #------------------------------------------------------------------------------
    #  This is the data class for items.
    #==============================================================================
    
    class RPG::Item < RPG::UsableItem
      #--------------------------------------------------------------------------
      # * Overwrite method: key_item?
      #--------------------------------------------------------------------------
      def key_item?
        type_set.include?(VE_ITEM_TYPES[:key_item][:id])
      end
      #--------------------------------------------------------------------------
      # * New method: normal_item?
      #--------------------------------------------------------------------------
      def normal_item?
        type_set.include?(VE_ITEM_TYPES[:item][:id])
      end
      #--------------------------------------------------------------------------
      # * New method: type_set
      #--------------------------------------------------------------------------
      def type_set
        if note =~ /<ITEM TYPE: ((?:\d+ *,? *)+)>/i
          $1.scan(/(\d+)/i).inject([]) {|r, i|  r += i }.collect {|i| i.to_i }
        else
          [itype_id]
        end
      end
      #--------------------------------------------------------------------------
      # * New method: itype_id?
      #--------------------------------------------------------------------------
      def itype_id?(symbol)
        type_set.include?(VE_ITEM_TYPES[symbol][:id])
      end
    end
    
    #==============================================================================
    # ** RPG::EquipItem
    #------------------------------------------------------------------------------
    #  This is the superclass of weapons and armor.
    #==============================================================================
    
    class RPG::EquipItem < RPG::BaseItem
      #--------------------------------------------------------------------------
      # * New method: type_set
      #--------------------------------------------------------------------------
      def type_set
        if note =~ /<ITEM TYPE: ((?:\d+ *,? *)+)>/i
          $1.scan(/(\d+)/i).inject([]) {|r, i|  r += i }.collect {|i| i.to_i }
        else
          []
        end
      end
      #--------------------------------------------------------------------------
      # * New method: itype_id?
      #--------------------------------------------------------------------------
      def itype_id?(symbol)
        type_set.include?(VE_ITEM_TYPES[symbol][:id])
      end
    end
    
    #==============================================================================
    # ** Game_System
    #------------------------------------------------------------------------------
    #  This class handles system-related data. Also manages vehicles and BGM, etc.
    # The instance of this class is referenced by $game_system.
    #==============================================================================
    
    class Game_System
      #--------------------------------------------------------------------------
      # * Public Instance Variables
      #--------------------------------------------------------------------------
      attr_accessor :menu_list
      #--------------------------------------------------------------------------
      # * Alias method: initialize
      #--------------------------------------------------------------------------
      alias :initialize_ve_item_command :initialize
      def initialize
        initialize_ve_item_command
        @menu_list = VE_MENU_LIST.dup
      end
    end
    
    #==============================================================================
    # ** Game_Actor
    #------------------------------------------------------------------------------
    #  This class handles actors. It's used within the Game_Actors class
    # ($game_actors) and referenced by the Game_Party class ($game_party).
    #==============================================================================
    
    class Game_Actor < Game_Battler
      #--------------------------------------------------------------------------
      # * New method: added_item_types
      #--------------------------------------------------------------------------
      def added_item_types
        if note =~ /<USABLE ITEM TYPE: ((?:\d+ *,? *)+)>/i
          get_item_types($1)
        else
          [:item]
        end
      end
      #--------------------------------------------------------------------------
      # * New method: get_item_types
      #--------------------------------------------------------------------------
      def get_item_types(value)
        list = get_itype_id(value).sort
        type = VE_ITEM_TYPES
        type.keys.select {|symbol| list.include?(type[symbol][:id])  }
      end
      #--------------------------------------------------------------------------
      # * New method: get_itype_id
      #--------------------------------------------------------------------------
      def get_itype_id(value)
        value.scan(/(\d+)/i).inject([]) {|r, i|  r += i }.collect {|i| i.to_i }
      end
    end
    
    #==============================================================================
    # ** Window_ItemCategory
    #------------------------------------------------------------------------------
    #  This window is for selecting a category of normal items and equipment
    # on the item screen or shop screen.
    #==============================================================================
    
    class Window_ItemCategory < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Overwrite method: col_max
      #--------------------------------------------------------------------------
      def col_max
        $game_system.menu_list.size
      end
      #--------------------------------------------------------------------------
      # * Overwrite method: make_command_list
      #--------------------------------------------------------------------------
      def make_command_list
        $game_system.menu_list.each do |symbol|
          value = VE_ITEM_TYPES[symbol]
          add_command(value[:name], symbol, true, value[:help])
        end
      end
      #--------------------------------------------------------------------------
      # * New method: update_help
      #--------------------------------------------------------------------------
      def update_help
        text = current_ext ? current_ext : ""
        @help_window.set_text(text)
      end  
    end
    
    #==============================================================================
    # ** Window_ItemList
    #------------------------------------------------------------------------------
    #  This window displays a list of party items on the item screen.
    #==============================================================================
    
    class Window_ItemList < Window_Selectable
      #--------------------------------------------------------------------------
      # * Overwrite method: include?
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :item
          item.is_a?(RPG::Item) && item.normal_item?
        when :key_item
          item.is_a?(RPG::Item) && item.key_item?
        when :weapon
          item.is_a?(RPG::Weapon)
        when :armor
          item.is_a?(RPG::Armor)
        else
          item && item.itype_id?(@category)
        end
      end
    end
    
    #==============================================================================
    # ** Window_BattleItem
    #------------------------------------------------------------------------------
    #  This window is for selecting items to use in the battle window.
    #==============================================================================
    
    class Window_BattleItem < Window_ItemList
      #--------------------------------------------------------------------------
      # * Overwrite method: include?
      #--------------------------------------------------------------------------
      def include?(item)
        item && item.itype_id?(@category) && (VE_SHOW_NON_USABLE ||
        $game_party.usable?(item))
      end
    end
    
    #==============================================================================
    # ** Window_ActorCommand
    #------------------------------------------------------------------------------
    #  This window is used to select actor commands, such as "Attack" or "Skill".
    #==============================================================================
    
    class Window_ActorCommand < Window_Command
      #--------------------------------------------------------------------------
      # * Overwrite method: add_item_command
      #--------------------------------------------------------------------------
      def add_item_command
        @actor.added_item_types.each do |symbol|
          value = VE_ITEM_TYPES[symbol]
          add_command(value[:name], :item, true, value[:id])
        end    
      end
      #--------------------------------------------------------------------------
      # * New method: get_category
      #--------------------------------------------------------------------------
      def get_category
        type = VE_ITEM_TYPES
        type.keys.select {|symbol| current_ext == type[symbol][:id] }.first
      end
    end
    
    #==============================================================================
    # ** Scene_Battle
    #------------------------------------------------------------------------------
    #  This class performs battle screen processing.
    #==============================================================================
    
    class Scene_Battle < Scene_Base
      #--------------------------------------------------------------------------
      # * Alias method: command_item
      #--------------------------------------------------------------------------
      alias :command_item_ve_item_command :command_item
      def command_item
        @item_window.category = @actor_command_window.get_category
        command_item_ve_item_command
      end
    end
    
    

     

     

     

  4. Premetto che ho già risolto il problema, ma volevo capire perchè succedeva...

     

    Ho, nel mio progetto, due script diversi che lavorano tramite notetag inserite nelle note degli oggetti.

    Se metto il primo "Sopra" al secondo, nessuno dei due funziona.

    Viceversa, invertendo l'ordine nessuno dei due da problemi...

     

    Ora: gli script sono di autori diversi, quindi non è necessario l'utilizzo di uno per usare l'altro.

    Stavo cercando di capire, a titolo puramente informativo, per quale oscura ragione questo succede in modo da iniziare ad imparare come funzionano sti benedetti Script...

     

    qualcuno ha idea di cosa possa essere?

  5. O cavolo! C'è un problema...

    Pare che lo script funzioni solo nella mappa in cui abbiamo impostato l'inizio giocatore.

    Inoltre, il gioco crasha miseramente quando abbandoniamo una mappa se questa ha un icona visibile.

    Non capisco perchè, ma appena lo capisco aggiusto il primo post con lo script...

    Se avete suggerimenti, ben vengano...

  6. Icon on Map

    Descrizione

    Permette di utilizzare la grafica di una qualsiasi icona del dtabase come evento grafico.

    Autore

    Deity

    Allegati

    N/A

     

    Istruzioni per l'uso

    Tutto all'interno dello script

    Script

     

    #════════════════════════════════════════════════════════════════#
    # Script: Icons on Map #
    # by Deity #
    #════════════════════════════════════════════════════════════════#
    # Description: #
    # This Script allow you to show Icons on Events. #
    #════════════════════════════════════════════════════════════════#
    # Using: #
    # To create an icon on a event you have to add a comment with #
    # this text: #
    # Iconid: iconid #
    # Iconvisibility: true or false #
    # Iconpriority: 0 or 1 #
    # Iconid = Id of the icon in the iconset #
    # Iconvisibility = Visibility of the icon at the beginning #
    # Iconpriority = Layer for the icon. 1 = above player 0 = below #
    # #
    # Commands: #
    # icon_visible(id,status) #
    # This command can switch the visibility of an icon on the map. #
    # id should be replaced with the ID of the Event with the comment#
    # and status with true or false. #
    # #
    # Example: #
    # Iconid: 1 #
    # Iconvisibility: true #
    # Iconpriority: 0 #
    # => This comment would create an icon of a potion which is #
    # showed if you enter the map and the potion would be below the #
    # player. #
    #════════════════════════════════════════════════════════════════#
    class Game_Map
    attr_accessor :map_icons
    alias initialize_icons initialize unless $@
    def initialize
    initialize_icons
    @map_icons = {}
    end
    end
    class Spriteset_Map
    alias initialize_icon initialize unless $@
    def initialize
    @icons = []
    setup_icon if $game_map.map_icons[$game_map.map_id].nil?
    initialize_icon
    draw_icons
    end
    def draw_icons
    for i in $game_map.map_icons[$game_map.map_id]
    @icons.push(Map_Event_Icon.new(i[0],i[1],i[2],i[3],@viewport1,$game_map.map_icons[$game_map.map_id].index(i)))
    end
    end
    alias dispose_icons dispose unless $@
    def dispose
    dispose_icons
    for icon in @icons
    icon.dispose
    end
    end
    alias update_icons update unless $@
    def update
    update_icons
    for icon in @icons
    icon.update
    end
    end
    def setup_icon
    $game_map.map_icons[$game_map.map_id] = []
    for event in $game_map.events.values
    id = 0
    priot = 0
    status = false
    com = ""
    for list in event.list
    next if list.code != 108 && list.code != 408
    for comment in list.parameters
    com = com + " " + comment
    end
    end
    com = com.split
    if com.include?("Iconid:")
    icon = com[com.index("Iconid:")+1].to_i
    if com.include?("Iconvisibility:")
    status = eval(com[com.index("Iconvisibility:")+1])
    end
    if com.include?("Iconpriority:")
    priot = com[com.index("Iconpriority:")+1].to_i
    end
    $game_map.map_icons[$game_map.map_id].push([event,icon,status,priot,event.id])
    end
    end
    end
    end
    class Map_Event_Icon
    attr_accessor :visible
    def initialize(event,id,status = false,priot = 0,viewport = Viewport.new(0,0,0,0),array_id = 0)
    @event = $game_map.events[event.id]
    @id = id
    @visible = status
    @priot = priot
    @array_id = array_id
    make_icon(viewport)
    update
    end
    def update
    @icon.visible = $game_map.map_icons[$game_map.map_id][@array_id][2]
    case @priot
    when 0
    @icon.z = 60
    when 1
    @icon.z = 200
    end
    @icon.x = @event.screen_x - 12
    @icon.y = @event.screen_y - 26
    end
    def dispose
    @icon.dispose
    end
    def make_icon(viewport)
    @icon = Sprite.new(viewport)
    @icon.bitmap = Bitmap.new(24,24)
    bitmap = Cache.system("Iconset")
    rect = Rect.new(@id % 16 * 24, @id / 16 * 24, 24, 24)
    @icon.bitmap.blt(0, 0, bitmap, rect)
    end
    end
    class Game_Interpreter
    def icon_visible(id,status)
    for i in $game_map.map_icons[$game_map.map_id]
    if i[4] == id
    
    $game_map.map_icons[$game_map.map_id][$game_map.map_icons[$game_map.map_id].index(i)][2] = status
    break
    end
    end
    end
    end
    
    

     

     

    Bugs e Conflitti Noti

    N/A

     

    Altri dettagli

    Lo cercavo da tempo per la mia avventura.

    Utile se vogliamo che "L'arma leggendaria" sia visibile a schermo prima di essere raccolta, ma anche in tante altre occasioni...

    Curiosità: Lo script fu ideato per Vx, ma funziona perfettamente su Ace, a quanto dice l'autore.

    (Testata la funzionalità su Vx Ace ma non su Vx)

  7. No, non è in parallasse ma quasi.

    In pratica incollo diversi elementi di diversi Tile in un unico tile più "compatto", con meno varietà ma più varianti, poi uso quello per mappare.

    Ad esempio, in un tile c'è l'albero, la parte bassa dell'albero col fiore blu, la parte bassa dell'albero con due funghi e un erbetta. la parte alta dell' albero con un altro albero dietro e così via...

    Aiuta a rendere tutto più vario, anche se da qualche problema quando dobbiamo mappare aree molto varie (come una casa nella foresta) a causa dei limiti del tileset...

  8. Stasera, ho avuto un problema curioso, e spero che qualcuno di voi mi possa aiutare.

    Dopo aver aumentato il numero massimo di tileset ho creato un nuovo tileset, quindi ho creato qualche mappa.

    Tutto bene fino al momento del test, momento in cui ho notato che tutti i Tile del gruppo A, e solo del gruppo A, ignorano totalmente la passabilità che ho impostato creando il tileset, lasciando il personaggio libero di camminare su muri e addirittura sull' acqua!

    Però, non me lo fa con i tileset di default, ne con i tile dei gruppi B,C,D ed E di quelli custom.

    Vi è mai capitato? E come avete risolto?

  9. Meno aggiornato direi proprio di no! In questi anni sono uscite svariate patch per rpg maker 2000 e 2003!

    Personalmente sono tra quelli che ancora usano rm2k3, e mi ci trovo strabene, quindi per me è una notizia favolosa! XD speriamo bene ^^

    Molto strano, in quanto di solito all'uscita di un nuovo tool il vecchio inizia ad essere ignorato.

    A questo punto, temo di aver sbagliato a fiondarmi subito sull' Ace.

    Devo indagare...

  10. Nonostante svariate ricerche online, non riesco proprio a trovare delle scale che scendano lateralmente...

    Qualcuno per caso, ha qualcosa nella propria riserva personale di Tile?

    Dovrebbero essere due o tre tile di lunghezza...

    Inoltre, spesso mi trovo in difficoltà a riempire i lati degli ambienti chiusi, in quanto tutto, dalle casse ai mobili, hanno una visuale frontale.

    Per caso qualcuno ha trovato qualcosa di utile?

  11. Nel mio gioco la protagonista scopre, ad un certo punto della storia, di non essere una vera donna ma un Golem,ovvero una creatura vivente creata da un alchimista.

    Il suo nome è Galatea, come il personaggio della leggenda di Pigmalione, che era appunto, una statua che prese vita.

    Incontrerà altri due golem nella sua avventura, Andrew e Martin.

    Andrew Martin è il nome del robot interpretato nel film L'uomo bicentenario da Robbie Williams, in cui tra l'altro, un altro androide simile al protagonista ma di fattezze femminili si chiama, appunto, Galatea.

  12. Però onestamente un generatore di mostri lo trovo un po difficile da creare...

    Per un faceset si possono raggruppare una serie di capelli, una di occhi e via discorrendo, ma per un mostro è diverso in

    quanto cambiano parecchio la morfologia.

    E a proposito di faceset...

    Il Face_Generator dell' Ace non si può guardare...

  13. Volevo sottoporvi anche io uno dei miei primi Screen...

     

    http://img826.imageshack.us/img826/902/immav.jpg

     

    Come vi pare? E' tanto brutta?

    A sud finiremmo in uno spiazzo in cui il fiume a sinistra diventa una cascata e finisce in un laghetto, mentre ad ovest andremmo verso il villaggio.

    Si, quella macchia grigia sarebbe una strada... :blush:

    E quella croce di fianco al fiume in basso è l'effetto "luccichio" e si muove. Esaminandolo scopriremo che si tratta di una moneta antica...

×
×
  • Create New...