Últimos temas
» [HPRPG] Harry Potter y la Piedra Filosofal
por xDiego Hoy a las 8:53 am

» Muz-taller: Charas
por Muzgar Ayer a las 6:24 pm

» (MAKER MV)Algunos aditamentos extras para el generador de charas ):
por Muzgar Ayer a las 5:39 pm

» [XP] Recopilación de charas con ropa moderna
por Muzgar Ayer a las 5:10 pm

» KyoDiscounts XP
por Muzgar Ayer a las 5:07 pm

» Nuevos cambios en el foro
por Muzgar Ayer a las 4:42 pm

» Chaos of Destiny - The Origin
por Ruben_modder Miér Dic 12, 2018 11:01 pm

» Necesito Bases de proyecto nuevo Maker MV
por Ruben_modder Miér Dic 12, 2018 2:23 pm

» necesito script para ver mi estado de EXP
por rapopero Miér Dic 12, 2018 7:46 am

» [Engine Vx Ace] Suelos Movedizos
por IvalteK_Dev Miér Dic 12, 2018 3:01 am

» [VX/Ace]PersonajesEscolares
por mdk3dd Mar Dic 11, 2018 3:30 pm

» Laminación [VXACE] [NUEVO LAVADO DE CARA!]
por Pocari Lun Dic 10, 2018 8:22 pm


[VXAce] CKN Core Script

Ir abajo

[VXAce] CKN Core Script

Mensaje por Chaskarron el Miér Nov 08, 2017 2:36 pm

Nombre: CKN Core Script
Autor: Chaskarron
Descripcion: Permite cambiar los limites como el maximo dinero del grupo, o los objetos que este puede portar, asi como cambiar la resolucion de presentacion del juego. Este script servira de nucleo y sera requerido por futuros scripts que estan en desarrollo y cuya version esta sujeta a cambios y actualizaciones.
Creditos: Obviamente a Chaskarron para uso libre o comercial. El resto de futuros scripts que dependan de este nucleo pueden estar sujetos a licencias de uso en proyectos comerciales.
Utilizacion: Crear un nuevo script en la seccion de materials del RPG Maker y pegar el codigo del script. Modificar la zona editable para cambiar los valores al gusto.

Código:
=begin
################################################################################
================================================================================
CKN Core Script
version: 1.0.0
credits: Chaskarron
contact: chaskarron[at]gmail.com

To use in RPG Maker VX ACE. Make sure is ABOVE all other CKN Scripts

FEATURES:
  -Allow to edit some limits as party gold, max TP or max party members.
  -Editable graphics size.
  -Use these features on editable zone.

This core take control of data objects for feature scripts.
Don't checked with other scripts compatibility. Maybe works fine.

Credits must be to Chaskarron in free and sale projecs.


CHANGELOG

  v1.0.0 Core not finished yet, open to new features and updates
================================================================================
################################################################################
=end
$imported = {} if $imported.nil?
$imported["CKN-Core"] = true
################################################################################
# CKN module
#===============================================================================
# Used to provide global info, params and config settings.
################################################################################
module CKN
################################################################################
################################################################################

#~  EDITABLE ZONE BEGIN

################################################################################
  
  CORE_ENABLED = true     # BOOLEAN enable / disable the core
  
  GRAPHICS_WIDTH = 544    # default 544 / max. 640 screen width
  GRAPHICS_HEIGHT = 416   # default 416 / max. 480 screen height
  # Important!! All changes in resolution affects to all scene pictures
  # An example: If default background image of tittle screen is 544x416
  # and screen resolution was changed to 640x480, the new image for
  # title screen must be 640x480 to been fixed to the new screen resolution
  
  MAX_GOLD = 99999999     # max party gold, default is 99999999
  MAX_ITEM = 99           # max number of items carried, default is 99
  MAX_BATTLERS = 4        # max party members, default is 4
  
  MAX_HP = 999999         # max actor & enemy hp, default is 999999
  MAX_MP = 9999           # max actor & enemy mp, default is 9999
  MAX_TP = 100            # max actor tp, default is 100
  MAX_OTHERS = 999        # max actor & enemy other stats, default is 999
  
################################################################################

#~  EDITABLE ZONE END

################################################################################
################################################################################


  @fullRect = Rect.new(0, 0, Graphics.width, Graphics.height)
  
  def self.init
    @ScriptName = "CKN Core Script"
    @ScriptVersion = "1.0.0"
    @ScriptIncludes = []
  end
  
  def self.enabled?
    return CORE_ENABLED
  end
  
  def self.scriptName
    @ScriptName
  end
  
  def self.scriptVersion
    @ScriptVersion
  end
  
  def self.rect
    @fullRect
  end
  
  def self.addScript(script)
    @ScriptIncludes.push(script)
  end
  
  def self.includes
    @ScriptIncludes
  end
  
  def self.includeExists?(id)
    return !@ScriptIncludes[id].nil?
  end
  
  def self.showScript(id)
    p @ScriptIncludes[id] if !@ScriptIncludes[id].nil?
  end
end
################################################################################
# DataManager module
################################################################################
module DataManager
  #--------------------------------------------------------------------------
  # alias method
  #--------------------------------------------------------------------------
  class <<self; alias ckn_core_create_game_objects create_game_objects; end
  def self.create_game_objects
    ckn_core_create_game_objects
    $ckn = CKN_Core.new if CKN.enabled?
  end
  #--------------------------------------------------------------------------
  # overwrite method
  #--------------------------------------------------------------------------
  class <<self; alias ckn_core_save_contents make_save_contents; end
  def self.make_save_contents
    contents = ckn_core_save_contents
    contents[:ckn] = $ckn if CKN.enabled?
    contents
  end
  #--------------------------------------------------------------------------
  # alias method
  #--------------------------------------------------------------------------
  class <<self; alias ckn_core_extract_save_contents extract_save_contents; end
  def self.extract_save_contents(contents)
    ckn_core_extract_save_contents(contents)
    $ckn = contents[:ckn] if CKN.enabled?
  end
end
################################################################################
# Game_Interpreter class
################################################################################
class Game_Interpreter
  #--------------------------------------------------------------------------
  # * alias Comment
  alias ckn_interpreter_comment command_108
  #--------------------------------------------------------------------------
  def command_108 # for author testing development
    ckn_interpreter_comment
#~     @comments = [@params[0]]
#~     while next_event_code == 408
#~       @index += 1
#~       @comments.push(@list[@index].parameters[0])
#~     end
    #p @comments
  end
end
################################################################################
# Game_System class
################################################################################
class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :ckn_data               # ckn data
  #--------------------------------------------------------------------------
  # * Alias Object Initialization
  alias ckn_initialize initialize
  #--------------------------------------------------------------------------
  def initialize
    @ckn_data = {}
    ckn_initialize
  end
end
################################################################################
# Game_Party class
################################################################################
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :ckn_data                     # ckn data
  #--------------------------------------------------------------------------
  # * Alias Object Initialization
  alias ckn_initialize initialize
  #--------------------------------------------------------------------------
  def initialize
    @ckn_data = {}
    ckn_initialize
  end
