• 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.

[Question] Intem that changes the Normal types.

  • 68
    Posts
    6
    Years
    • Seen Aug 25, 2023
    Hey! So, i have a question here, I looked for it but i haven't found anything so i'll make the question.

    The thing is that I wanted to turn the Arceus Plates into items that changes the Normal Type moves into the type of the tablet, for example, if an Oddish has the Flame plate equiped and uses Tackle, Tackle will be Fire Type instead of Normal Type.

    Well, I made it work pretty well, it was pretty easy actually, but, is kinda OP, so i wanted to make a restriction and make that this ONLY works for just 1 pokémon per combat, so thats the hard part, i have no idea of how to make it, i tried something but I wanted to work for just 1 pokemon (the first pokémon that comes out of a Pokéball with a plate), and to persist if the Pokémon is changed. So, if anyone can help me, I'll be so grateful.

    Thanks.
     
    That's a good idea for a game, because it makes you rethink the whole game! Very nice for a fangame.

    About your question. I suggest you check out how Mega-Evolution works, and in particular, I suggest you track the uses of the attribute "@megaEvolution" in the class PokeBattle_Battle.

    It is an array @megaEvolution : side x trainer -> index of battler. "side" will be either 0 or 1 (0 being your side, and 1 being the opposite side), "trainer" will be the number of the corresponding trainer. In a standard 1v1, the player is number 0 and the opponent is number 1, and in 2v2, the player is number 0, the ally is number 1 on side 0, and the opponents are numbers 0 and 1 in side 1.
    When a trainer decides to Mega-Evolve one of its POkémons, the attribute @megaEvolution will be set to the number of the Pokémon in battle. If the same trainer tries to Mega-Evolve another Pokémon, the attribute will have stored the previous Mega-Evolution, and the game will forbid it.

    SO. My idea is. (Make a separate script and use the rewriting of functions that Ruby allows, using the "alias" keyword)
    Create a new parameter for PokeBattle_Battle, initialise it just like @megaEvolution. Then, create BattleHandler for the Plates, that activates on switch-in:
    Code:
    BattleHandlers::ItemOnSwitchIn.add(:ALL_THE_PLATES,
      proc { |item,battler,battle|
        # Check battle.arceusPlate (assuming you call your attribute arceusPlate)
        # If the value is -1 then the plate activates, stores the index of your Pokémon in your team, 
        # otherwise the plate doesn't activate, unless it's the same Pokémon that activated it the first time.
        # In either case, I suggest you display a message so the player knows what is happening (use the function battle.pbDisplay("Message"))
      }
    )
     
    Last edited:
    Well, I forgot to say 2 things xd. First i'm not so good programming and 2 i'm still using essentials 17.2., so i couldn't find "ItemOnSwitchIn", i think that isn't in the 17 version, sadly.

    I tried something with counters, when a Pokémon enters the field with a Plate the counters gets +1 and if the counter is over 1 then the item doesn't work. But it makes the game super lag for some reason D:
     
    SO. My idea is. (Make a separate script and use the rewriting of functions that Ruby allows, using the "alias" keyword)
    Create a new parameter for PokeBattle_Battle, initialise it just like @megaEvolution. Then, create BattleHandler for the Plates, that activates on switch-in:
    Code:
    BattleHandlers::ItemOnSwitchIn.add(:ALL_THE_PLATES,
      proc { |item,battler,battle|
        # Check battle.arceusPlate (assuming you call your attribute arceusPlate)
        # If the value is -1 then the plate activates, stores the index of your Pokémon in your team, 
        # otherwise the plate doesn't activate, unless it's the same Pokémon that activated it the first time.
        # In either case, I suggest you display a message so the player knows what is happening (use the function battle.pbDisplay("Message"))
      }
    )

    I will try with that then, i'll try to make the @plate
     
    Ok, ok, i manage something, is not exactly what i wanted but i think is better. I managed to make it work with counters, I fixed the lag (think it was too heavy what i was trying) I made 1 counter per Plate, and now if the player activate 2 plates and 2 counters, the whole team loses 50% of their attacks and defenses. So yeah, the player can use 2 plates, but it wont be worth xd.
     
    Ok, ok, i manage something, is not exactly what i wanted but i think is better. I managed to make it work with counters, I fixed the lag (think it was too heavy what i was trying) I made 1 counter per Plate, and now if the player activate 2 plates and 2 counters, the whole team loses 50% of their attacks and defenses. So yeah, the player can use 2 plates, but it wont be worth xd.

    Hmmm, I beg to differ.
    This sounds like "punishing" the player for trying something that they think would benefit them and that sounds logical to them. This is kind of mean, and unfair, from the player's point of view. But if you revise your code and think of those plates like Mega-Evolution, it will be more fair if nothing happens if you try to use a second Pokémon with a plate.
    If you managed to make counters, I assume it shouldn't be too hard to adapt this code so that it stores battler.pokemonIndex instead of a counter, and everytime a Pokémon is sent out to battle, you check whether pokemonIndex is the one stored. If it is the one stored, them the plate is available, otherwise it is disabled.
    (Note: I know only v18.1 so apologies if some attributes / classes don't exist in v17, but we can always adapt as I'm sure Mega-Evolutions are coded in some way XD).
     
    Last edited:
    Back
    Top