Dynamic Features

● ARCHIVED · READ-ONLY
Started by Shaz 20 posts View original ↗
  1. Dynamic Features v1.0
    Shaz
    Introduction
    This script allows you to add and remove features for Actors, Classes, Weapons, Armors and States dynamically via Call Script commands, without needing to set up and apply custom states for the sole purpose of adjusting features.

    Technically, you could use the script to add and remove features for Items and Skills as well, but Ace uses Effects for those in preference to Features, so there is no feature handling for these classes by default.

    How to Use
    Paste script into a new slot below Materials.
    See blog for Call Script commands and parameter list.

    Script
    Download here

    Credit and Thanks
    - Shaz

    Author's Notes
    May be used freely in commercial and non-commercial games.
    Give credit.
  2. Words can't explain how easier this is than making tons of states <3
  3. About freaking time! lol. =)

    Good job with this one.
  4. This is excellent!  Is there anything like it that can have a similar effect on skills and items, adding or removing Effects like this does with Features?
  5. How come it's only now that I found there was something like this??? This is really nice. :)
  6. dugald, I doubt it would take much to whip up something similar for skill/item effects. I'll put it on my list.
  7. Much appreciated.  The game I'm working on will have some skills that can be customized, and there's just some things you just can't do with formulas by default (namely everything that isn't the skill's damage output).
  8. I'm curious if its possible to modify this to allow it to affect enemy features as well. I working on a game with different difficulty levels and would like to alter my enemies resistances and element rates based on difficulty.   

    Nevermind, I took a look at it the script and figured out how to modify to do what I want. Thanks for this great script by the way.
  9. I'd be interested to see what you did. I THOUGHT you should be able to modify enemy features on the fly, just like actors, classes, etc. Have you found that NOT to be true?


    If you want them based on difficulty, it's just a matter of passing a different value to it when you modify it. You shouldn't need to change the script itself.
  10. Just add the case for enemies.

    This should be enough, since the code is structured well

    Code:
    class RPG::BaseItem  def class_symbol    case self.class.to_s      when /Actor/i;  :actor      when /Class/i;  :class      when /Skill/i;  :skill      when /Item/i;   :item      when /Weapon/i; :weapon      when /Armor/i;  :armor      when /State/i;  :state      when /Enemy/i;  :enemy    end  endendclass Game_Interpreterdef get_class_object(cls, id)  obj = nil  case cls    when :actor;  obj = $data_actors[id]    when :class;  obj = $data_classes[id]    when :skill;  obj = $data_skills[id]    when :item;   obj = $data_items[id]    when :weapon; obj = $data_weapons[id]    when :armor;  obj = $data_armors[id]    when :state;  obj = $data_states[id]    when :enemy;  obj = $data_enemies[id]  end  objend
  11. Thanks Hime. I had no idea I'd left out enemies ... I can't think of any reason why I would have done that on purpose.
  12. Yea exactly what tsukihime posted is how I changed it. I quickly realized after scanning the script the enemy part was missing which was giving me the issue. 

    I got my difficuly tagged to a variable so its just a matter of at the start of game ill have it change all the enemies features at once for the difficulty selected. Since you cant change diff mid game.
  13. Awesome, Shaz! I'd been wanting something like this! :)
  14. I'm having some trouble with this script, now that I'm trying to use it. Depending on what you're trying to modify, your effects alter between an additive effect and a multiplicative effect. This just... won't work for what I'm trying to do.

    For example, if you try and modify :xparam, say, add_feature:)actor, 2, :xparam, 1, 0.05), this increases your evasion by 5%. do it again and it raises it by another 5%. Perfect, this is excellent, this is what I want.

    Now, if we try to modify :param 0 for HP, we do add_feature:)actor, 2, :param, 0, 0.05). Assuming the character has a 100% MHP modifier and 1000hp, doing this DOES NOT add 5% to the 100% MHP modifier, but instead, turns it to 5% MHP. Do it again, and it knocks it down to 2% and 20hp. If we do add_feature:)actor, 2, :param, 0, 1.05), it sets it to  105% MHP and 1050hp. Seems fine, until we do it again, resulting in a 110.25% MHP and 1102hp. The effect is now multiplicative, instead of simply adding another 5% onto the MHP.

    I'm no programmer, so I don't know if I should be doing a different formula or what... How do I go about getting an additive effect like with :xparam as I would using :param or :element_rate?
  15. Miyoko said:
    I'm having some trouble with this script, now that I'm trying to use it. Depending on what you're trying to modify, your effects alter between an additive effect and a multiplicative effect. This just... won't work for what I'm trying to do.
    This has nothing to do with the script.  The script does not dictate or change how features are used or what you can/can't do with features - it simply provides a way for you to change them during the course of the game and have your changes saved.  The additive/multiplicative effect is handled by the default scripts.

    Miyoko said:
    For example, if you try and modify :xparam, say, add_feature:)actor, 2, :xparam, 1, 0.05), this increases your evasion by 5%. do it again and it raises it by another 5%. Perfect, this is excellent, this is what I want.
    Try disabling or removing the script, and set up those features on the Actors tab in the database.  I bet you'll see exactly the same thing, and it will give you either one value or the other, depending on the order they appear in in the features list.

    What you CAN do with the script is get_feature into a variable to see what it's already set to, then change the variable to the new value, delete the original feature, and add a new one with the new value.
  16. Can I pass a variable to 'value', or does it have to be a number?

    add_feature:)actor, 1, :element_rate, 4, v1); #no good, undefined variable
    add_feature:)actor, 1, :element_rate, 3, 2.00); #multiplicative

    p.s. if I'd found your script on wed I probably would have saved 20h of research, trying to adjust the element_rate. Good work.
  17. You can pass a variable. You've just got to put it into the right format. v1 would give you an error ANYWHERE you tried to use it :)


    add_feature:)actor, 1, :element_rate, 4, $game_variables[1])


    Remember that variables are usually integers, and some of those features use floats, so you'll have to force your variable to be calculated as a float.
  18. Thanks again Shaz, I've got all that working an am now stuck on more normal programming problems.
  19. I apologize if I can't post here, but I seem to having an issue with this script. 

    I'm trying to add to the evasion stat. I am using a formula to calculate what to add.

    e = $game_variables[27]e = e / ($game_variables[14] * 0.2)e = e / 100add_feature:)actor, 1, :xparam, 1, e)Where Variable #27 is the points, and #14 is the character's level. It doesn't seem to want to work though. I'm not sure why. Can anybody clarify this for me?
  20. all variables are integers by default, but the value you need in the formula is supposed to be a float value.

    try

    Code:
    e = $game_variables[27].to_fe = e * 5 / $game_variables[14]
    as the first two lines, then continue with your code.