Koudelka like Status-System

Hello at first,


i`m currently trying to remake the PS1 Game Koudelka into RPG Maker MV.


One of the first problems (oh well there are many more) i did encounter is how to make the status system work like it should.


For the understanding: In Koudelka there was a status-system with 8 attributes. 2 of them are quite unusual:


- Vitality: this does influence the max hp and the defense vs phy. attacks


- Piety: this is the counterpart from vitality; it raises the max mp and the defense vs. magic attacks


A Player had 4 ways to increase these attributes:


a) when leveling up you get 4 points to spend on the 8 attributes


b ) every equipment got some modifer for all of the attributes


c) there where items that can permanently increase the attributes


d) there were also spells that did boost it temporarily in battle


When dealing with mhp and mmp first i soon encountered that these two attributes (vitality and piety) cant be remade using the basic hp and mp attribut. So my current way to redo that system is to use the actor variables plugin from yanfly. With it i recreated all 8 attributes. Every attribut is linked to one variable now.


From there it seems quite simple in theory: Check the current variabel-value of an attribut and set mhp and mmp based on that. Also just let the game in realtime check for changes on these variables und change the corresponding values.


While that sounds quite easy in theory, it extends my current knowledge about rpg maker mv.


So i would really appreciate any helping thoughts on that :  )


Thanks in advance !
While I am sure that it would be considerably more resource efficient to write a script or plugin, the concept could be done with a parallel processing common event.


If you have such an event run a check to each variable for each character, then adjust the attributed based on that variable, that should work. It would constantly update, as it's a parallel process.


However, that is not an efficient use of RPGMaker's memory, so I'd recommended scripting a plugin if you can.


I hope that helps!
Thanks for the reply !


I will try to get that common event working. Sadly my skills are by far not enough to script an own plugin.
Well so i tried to make a common event checking the variables. The problem with that is, that it seems like rpg maker just lets you increase or decrease the attributes but not set them on a fixed value. Any ideas on that ?
I think you can set a variable to an actor's attribute and then do some calculation based on that to get the value by which you have to increase/decrease that attribute.


There might also be a script call to directly set an attribute to a value, which of course would be easier. Maybe somebody else knows what it is, otherwise I'll look into it later today.


@saphirweapon It doesn't seem to be quite as simple. RMMV combines two values for each actor attribute, ParamBase (set by the parameters curves of the class) and ParamPlus (equipment and other bonuses - only this is influenced by the Chance Parameter Event command). There is a script call to change ParamPlus directly:


$gameActors.actor(actorID)._paramPlus[paramID] = value;
$gameActors.actor(actorID).refresh();


where actorID is the id of the actor whose parameter should be changed, paramID the id of the parameter to be changed (0 = MaxHP, 1 = MaxMP, 2 = ATK, 3 = DEF, 4 = MAT, 5 = MDF, 6 = AGI, 6 = LUK) and value the value you want to change it to (can be a fixed number like 100 or a variables). E.g. if you want to change the ATK of actor #1 to the value of variable #20, it would look like this:


$gameActors.actor(1)._paramPlus[2] = $gameVariables.value(20);
$gameActors.actor(1).refresh();


The equipment bonus is still added on top of that, which may or may not be what you want, and so is as the ParamBase value from the actor's class. You could get around the second issue by setting the class parameters to 1 for all levels (they have to be larger than 0) and subtract 1 from the variable value in the script call like this:


$gameActors.actor(1)._paramPlus[2] = $gameVariables.value(20) - 1;
$gameActors.actor(1).refresh();




Let me know if that helps you 🙂
Thanks a lot for that help. I will give it a try and see if i can make progress with it :  )
Well first: The help you granted really helped me out LadyBaskerville and is working very nice :  )


The next Problem i encounter when dealing with the different status system and mhp is that the values are not usable 1:1. When you level up your mhp-attribut by 1 point it doesnt mean the hp will be increased by 1 point. Instead of that every attribut increase has some fixed real mhp value increase.


Explanation: The formula behind that is that the increase is always +2 on top of the prevoius increase. So starting with a vitality of 1 and maxhp of 1 the first increase will bring 3  points added to mhp. When increasing the attribut again it will give 5,7,9,11,13 etc. increase for the actual mhp. (i hope that was understandable).


So of course now i could make a variable for each level of every attribute and make the math up from that. But that would be way too many variables. So is it possible to bring formulas into play for that script calls ?
Yes, you can treat $gameVariables.value(20) as if it was a number and do your calculations with it. I think the formula for your example would be this (using actor #1 and variable #20):

Code:
$gameActors.actor(1)._paramPlus[0] = $gameVariables.value(20) * 2 + 1;
$gameActors.actor(1).refresh();
Well the formula isnt correct but it is working (with false results). I got it also working in some skill (for temporary boosts within battle or items). So i just need to fix the formula now. Thanks again for the help :  )


Now that i think mhp and mmp can be redone i still need to redo the other 2 unusual attribute-pairs. In the Koudelka Game there where a strength and a dexterity attribute that did both influence the value of regular damage. Easy said: Strength did make up the potential of the maximum damage a physical attack can make. Dexterity did influence the % on how far the actual damage comes to that maximum damage. If you have some dexterity value close to the strength value it would mean you can do 100 % damage (where 100 % is based on the strength value). If the dexterity is lower then your strength attribut you could only reach lower % of that possible highest damage.


Im wondering how to redo that affect.
I haven't completely worked it out yet, but you could make individual attack skills for each actor (with a plugin like Yanfly's Weapon Unleash) and use the variables in the damage formula. If variable #21 was the Strength and variable #22 the Dexterity for a certain actor,


v[21] * (v[22] / v[21])


in the damage formula for a skill that actor has would give you something similar to what you described, I think. You can also use conditions in a damage formula if e.g. you want to check if Dexterity is higher than Strength and use a different formula in that case. Look here for a detailed guide: http://www.rpgmakercentral.com/topic/36290-damage-formulas-101-mv-edition/


There might be other ways to do this, but this is the only one I can think of.
Thanks again for the suggestion. I will give it a try and report back :  )
Well thanks a lot for that help again. Especially that damage formula guide is really really helpful. I`m now nearly done with the troubles the status system is causing.


The thing left is that equipment changes all the attributes as well. While rmmv lets you change the standard parameters, i need a way to make eqp change variables. When using google for this i found that thread:


http://forums.rpgmakerweb.com/index.php?/topic/57027-is-there-a-way-to-attach-variables-to-a-piece-of-equipment-based-on-if-it-is-equipped/


While this might in theory work for me aswell, it seems quite hard to implement as there are 3 actors with 6 attributes each that would need to be checked that way.


So any ideas on how to get eqp make variables change in some easier to use way ?
I think you will need a plugin for that, especially since Common Events don't run while the menu is open, so the solution from that thread might give you problems as well (the variables will only be updated once the player leaves the menu - if they change the equipment and then go straight to the part of the menu where the variables are shown, the change will not be visible there). I can try to write something for you, but one question before I do that: Do all actors have separate pieces of equipment, or can multiple actors equip the same items? Or phrased differently: Would you specify something like "If this is equipped, add 5 to variable #21" for weapons/armors, or does it have to be "If actor #1 has this equipped, then add 5 to variable #21, but if actor #2 has this equipped, add 5 to variable #31"?
Well a big big thank you first for your efforts. Currently i have a total  of 24 variables (8 attributes for each  of the 3 characters). The plugin must be able to check if actor 1 or 2 or 3 has equipped it and depending on that a different variable needs to be changed. It shouldnt be a problem though if the same equip exists multiple times and get equipped on multiple actors the same time.


If it matters: I`m using quit a lot of yanflys plugins. Hope that doesnt make things more complicated due to compatibility issues.
It's already working for a single notetag and there don't seem to be compatability problems with Yanfly's plugins - not even with his Equip Core, which modifies the same function. I'll implement multiple notetags tomorrow, so that you can change different variables for different actors.
That sounds really great. I appreciate that very much !


While working out the formulas for everything i stumbled about some miniproblem. It seems like the original game was rounding down numbers. So if the formula would return 25.6 as value for maxmp it would round that down to 25 and display 25. RMMV instead does round that up and return 26.


When i did look in the damage formula guide i could see that there is some "Math.floor(number)" function that seems to make just what i want. I`m not sure though how to work that into the formula.
You can just put your formula that you want to round down inside the brackets instead of a single number.


I'm seeing another problem with the plugin, though - when a piece of equipment changes a variable that in turn influences one of the "normal" parameters (MHP, ATK, ...), that change in the parameter will not be visible until the common event that updates the parameters runs again (when the menu is closed) and the change also won't show in the equip menu (e.g. no ATK 10 -> 14). I can't think of a workaround for this, either... Maybe you or someone else has an idea?
Well it seems i`m to stupid to catch what you mean with putting it into brackets. Currently i got the following script call for mmp:


$gameActors.actor(1)._paramPlus[1] = ($gameVariables.value(6) / 10 * $gameVariables.value(6)) - 1;


$gameActors.actor(1).refresh();


What i understood was that it should just be math.floor(


$gameActors.actor(1)._paramPlus[1] = ($gameVariables.value(6) / 10 * $gameVariables.value(6)) - 1;


$gameActors.actor(1).refresh();


)


But that doesnt work.


For the plugin: Do i understand you right, that the plugin is doing what it is supposed to do. It is just not refreshing itself in realtime when it comes for changing the basic rpg maker attributes (att/def/int etc.) ?  For this basic attributes i`m only using agility from them as it is a 1:1 replace of the games agility attribute. If the yanfly battle engine core would let me replace some variable with agi (there is such an option into the plugin, but im not sure if that works with variables), i wouldnt even need that.
It should be:


$gameActors.actor(1)._paramPlus[1] = Math.floor(($gameVariables.value(6) / 10 * $gameVariables.value(6)) - 1);


$gameActors.actor(1).refresh();


so that it rounds down the result of ($gameVariables.value(6) / 10 * $gameVariables.value(6)) - 1. Sorry, I should have expressed myself more clearly. (Also, make sure your "Math" is capitalized - Javascript is case-sensitive.)


Yes, that's the way the plugin works. You can still normally change the parameters, e.g. have a piece of equipment add 10 to agi, but if you had a variable that "controls" agi and you change that variable with the equipment, the change for agi wouldn't be shown in the menu at first.


Here's an early version of the plugin for you to test: https://drive.google.com/open?id=0Bzg5Egy_d-RoeU5kWUpEeGpMTXc


It's not fully functional yet - it doesn't take initial equipment into account and doesn't support negative values for the variable change, but I'll add that later.


The notetag for equipment looks like this: <Add to Variable: variableId, value, actorId> and you can put as many of them underneath each other as you want. Look at the Help file of the plugin for examples.


Let me know if it works in general and with the other plugins you're using (I put it at the end of the plugin list for testing and didn't find compatability issues, but I didn't test it with all of Yanfly's plugins). If you get an error or unexpected behavior, please describe when it happens and show a screenshot of the console (F8).
Thanks a lot !  On the first short view (not much time now) it does all work like intended and there arent any errors. I will give it a deeper test later and report back here.


Thanks again for your efforts :  )

Original thread: https://forums.rpgmakerweb.com/threads/koudelka-like-status-system.72881/