how do i get or set all of the written data from the database via script call.
controlling game database using script
RGSSx Script SupportYou are not very specific.
What parameter or variables specifically?
Changing the actor's hp and changing the actor's attack stat are two different things.
What parameter or variables specifically?
Changing the actor's hp and changing the actor's attack stat are two different things.
both i need to learn yknow
where and how do you want to use that data?
because accessing those values is actually easier in events with control variable than to do the same in scripts. In scripts you would have to go through multiple arrays and calculate what is automatically provided by the event command.
because accessing those values is actually easier in events with control variable than to do the same in scripts. In scripts you would have to go through multiple arrays and calculate what is automatically provided by the event command.
just need to call/get those params but idk what's the syntax
for using scripts like event pop ups (e.g. damage pop up). I need to get the specified enemy's parameters (atk) in the enemy database and set it. Also for the player too so that i don't have to make millions of varibles from an event to set their params.
Are you sure you are not adding more to it like "how do I change weapon parameter just in case I need it" because you said "game data" while giving the example of "actor's and enemy's parameter"? Then when I ask for confirmation if it was HP or ATK you said "both" but I never said about DEF/MDF/MaxMP/Evasion/Magic Evasion, etc, how do I know if you also want those things?
Ask specifically which parameter you want to change or get access to, or I could just say: "there's an entire RGSS help file and the source code you could look into it yourself".
Ask specifically which parameter you want to change or get access to, or I could just say: "there's an entire RGSS help file and the source code you could look into it yourself".
And depends where you want to use this, might have a different answer. Whether it is in the damage formula or event, or someone's script configuration, or else.
no idea if two params (ATK and DEF) have different ways but yes I need params, ex-params basically all of the data written in the database from an actor/enemy/weapon/item etc. and I just simply want to know how to both get and set those data via script call so that I could just make my development less tedious and faster.
Open script editor --> Game_BattlerBase --> Line 57 ~ 84
Those are the parameters.
The basic stats you see in the class database (ATK to LUK) can be changed by script call
I assume you want to learn how to script, why not as well as overhaul the entire system?
Those are the parameters.
The basic stats you see in the class database (ATK to LUK) can be changed by script call
actor.add_param(id, amount), xparam/sparam can't be changed since it is tied to a formula and you can't simply add/remove it without changing how the game calculates it.I assume you want to learn how to script, why not as well as overhaul the entire system?
ok so what about getting it's base data?
use param_base
I'm kinda confused Is there a similar code to get actors param like from mv? ("$gameActors.actor(actorId).atk")
ATK is not the base value. You are asking for the base value.
Technically you can just refer to
It is an accumulation of stat-boosting status effects, equipment, etc.
Using
Technically you can just refer to
$game_actors[1].atk but that is not the base value.It is an accumulation of stat-boosting status effects, equipment, etc.
Using
param_base(id) gets you the base value (the one from the class database) without any adjustment.and your confusion is the reason why we asked that many clarifications at the beginning - because we already knew from your first questions that the full answer would confuse you, simply because you didn't understand that the value you wanted does not exist in that simple form you wanted.
atk is the sum of base value, added value, equipment value and state values, modified by traits from half a dozen possible sources.
It is basically a function that calculates that sum as a result and NOT a stored value, simply because there are too many ways that total can be manipulated in the engine.
So again, please tell us what you want to do with the value and we might be able to help you how to calculate it - because there never was a way to simply "get" it, it was always something that is the result of a complex calculation.
Oh I thought it was just an stored integer variable. So is it possible if i can store that sum (atk) to the variable i just made? Or something else like a script call? or idk? If so then you could help me get the calculations. I just wanted to allocate that value to something that I could use though. I guess @TheoAllen's custom stats overhaul is the answer on how it works?
and that is exactly what the event command does that I already mentioned.
The following screenshot is from MV but it is identical for Ace
Original thread: https://forums.rpgmakerweb.com/threads/controlling-game-database-using-script.151886/