public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers
Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: Notetag autoloader
  • Original author: Garryl
  • Original date: May 28, 2015
  • Source thread: https://forums.rpgmakerweb.com/threads/notetag-autoloader.40464/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Scripts In Development

Summary

This is a script I've been working on to make it easier to set up note tags to be loaded. The goal is that instead of having to alias the data manager load_database in all of my scripts, plus a whole lot of very similar setup to apply regexes to the note tags of all the objects, I can just pop this script in and describe the loading process in a couple of lines. It would look something like... module Garryl  module Loader    register(LoadFeature.new(RegexConfig.new(//i, RegexConfig::CAPTURE_INT, RegexConfig::CAPTURE_FLOAT), Game_BattlerBase::FEATURE_ELEMENT_RATE))  endend... instead of......

Archived First Post

https://github.com/Garryl/RGSS3-Scripts/tree/master/RGSS3-Scripts/Loader

This is a script I've been working on to make it easier to set up note tags to be loaded. The goal is that instead of having to alias the data manager load_database in all of my scripts, plus a whole lot of very similar setup to apply regexes to the note tags of all the objects, I can just pop this script in and describe the loading process in a couple of lines. It would look something like...

module Garryl  module Loader    register(LoadFeature.new(RegexConfig.new(/<feature element rate:\s*([1-9][0-9]*)[,]?\s*([\+]?[0-9]+(\.[0-9]+)?)\s*>/i, RegexConfig::CAPTURE_INT, RegexConfig::CAPTURE_FLOAT), Game_BattlerBase::FEATURE_ELEMENT_RATE))  endend... instead of...
Code:
module DataManager  # *************************************************************************  # * Aliases                                                               *  # *************************************************************************  class << self    alias garryl_example_alias_datamanager_load_database    load_database  end    # *************************************************************************  # * Aliased Functions                                                     *  # *************************************************************************  #--------------------------------------------------------------------------  # * Load Database  #--------------------------------------------------------------------------  def self.load_database    garryl_example_alias_datamanager_load_database        groups = [$data_actors, $data_classes, $data_weapons, $data_armors, $data_enemies, $data_states]    for group in groups      for obj in group        next if obj.nil?        next if obj.note.empty?        obj.note.scan(/<feature element rate:\s*([1-9][0-9]*)[,]?\s*([\+]?[0-9]+(\.[0-9]+)?)\s*>/i) {|id, value|          obj.features.push(RPG::BaseItem::Feature.new(Game_BattlerBase::FEATURE_ELEMENT_RATE, id.to_i, value.to_f))        }      end    end  endend
... and suddenly any feature-bearing object will add element rate features defined in their notes. (Obviously element rate is just an example, not something I'd actually need to do with standard scripts since the editor lets you just assign features directly in the features table, but it's a good illustration of how it works.)

It's partially tested (an earlier version was working, but I've changed it since then). It's designed primarily for loading new features (for actors, equipment, states, etc.) and effects (for skills and items), but it also includes (untested) support for something else entirely using a method call to a method in the object whose note tag is being loaded.

This should be compatible with everything, since it only deals with two methods, DataManager.LoadDatabase and Game_Map.setup, and it just aliases them.

Edit: Changed to load the note tags of maps when they're loaded, which is different from when normal database elements are loaded.

Edit: Did some actual testing and bug fixing and getting it to actually run right in the basic cases.

Edit: Also, optionally, a script to have it load, from note tags, all of the standard features and effects that you can assign through the GUI.

Edit: Now on GitHub instead of pasted here. First completed version, yay!

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#rgss-development

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar