Quick question about a formula

Discussion in 'RPG Maker VX Ace' started by Morpheus, Oct 16, 2017.

    Tags:
  1. Morpheus

    Morpheus Graphic Designer Veteran

    Messages:
    111
    Likes Received:
    8
    First Language:
    english
    Primarily Uses:
    N/A
    So if "if a.state?(16)" means "If the user has state 16 inflicted", how would I write it as "If the user DOES NOT have state 16 inflicted"?

    Or if anyone knows a way to make an item unusable if a state is inflicted that would help too...

    Thank you.
     
    Last edited: Oct 16, 2017
    #1
  2. boomy

    boomy Veteran Veteran

    Messages:
    107
    Likes Received:
    76
    Location:
    Melbourne, Australia
    First Language:
    English
    a.isStateAffected(16) == false ? outcome A : outcome B

    Putting ! in front of a conditional will invert the conditional as well

    eg.

    !a.isStateAffected(16) ? outcome A : outcome B

    Both lead to same results where outcome A happens if state 16 is not afflicted and outcome B happens if state 16 is afflicted


    Put ! infront of the conditional
    !a.state?(16)
     
    #2

Share This Page