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,743
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,743
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,743
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

Challenging myself to make a game on the console versions of RMMV with alot of custom stuff, battle system is almost done, but holy heck is the interface and navigation so backwards on console ports. I've lost several hours of work because of design choices from that team!
If only RM had the capability to show whether a project has been edited, or not... like 99% of all other editors out there. That don't cost, too, or release new versions with very few features just to get the extra money... ugh, just too many basic features missing even after, what, two decades?
Surgically removing people's faces and grafting them on to other people is kind of fun.

(editing character art busts for my game)
I think sleep is like a foreign language to me.

Forum statistics

Threads
118,819
Messages
1,118,955
Members
156,003
Latest member
arsenic333
Top