• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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] Is there a way I can make trick room an ability?

  • 9
    Posts
    4
    Years
    • Seen Jun 10, 2023
    Every thread I've seen so far has not given me a solution that works to making trick room an ability. I'm using an older version of essentials being V17.2 but I was wondering if anyone could tell me how I could do it? I understand if nobody knows since I'm using an older version...

    I've tried making it myself to no luck. I put his right above intimidate in PokeBattle_Battler:

    Spoiler:


    Does anyone know how I can get this to work?
     
    There were a few errors in your code: @field doesn't exist, what you want is @battle.field. Also there is no attacker here, it's supposed to be the active battler (hence self, which can be avoided).

    This should work:
    Code:
        if self.hasWorkingAbility(:TRICKERY) && @battle.effects[PBEffects::TrickRoom]==0
          @battle.field.effects[PBEffects::TrickRoom]=3
          PBDebug.log("[Ability triggered] #{pbThis}'s Trickery")
          @battle.pbDisplay(_INTL("{1} twisted the dimensions!",pbThis))
        end
     
    There were a few errors in your code: @field doesn't exist, what you want is @battle.field. Also there is no attacker here, it's supposed to be the active battler (hence self, which can be avoided).

    This should work:
    Code:
        if self.hasWorkingAbility(:TRICKERY) && @battle.effects[PBEffects::TrickRoom]==0
          @battle.field.effects[PBEffects::TrickRoom]=3
          PBDebug.log("[Ability triggered] #{pbThis}'s Trickery")
          @battle.pbDisplay(_INTL("{1} twisted the dimensions!",pbThis))
        end

    The errors you mentioned make sense when I look at it. Unfortunately the code you sent did not work for me. The error message is as follows:
    [PokeCommunity.com] Is there a way I can make trick room an ability?

    Could I just be posting the code in wrong location? I put it in the same location as my previous code, right above intimidate in PokeBattle_Battler.
     
    The errors you mentioned make sense when I look at it. Unfortunately the code you sent did not work for me. The error message is as follows:
    View attachment 99943

    Could I just be posting the code in wrong location? I put it in the same location as my previous code, right above intimidate in PokeBattle_Battler.

    No, it's my bad, it's another error I didn't see lol: instead of @battle.effects, it should be @battle.field.effects

    Code:
        if self.hasWorkingAbility(:TRICKERY) && @battle.field.effects[PBEffects::TrickRoom]==0
          @battle.field.effects[PBEffects::TrickRoom]=3
          PBDebug.log("[Ability triggered] #{pbThis}'s Trickery")
          @battle.pbDisplay(_INTL("{1} twisted the dimensions!",pbThis))
        end
     
    No, it's my bad, it's another error I didn't see lol: instead of @battle.effects, it should be @battle.field.effects

    Code:
        if self.hasWorkingAbility(:TRICKERY) && @battle.field.effects[PBEffects::TrickRoom]==0
          @battle.field.effects[PBEffects::TrickRoom]=3
          PBDebug.log("[Ability triggered] #{pbThis}'s Trickery")
          @battle.pbDisplay(_INTL("{1} twisted the dimensions!",pbThis))
        end

    It worked! Thank you so much! (:
     
    Back
    Top