Feature Manager

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This is a plugin-based scripting system that allows you to quickly define features and add them to RPG::BaseItem objects. Then you define the behavior of the feature and then tag your database objects.

Script users can install this script and use any features using a standard note-tag.

This script uses the term “Feature objects”, which includes Actors, Classes, Items, Weapons, Armors, Enemies, and States.

Adding new features to your database objects has never been easier, and creating new features is made easy with the use of standard data accessing methods.

Download

Script: download here

Examples

A couple scripts I’ve written for samples

Usage

Four step process

Step 1

Register your feature. Choose a name that will unique identify your feature
You can also pass in a version number if your script requires a specific version of the script.

You can check the version of the feature manager in the “import” line. It probably will be 1.0 for awhile so you can just omit it.

FeatureManager.register(IDSTRING, api_version=1.0)

Step 2

Define an “add_feature” method for your plugin. You will need to tell the feature manager how you want to setup your RPG::Feature. Keep in mind that all data ID’s and values must be integers. For now, features only support integer values.

class RPG::BaseItem
   def add_feature_IDSTRING(code, data_id, args)
      data_id = args[0].to_i
      value = args[1].to_i
      add_feature(code, data_id, value)
   end
end

Step 3

Define the behavior of your feature.
You will probably be aliasing methods defined in Game_BattlerBase, Game_Battler, Game_Actor, or Game_Enemy.

Step 4

Write instructions for tagging your database objects
The format of the note tag is as follows

<ft: IDSTRING arg1 arg2 arg3 …>

Where IDSTRING is the name of your plugin you registered and a list of args that you will ask your users to give you.

Notes

For now I am simply following what the default scripts do. I am releasing this now because I feel this is something that would be developed much more effectively if there are people actually using it and trying to implement their ideas. If you have an idea for a feature but my system does not allow you to write it (for example, if you want to use string values or something), just describe how you are planning to use it and I will see whether I want to make the values less restrictive. Similarly, if you need more ways of checking whether your actor has a particular feature or not, just describe it. I have added two methods that I think are essential

# Returns a set of all values for the given feature code
def features_value_set(code)
features(code).inject([]) {|r, ft| r |= [ft.data_id] }
end

# Returns a set of all values for the given feature code, filtered by data ID
def features_value_set_with_id(code, data_id)
features_with_id(code, data_id).inject([]) {|r, ft| r |= [ft.value]}
end

About API version…

By default the api version required is 1.0, which means it should be compatible with any version of the library.
Now…I just need to figure out a way to manage version control on my end. But I don’t expect there to be any significant changes so even if I add new stuff it would still be 1.0 unless I’m really changing the interface or something

Though that’s probably not how version numbers work

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

22 Responses

  1. crono says:

    I don’t understand I’ve looked at every youtube video I’ve looked at this Y guy that says he’s able to increase all the limits past 99 and so on but I’ve tryed to put it in and nothing work….I literally means nothing like I put in the code and it acts like I never put it in

    Can someone please explain fully on how to actually put the code in

  2. Gabenslair says:

    Okay, rephrase, I want you to bring the level requirements from dropbox hell.

  3. Gabenslair says:

    When I try to get on your dropbox, the inevitable “temporary shutdown” message appears!
    Can you post mirror files on the affected scripts?

    • Hime says:

      Which scripts? These don’t point to dropbox.

      • Gabenslair says:

        the feature manager, level limit, and minor ect. scripts on dropbox. I wonder if you can straight up give the script like the feature manager on THIS site where it straight up shows you the script text.

        • Hime says:

          The feature manager is on this site. Have you tried clicking the download link?

          • Gabenslair says:

            i meant the one on your rpg forum site, i wanted the one with the level limits because I thought It would be a great addition to my script list, but dropbox is being sucky. I downloaded the feature manager but mainly for the level conditions on the weapons/equip. I was thinking you can put it on the site like the feature manager/core.

    • Gabenslair says:

      The i want you to restore was the level conditions that required the feature manager.

  4. SML says:

    Hi, I’m using the Add_Param script, but it seems it doesn’t work with weapons… is this intended or am I doing something wrong?

    • Hime says:

      It works fine for me. When I note-tag a weapon with

      <ft: add_param mhp 10000>
      And then equip it to an actor, that actor will gain 10000 max HP.

  5. RagingFlare says:

    Hi Hime, every time I use this script, it drops my FPS. The reason why I’m using this script is because it’s the only way to use Param Max/Min. Is there any alternatives that work like this script? (Also that’s not a Yanfly script)

  6. Sainthell says:

    Sorry if it's a stupid question… but i'm having some problems with your "Float Animation" (http://www.rpgmakervxace.net/topic/8332-float-animation/, It needs Feature Manager) and what seems to be a problem with Battle Symphony. Everytime some of the enemies tagged with the "Float" tag tries to attack, it freezes the game. Is it because of Battle Symphony?

    • Hime says:

      It may be a compatibility issue. I know symphony has its own animations, and it may be conflicting with the way the float animation was written. See if symphony provides float animations built-in, or perhaps request one that would be compatible with its own animation system (which is better)

  7. RogueDeus says:

    I found myself unsure exactly how utilize this manager without one of its plugins doing it automatically, so I figured I’d ask.

    Say I wanted to add a basic feature to an enemy via note tag, using this script.

    How would I add a 25% resist rate to state(2)?
    [ft: FEATURE_STATE_RATE 0.25] ??

    And what if it only added when switch(1) is true?
    [cond_ft: FEATURE_STATE_RATE “s[1]” 0.25] ??

    • RogueDeus says:

      Oops… I forgot to add the state itself to the args… Like I said. I am unsure how as there are no functional examples. 🙂

      • Hime says:

        I’ll write some examples. Basically if you do a search for “self.initialize_tables” there will be something called a “feature_table” with things like :state_resist, :skill_add, etc.

        Those are the names you need to use as they map to the actual method names.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax