Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old September 26th, 2013 (8:14 AM).
pokemonmasteraaron's Avatar
pokemonmasteraaron pokemonmasteraaron is offline
The blind Pokémon Master!
     
    Join Date: Jan 2011
    Location: In the forest of an undiscovered region
    Age: 21
    Gender: Male
    Nature: Relaxed
    Posts: 314
    Hi!
    I would like to remove a Pokemon from the player's party when it faints, meaning it dies.
    I won't worry about changing the text, not yet anyway. String manipulation is easy.
    Anyway, I am wanting to know how this would be done?
    I know of the pbRemovePokemonAt(index) function.
    Where would I put this in the script? I don't know my way around essentials very well. Additionally, I want to store the most recently killed Pokemon in a variable for a potential method of revival.
    This whole thing seems very easy, I'm just not sure where it goes. Will it need to be changed in multiple locations?
    Thanks!
    __________________
    Game developer.
    Not nearly as active on here as I used to be.
    Still like meeting and talking to pokemon fanatics like myself.
    Reply With Quote

    Relevant Advertising!

      #2    
    Old September 26th, 2013 (8:41 AM).
    zingzags's Avatar
    zingzags zingzags is offline
    PokemonGDX creator
       
      Join Date: Jan 2009
      Location: Boston
      Age: 23
      Nature: Adamant
      Posts: 562
      You put it where the faint function is called which should be in PokeBattle_ActualScene or w.e. I do not think you should need to use a game variable, I bet it already gets the index of the pokemon in the party. Then again, its been awhile since I opened up essentials.
      __________________
      Check out the Pokemon Game Engine I am working on:
      https://github.com/sjosegarcia/Pokemon
      Reply With Quote
        #3    
      Old September 26th, 2013 (2:32 PM).
      Maruno's Avatar
      Maruno Maruno is offline
      Lead Dev of Pokémon Essentials
         
        Join Date: Jan 2008
        Location: England
        Posts: 5,185
        It's a whole can of worms, actually. The main issue is that there's no support for adding/removing Pokémon in the player's party during a battle. Trying to do so will quickly result in a mess.

        My suggestion would be to check after every battle for fainted Pokémon and delete them then (and then check for an empty party for a black-out). However, this wouldn't take into account the order in which they fainted. It'd also leave fainted Pokémon in the party (albeit unusable) until the end of the battle. Still, I think it's the best option, unless you want to change how your Nuzlocke mode works.

        There are of course other problems with deleting Pokémon, such as the player getting trapped in an area which they needed an HM to get into but the only Pokémon that could learn it was killed. This looks particularly odd if you find yourself surfing on a dead Pokémon (lingering effects like surfing/diving/Strength would need to be stopped once the user dies and there's no replacement user).
        __________________
        Go to the Pokémon Essentials Wiki

        | Downloads | Tutorials | Fangames |
        | All Animations Project |

        Follow me on Twitter: @maruno42


        Reply With Quote
          #4    
        Old September 27th, 2013 (10:57 AM).
        pokemonmasteraaron's Avatar
        pokemonmasteraaron pokemonmasteraaron is offline
        The blind Pokémon Master!
           
          Join Date: Jan 2011
          Location: In the forest of an undiscovered region
          Age: 21
          Gender: Male
          Nature: Relaxed
          Posts: 314
          OK. Not concerned with the hm/tm thing. I would like to know what checking and removing Pokemon would look like, though. How would that be done? Also, I'm not sure which script to put it in still.
          __________________
          Game developer.
          Not nearly as active on here as I used to be.
          Still like meeting and talking to pokemon fanatics like myself.
          Reply With Quote
            #5    
          Old September 27th, 2013 (1:46 PM).
          Maruno's Avatar
          Maruno Maruno is offline
          Lead Dev of Pokémon Essentials
             
            Join Date: Jan 2008
            Location: England
            Posts: 5,185
            It really depends on how you want it to work. If you want the deletion to occur at the end of a battle, then find the parts of the code where ends of battles occur. An easy way is to find instances of the line:

            Code:
            if decision==2 || decision==5
            ...and stick something in just before it. That "something" could be:

            Code:
            for i in 0...$Trainer.party.length
              $Trainer.party[i]=nil if $Trainer.party[i].hp==0
            end
            $Trainer.party.compact!
            This code is used because it can delete the player's last usable Pokémon, which pbRemovePokemonAt can't do. This code, of course, outright deletes the Pokémon rather than putting them into a "last fainted Pokémon" variable to wait for a potential revive.

            If Pokémon can faint from poison while walking around, or faint for any other reason while walking around, you should also put this code in the appropriate script(s) to make sure they die rather than just faint.

            This approach is untested.
            __________________
            Go to the Pokémon Essentials Wiki

            | Downloads | Tutorials | Fangames |
            | All Animations Project |

            Follow me on Twitter: @maruno42


            Reply With Quote
            Reply

            Quick Reply

            Join the conversation!

            Create an account to post a reply in this thread, participate in other discussions, and more!

            Create a PokéCommunity Account

            Sponsored Links
            Thread Tools

            Posting Rules
            You may not post new threads
            You may not post replies
            You may not post attachments
            You may not edit your posts

            BB code is On
            Smilies are On
            [IMG] code is On
            HTML code is Off

            Forum Jump


            All times are GMT -8. The time now is 1:22 PM.