Why doesn't '$gameParty.leader().Mp >= 1' work?

BaronVampson

Veteran
Veteran
Joined
Jul 7, 2018
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm trying to set up a condition in the troop events page that activates when a character's MP has bypassed or is equivalent to a certain amount.
Code:
$gameParty.leader().Mp >= 1
After extensive testing, I find that this code, and various variations using different javascript math integers replacing the standard '>=' (e.g: '>' '===') does not function properly in ANY instance. Why is this? What am I doing wrong here?
 

Attachments

LTN Games

Indie Studio
Veteran
Joined
Jun 25, 2015
Messages
704
Reaction score
631
First Language
English
Primarily Uses
RMMV
It most likely needs to be a lowercase `M` so `mp` and not `Mp`
PHP:
$gameParty.leader().mp >= 1
 

BaronVampson

Veteran
Veteran
Joined
Jul 7, 2018
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey thanks! Strangely enough that seems to have resolved the issue. It's strange that in some instances the 'Mp' is supposed to be with an uppercase M and sometimes with a lower case, it is very confusing. I was also wondering whether this problem would have taken into account whether or not I had used an exclamation mark at the beginning of my script or not.. I have no idea. It would be useful to know when these instances are, unrelated as it is, because atm it seems to be purely trial and error lol
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
It's not strange at all.
That's what the property is named for actors and enemies, Mp will never work, at least within the context of the base engine code.
Check property names in the code files or using the console to get the proper syntax next time, it will save you a lot of trial and error.
Had you done a console.log($gameParty.leader()), you'd have found out by yourself.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
It's strange that in some instances the 'Mp' is supposed to be with an uppercase M and sometimes with a lower case, it is very confusing.
I have never seen 'Mp' with an uppercase M used as an object property. I'm curious now, where are you seeing this?

I was also wondering whether this problem would have taken into account whether or not I had used an exclamation mark at the beginning of my script or not..
Nope, this is the not operator and does not change the properties that an object has. It simply reverses a boolean from true to false, or vice-versa.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

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!

Forum statistics

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