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

● ARCHIVED · READ-ONLY
Started by BaronVampson 5 posts View original ↗
  1. 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?
  2. It most likely needs to be a lowercase `M` so `mp` and not `Mp`
    PHP:
    $gameParty.leader().mp >= 1
  3. 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
  4. 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.
  5. BaronVampson said:
    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?

    BaronVampson said:
    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.