end
################################################################################
# Game_Actor class
################################################################################
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :ckn_data               # ckn data
  #--------------------------------------------------------------------------
  # * Alias Object Initialization
  alias ckn_initialize initialize
  #--------------------------------------------------------------------------
  def initialize(actor_id)
    @ckn_data = {}
    ckn_initialize(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Alias Setup
  alias ckn_game_actor_setup setup
  #--------------------------------------------------------------------------
  def setup(actor_id)
    ckn_game_actor_setup(actor_id)
    $ckn.get_datanotes(actor.note).each{ |key, value|
      @ckn_data[key] = value
    } if CKN.enabled?
  end
end
################################################################################
# Game_Enemy class
################################################################################
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :ckn_data                    # ckn data
  #--------------------------------------------------------------------------
  # * Alias Object Initialization
  alias ckn_initialize initialize
  #--------------------------------------------------------------------------
  def initialize(index, enemy_id)
    @ckn_data = {}
    ckn_initialize(index, enemy_id)
  end
end
################################################################################
# Game_Map class
################################################################################
class Game_Map
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :map                   # map data
  attr_reader :ckn_data              # ckn data
  
  #--------------------------------------------------------------------------
  # * Alias Setup
  alias ckn_game_map_setup setup
  #--------------------------------------------------------------------------
  def setup(map_id)
    @ckn_data = {}
    ckn_game_map_setup(map_id)
  end
end
################################################################################
# Game_Player class
################################################################################
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :ckn_data                # ckn data
  #--------------------------------------------------------------------------
  # * Alias Object Initialization
  alias ckn_core_initialize initialize
  #--------------------------------------------------------------------------
  def initialize
    @ckn_data = {}
    ckn_core_initialize
  end
end
################################################################################
# Scene_Map class
################################################################################
class Scene_Map
  #--------------------------------------------------------------------------
  # * alias Create All Windows
  alias ckn_core_create_all_windows create_all_windows
  #--------------------------------------------------------------------------
  def create_all_windows
    ckn_core_create_all_windows
    create_ckn_core_window
  end
  
  def create_ckn_core_window
    #to create
  end
end
################################################################################
# Game_BattlerBase class
################################################################################
class Game_BattlerBase
  #--------------------------------------------------------------------------
  # * override method - Get Maximum Value of Parameter
  #--------------------------------------------------------------------------
  def param_max(param_id)
    return CKN::MAX_HP if param_id == 0  # MHP
    return CKN::MAX_MP if param_id == 1  # MMP
    return CKN::MAX_OTHERS
  end
  #--------------------------------------------------------------------------
  # * override method - Get Maximum Value of TP
  #--------------------------------------------------------------------------
  def max_tp
    return CKN::MAX_TP
  end
  #--------------------------------------------------------------------------
  # * override method - Get Percentage of TP
  #--------------------------------------------------------------------------
  def tp_rate
    @tp.to_f / CKN::MAX_TP
  end
end
################################################################################
# Game_Party class
################################################################################
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * override method - Get Maximum Value of Gold
  #--------------------------------------------------------------------------
  def max_gold
    return CKN::MAX_GOLD
  end
  #--------------------------------------------------------------------------
  # * override method - Get Maximum Number of Items Possessed
  #--------------------------------------------------------------------------
  def max_item_number(item)
    return CKN::MAX_ITEM
  end
  #--------------------------------------------------------------------------
  # * override method - Get Maximum Number of Battle Members
  #--------------------------------------------------------------------------
  def max_battle_members
    return CKN::MAX_BATTLERS
  end
  #--------------------------------------------------------------------------
  # Reward - Used for reward system
  #--------------------------------------------------------------------------
  def gain_reward(reward)
    case reward.type
      when :gold
        gain_gold(reward.amount)
      when :item
        gain_item($data_items[reward.id], reward.amount)
      when :weapon
        gain_item($data_weapons[reward.id], reward.amount)
      when :armor
        gain_item($data_armors[reward.id], reward.amount)
    end
  end
end
################################################################################
# CKN_Reward class
################################################################################
class CKN_Reward
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :id, :amount, :type
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(*args)
    @id = args[0]
    @amount = args[1]
    @type = args[2]
  end
end
################################################################################
# CKN_Core class
#==============================================================================
# Used to provide global methods for ckn scripts. Data is included in save.
################################################################################
class CKN_Core
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize
    Graphics.resize_screen(CKN::GRAPHICS_WIDTH, CKN::GRAPHICS_HEIGHT)
    CKN.init
    p(sprintf("%s v%s", CKN.scriptName, CKN.scriptVersion))
  end
  #--------------------------------------------------------------------------
  # Report wrong setup
  #--------------------------------------------------------------------------
  def show_error(error, script, warning = false)
    msgtext = warning ? "Warning: " : "Error: "
    msgbox(msgtext + error + "\nOccurred in: " + script)
  end
  #--------------------------------------------------------------------------
  # Get variables
  #--------------------------------------------------------------------------
  def _v(id)
    $game_variables[id]
  end
  #--------------------------------------------------------------------------
  # Get switches
  #--------------------------------------------------------------------------
  def _s(id)
    $game_switches[id]
  end
  #--------------------------------------------------------------------------
  # Get current map info
  #--------------------------------------------------------------------------
  #~   attr_reader   :screen                   # map screen state
  #~   attr_reader   :interpreter              # map event interpreter
  #~   attr_reader   :events                   # events
  #~   attr_reader   :display_x                # display X coordinate
  #~   attr_reader   :display_y                # display Y coordinate
  #~   attr_reader   :parallax_name            # parallax background filename
  #~   attr_reader   :vehicles                 # vehicle
  #~   attr_reader   :battleback1_name         # battle background (floor) filename
  #~   attr_reader   :battleback2_name         # battle background (wall) filename
  #~   attr_accessor :name_display             # map name display flag
  #~   attr_accessor :need_refresh             # refresh request flag
  #~   attr_reader   :map                      # get current map data
  #--------------------------------------------------------------------------
  def _map
    $game_map
  end
  #--------------------------------------------------------------------------
  # Get actor info
  #--------------------------------------------------------------------------
  #~   attr_accessor :name                     # Name
  #~   attr_accessor :nickname                 # Nickname
  #~   attr_reader   :character_name           # character graphic filename
  #~   attr_reader   :character_index          # character graphic index
  #~   attr_reader   :face_name                # face graphic filename
  #~   attr_reader   :face_index               # face graphic index
  #~   attr_reader   :class_id                 # class ID
  #~   attr_reader   :level                    # level
  #~   attr_reader   :action_input_index       # action number being input
  #~   attr_reader   :last_skill               # For cursor memorization:  Skill
  #--------------------------------------------------------------------------
  def _actor(id)
    $game_actors[id]
  end
  #--------------------------------------------------------------------------
  # Get party
  #--------------------------------------------------------------------------
  #~   attr_reader   :gold                     # party's gold
  #~   attr_reader   :steps                    # number of steps
  #~   attr_reader   :last_item                # for cursor memorization:  item
  #--------------------------------------------------------------------------
  def _party
    $game_party
  end
  #--------------------------------------------------------------------------
  # Get game player info
  #--------------------------------------------------------------------------
  #~   attr_reader   :followers                # Followers (party members)
  #--------------------------------------------------------------------------
  def _player
    $game_player
  end
  #--------------------------------------------------------------------------
  # Get enemy info
  #--------------------------------------------------------------------------
  #~   attr_reader   :index                    # index in troop
  #~   attr_reader   :enemy_id                 # enemy ID
  #~   attr_reader   :original_name            # original name
  #~   attr_accessor :letter                   # letters to be attached to the name
  #~   attr_accessor :plural                   # multiple appearance flag
  #~   attr_accessor :screen_x                 # battle screen X coordinate
  #~   attr_accessor :screen_y                 # battle screen Y coordinate
  #--------------------------------------------------------------------------
  def _enemy(id)
    $data_enemies[id]
  end
  #--------------------------------------------------------------------------
  # Get game troop
  #--------------------------------------------------------------------------
  #~   attr_reader   :screen                   # battle screen state
  #~   attr_reader   :interpreter              # battle event interpreter
  #~   attr_reader   :event_flags              # battle event executed flag
  #~   attr_reader   :turn_count               # number of turns
  #~   attr_reader   :name_counts              # hash for enemy name appearance
  #--------------------------------------------------------------------------
  def _troop
    $game_troop
  end
  #--------------------------------------------------------------------------
  # Get system info
  #--------------------------------------------------------------------------
  #~   attr_accessor :save_disabled            # save forbidden
  #~   attr_accessor :menu_disabled            # menu forbidden
  #~   attr_accessor :encounter_disabled       # encounter forbidden
  #~   attr_accessor :formation_disabled       # formation change forbidden
  #~   attr_accessor :battle_count             # battle count
  #~   attr_reader   :save_count               # save count
  #~   attr_reader   :version_id               # game version ID
  #--------------------------------------------------------------------------
  def _system
    $game_system
  end
  #--------------------------------------------------------------------------
  # Get note and return a hash with keys and values
  #--------------------------------------------------------------------------
  def get_datanotes(note)
    patternkey = /<(\w+):(.+)>/
    temp = {}
    note.each_line{
      |line|
      line.gsub(patternkey){
        temp[$1] = $2
      }
    }
    return temp
  end
  #--------------------------------------------------------------------------
  # Get actor note
  #--------------------------------------------------------------------------
  def get_actor_note(id)
    return _actor(id).note
  end
  #--------------------------------------------------------------------------
  # Get map note
  #--------------------------------------------------------------------------
  def get_map_note
    return _map.map.note
  end
  #--------------------------------------------------------------------------
  # Get class note
  #--------------------------------------------------------------------------
  def get_class_note(id)
    return $data_classes[id].note
  end
  #--------------------------------------------------------------------------
  # Get skill note
  #--------------------------------------------------------------------------
  def get_skill_note(id)
    return $data_skills[id].note
  end
  #--------------------------------------------------------------------------
  # Get item note
  #--------------------------------------------------------------------------
  def get_item_note(id)
    return $data_items[id].note
  end
  #--------------------------------------------------------------------------
  # Get weapon note
  #--------------------------------------------------------------------------
  def get_weapon_note(id)
    return $data_weapons[id].note
  end
  #--------------------------------------------------------------------------
  # Get armor note
  #--------------------------------------------------------------------------
  def get_armor_note(id)
    return $data_armors[id].note
  end
  #--------------------------------------------------------------------------
  # Get enemy note
  #--------------------------------------------------------------------------
  def get_enemy_note(id)
    return $data_enemies[id].note
  end
  #--------------------------------------------------------------------------
  # Get state note
  #--------------------------------------------------------------------------
  def get_state_note(id)
    return $data_states[id].note
  end
end

Este script es muy simple y no modifica muchos aspectos del juego, pero sera requerido en futuros scripts. Espero que sea util y que lo disfruteis.

Saludos!!!
avatar
Chaskarron
PJ Secundario
PJ Secundario

Masculino
España
RPG Maker : MV
Mensajes : 150
Monedas : 485
Reputación : 27
Edad : 37
Localización : Mordor

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.