• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] V18: Gaining no EXP for battles?

  • 5
    Posts
    5
    Years
    • Seen Jul 30, 2024
    Hello there, thanks for taking the time to read!

    I'm currently trying to figure out how to script a switch that will turn off EXP for certain battles (Challenge battles in my game that provide cool prizes) as the battles end up leaving playtesters far too over leveled for later areas, but I'm not quite sure where to even begin in the current version of essentials. If someone could help direct me, I would be extremely grateful.
     
    In v18 you need to write setBattleRule("canLose").
    It's "can't lose" by default, meaning you'll black out and run back to a Poké Centre if you lose.
    The rules are at the top of script section PField_Battles.
    The rules:
    "single", "1v1", "1v2", "2v1", "1v3", "3v1","double", "2v2", "2v3", "3v2", "triple", "3v3"
    "canlose"
    "cannotlose"
    "canrun"
    "cannotrun"
    "roamerflees"
    "noexp"
    "noMoney"
    "switchstyle"
    "setstyle"
    "anims"
    "noanims"
    "terrain"=> (something from PBBattleTerrains)
    "weather"=> (something from PBWeather)
    "environment" =>(something from PBEnvironment)
    "backdrop"=>filename
    "base" =>filename
    "outcomevar"=>variable number
    "nopartner"

    So what you need to do is before these challenge battles have the Script Command setBattleRule("noexp") before the command for the battle.
     
    Last edited:
    Ah, I see the battle rules, but I'm not quite sure how to insert it in a trainer event.
     
    Yeah just inserting that into the trainer event doesn't work at all. I can read, please don't insult me.
     
    In v18 you need to write setBattleRule("canLose").
    It's "can't lose" by default, meaning you'll black out and run back to a Poké Centre if you lose.
    The rules are at the top of script section PField_Battles.
    The rules:
    "single", "1v1", "1v2", "2v1", "1v3", "3v1","double", "2v2", "2v3", "3v2", "triple", "3v3"
    "canlose"
    "cannotlose"
    "canrun"
    "cannotrun"
    "roamerflees"
    "noexp"
    "noMoney"
    "switchstyle"
    "setstyle"
    "anims"
    "noanims"
    "terrain"=> (something from PBBattleTerrains)
    "weather"=> (something from PBWeather)
    "environment" =>(something from PBEnvironment)
    "backdrop"=>filename
    "base" =>filename
    "outcomevar"=>variable number
    "nopartner"

    So what you need to do is before these challenge battles have the Script Command setBattleRule("noexp") before the command for the battle.

    Question, can we initialize more than one battle rule? If so, how can we do so? Do we just declare setBattleRule() more than once or put all the battle rules inside one setBattleRule() declaration.
     
    Question, can we initialize more than one battle rule? If so, how can we do so? Do we just declare setBattleRule() more than once or put all the battle rules inside one setBattleRule() declaration.

    It'd be safer to make separate Battle Rule calls.
     
    Back
    Top