[SOLVED] Trying to Get Attack Power in Script

Status
Not open for further replies.

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
I know this should seem easy for the life of me, but I wanted to be sure I'm doing this correctly.

Quite simply I am writing a plugin with a parameter (Value X). If this value is not 0 or undefined, then we take Actor1's Attack Power * ValueX = Weight Limit. (kind of similar to how D&D 5e takes Strength Score * 15 = the basic amount of weight you can carry).

So what I'm asking is - within a Game_Party class, how would one go about getting actor 1's ATK value?

Like would this work (pseudo code obviously, not full thing):
var MyVar = MyVar || {};
MyVar.params = PluginManager['myplugin'];
MyVar.value = Number(MyVar.params['Value']);

var actor = $dataActors[1]; // getting actor 1 only
var iwsLimit = actor.atk * MyVar.value;
}
 
Last edited:

RetroExcellent

Cute Kiwi
Veteran
Joined
Nov 1, 2018
Messages
121
Reaction score
300
First Language
English
Primarily Uses
RMMV
I think to change a parameter like Attack, you'll need this code:

$gameActors.actor(actorId).Param(paramId);

Not 100% positive on this though, since I can't test it.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
Boom. That did it. Using the script command in an event I tested:

var test = $gameActors.actor(1).param(2);
console.log(String(test));

And it displayed 26 (which was correct). So that got their attack value :) Thank you so much Retro!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top