Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Hello! I'd like the commands for finding the names of the actors in party position 2, 3, 4, and 5, as well as the HP and MP of actors in those positions as well.

It must look like this: ${$gameActors.actor(3).name()} (Wrong function, but you get the idea)

Not like this: \p[2] (Does what I want, but not in the correct format for Hud Maker)
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,152
First Language
English
Primarily Uses
RMMV
You can get an array of Actor objects from the party using this function.

Then you can select whichever actor you want (which is in order of their party position) and get their name with this function.

It would be best to experiment with this first in the Javascript Console so you can visually see what's going on vs. trying to guess&check in your HUD.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
Try

${$gameParty.members()[1].name} for the actor in position 2.
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
${$gameParty.members()[2].name}

does this
oYozJMD.png

@Shaz
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,152
First Language
English
Primarily Uses
RMMV
It's a function/method --> You call functions with parentheses, like this:
Code:
myObject.myFunction()
As opposed to a property, which is accessed without parentheses.
Code:
myObject.myProperty
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
${$gameParty.members()[2].name()}
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
That worked for names @Shaz, thanks a bunch!

How do you coorelate those to HP and MP? :)

I tried this:

${$gameParty.members()[4].hp()}

And it yelled at me
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
If you get error messages, please tell us what they are. Otherwise we're only guessing.

try hp instead of hp()
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
CVAx6Xm.png

It just says "error", it doesn't explain the error
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,152
First Language
English
Primarily Uses
RMMV
hp, mp, tp, atk, def, etc. are all "getters", so they are accessed without parentheses similar to properties (as Shaz said).

As I said earlier, it would probably help you to experiment in the Javascript console (press F8 during playtest to open it) rather than guess&check in your HUD, you can get immediate feedback on whether something works or not and it will tell you more useful error messages.
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
V6kLwli.png


This error message came from this gauge:


${$gameParty.members()[0].hp}

${$gameParty.members()[0].mhp}

Doing ${$gameParty.members()[0].hp()} and ${$gameParty.members()[0].mhp()} does not change the error message, either.
 

Latest Threads

Latest Profile Posts

A woman gave me her number without me even asking for it. Then she left because she had other patients to see.
oh, hey, I forgot about all this!

my old project got abandoned after I started working too much on stuff I'd already worked on - plus, starting to hate the story I wrote for it. Then, well, a lot of serious life **** went down. I ended up moving across the country, cutting off some people, etc. - **** was rough.

So, uh, I guess I'm back for now? Funny how things work.
I'm glad I'm sticking to my guns on having fighting game mechanics in my game, from what I've read, it's not for everyone. but for the most part, I've made it so you don't have to use them motion inputs for attacks if you don't want to.
And my project's just entered the Lunar New Year Sale 2022... Let's see if it reaches it's goal of $ 7,77.
Ohmygoodness I played Dicey Dungeons for the first time last night. Gave me SO MANY IDEAS for how to fix Heidi.

Forum statistics

Threads
118,725
Messages
1,118,239
Members
155,872
Latest member
nagomuyutori
Top