Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Quigon

electric boogaloo
Veteran
Joined
Mar 17, 2012
Messages
1,982
Reaction score
957
First Language
English
Primarily Uses
N/A
Words can't explain how easier this is than making tons of states <3
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
276
First Language
English
Primarily Uses
RMMV
About freaking time! lol. =)

Good job with this one.
 

dugald

Villager
Member
Joined
Jan 6, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
How come it's only now that I found there was something like this??? This is really nice. :)
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
dugald, I doubt it would take much to whip up something similar for skill/item effects. I'll put it on my list.
 

dugald

Villager
Member
Joined
Jan 6, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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).
 

Quickdraws

Veteran
Veteran
Joined
May 31, 2013
Messages
55
Reaction score
8
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,862
First Language
English
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
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
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.
 

Quickdraws

Veteran
Veteran
Joined
May 31, 2013
Messages
55
Reaction score
8
First Language
English
Primarily Uses
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.
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
Awesome, Shaz! I'd been wanting something like this! :)
 

Miyoko

Villager
Member
Joined
May 9, 2014
Messages
20
Reaction score
0
First Language
English
Primarily Uses
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?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
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.

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.
 
Last edited by a moderator:

raskalnickoff

Villager
Member
Joined
Jun 5, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,277
First Language
English
Primarily Uses
RMMV
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.
 

raskalnickoff

Villager
Member
Joined
Jun 5, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Thanks again Shaz, I've got all that working an am now stuck on more normal programming problems.
 

epson777341

Veteran
Veteran
Joined
Oct 10, 2014
Messages
34
Reaction score
2
First Language
English
Primarily Uses
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,162
Reaction score
8,017
First Language
German
Primarily Uses
RMMV
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.
 

Latest Threads

Latest Profile Posts

zomboars.jpg

Concept art

Zomboars- main enemies in my story
mutant pigs addicted to beer
SF_People1_3 added!
index.php

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...

Forum statistics

Threads
109,202
Messages
1,043,007
Members
141,709
Latest member
chonkycat
Top