< >
Hello, guest! Please log in or register.

The PokéCommunity

Go Back     The PokéCommunity Forums > Create & Discover > Game Development > Pokémon Essentials Question Allowing wild encounters with an empty party

Notices

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.

Reply Post Reply
 
Thread Tools
  #1    
Old August 28th, 2013 (3:18 PM).
Joltik's Avatar
Joltik Joltik is offline
 
Join Date: Jan 2010
Gender: Male
Nature: Modest
Posts: 113
Hello everyone,

Does anyone knows where in the scripts can I find the part where it prevents you from having an encounter if you have no pokemon with you? How would I go to relax this condition if a certain switch was on?

Thank you in advance!

Giu
Reply With Quote

Relevant Advertising!

  #2    
Old August 28th, 2013 (8:39 PM).
dexter1o6 dexter1o6 is offline
 
Join Date: Jul 2013
Age: 27
Gender: Male
Posts: 64
If I remember correctly, there is a definition called 'pbOnStepTaken' or something probably in PokemonField. I recon that's where you will find your answer. Let me know if you can find it, because I've seen this part of the script somewhere and I might be able to have a look for you.
Reply With Quote
  #3    
Old August 29th, 2013 (4:33 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,278
Dexter is right, almost.
Code:
def pbBattleOnStepTaken
  if $Trainer.party.length > 0
    encounterType=$PokemonEncounters.pbEncounterType
    if encounterType>=0
      encounter=$PokemonEncounters.pbGenerateEncounter(encounterType)
      if $PokemonEncounters.isEncounterPossibleHere?()
        encounter=EncounterModifier.trigger(encounter)
        if $PokemonEncounters.pbCanEncounter?(encounter)
          if $PokemonGlobal.partner
            encounter2=$PokemonEncounters.pbEncounteredPokemon(encounterType)
            pbDoubleWildBattle(encounter[0],encounter[1],encounter2[0],encounter2[1])
          else
            pbWildBattle(encounter[0],encounter[1])
          end
        end
        EncounterModifier.triggerEncounterEnd()
      end
    end
  end
end
In PokemonField.
Reply With Quote
  #4    
Old August 29th, 2013 (5:09 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,949
That's definitely not the only thing you'd need to play with in order to actually make the battle work. A Pokémon battle very much depends on the player having a Pokémon they can use, and if you don't, there's going to be so many bits of code which don't work. I can't imagine what you want to do with such a feature will be worth the effort of making it work.

The "easiest" solution is to turn such wild battles into Safari Zone battles, but then you'll run into different issues relating to how Safari Zone battles trigger, occur and appear (e.g. Safari Zone battles are hardcoded to use Safari Balls). Not as many issues as above, but they'd still need to be resolved.

It may be easier to just turn your starter selection process into a mini-Safari Zone itself, rather than trying to take some aspects from it or make something new.
Reply With Quote
  #5    
Old August 29th, 2013 (7:59 AM).
Joltik's Avatar
Joltik Joltik is offline
 
Join Date: Jan 2010
Gender: Male
Nature: Modest
Posts: 113
Quote:
Originally Posted by Maruno View Post
That's definitely not the only thing you'd need to play with in order to actually make the battle work. A Pokémon battle very much depends on the player having a Pokémon they can use, and if you don't, there's going to be so many bits of code which don't work. I can't imagine what you want to do with such a feature will be worth the effort of making it work.

The "easiest" solution is to turn such wild battles into Safari Zone battles, but then you'll run into different issues relating to how Safari Zone battles trigger, occur and appear (e.g. Safari Zone battles are hardcoded to use Safari Balls). Not as many issues as above, but they'd still need to be resolved.

It may be easier to just turn your starter selection process into a mini-Safari Zone itself, rather than trying to take some aspects from it or make something new.
I think Nickalooose's part of the code is what I'm looking for.
Maruno, that's exactly what I'm trying to do. The problem is that Safari Zone Battles doesn't trigger unless you have at least one pokemon.
Thank you all for your help!
Reply With Quote
  #6    
Old August 29th, 2013 (11:16 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,278
In the past I started a battle with 0 Pokémon, script, was meant to be used for the "old man" skit, I'm pretty sure I gave Maruno the scripts I used... But it works anyway... Why do you want such a battle?
Reply With Quote
  #7    
Old August 29th, 2013 (10:37 PM).
Joltik's Avatar
Joltik Joltik is offline
 
Join Date: Jan 2010
Gender: Male
Nature: Modest
Posts: 113
My plan was to make a little Safari Game before you receive a pokemon.
Reply With Quote
  #8    
Old August 30th, 2013 (2:45 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,278
So, is that how you catch your starter?
Because with this information, we can help a lot more, since I don't know about Maruno, but I thought you just wanted your player to get ambushed and beat up lol.
Reply With Quote
  #9    
Old August 30th, 2013 (5:29 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,949
I'd already guessed he wanted a Safari area for catching a starter in, and I've mentioned a few things he'll need to consider.
Reply With Quote
  #10    
Old September 30th, 2013 (12:22 PM).
icherich icherich is offline
 
Join Date: Sep 2013
Posts: 1
So is there a way to end a safari game after one pokemon has been catched, or reduce the balls amount to 1 while increasing their catch rate to 100%? I'm interested in this as well, at the moment I'm trying to produce a script checking for your party members, then removing all your steps left after you got your first pokemon...
Reply With Quote
  #11    
Old October 1st, 2013 (11:07 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,278
Modifying the capture rate is easiest and is located in PokemonBalls;
Code:
BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc{|ball,catchRate,battle,battler|
   next (catchRate*3/2).floor
})
Make it look something like
Code:
BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc{|ball,catchRate,battle,battler|
   catchRate=(catchRate*3/2).floor
   catchRate=255 if $game_switches[x]
   next catchRate
})
This should make your SafariBall catch any Pokémon, providing you turn switch X, on... X is the switch number you set it as.

Ending the "safari game" in PokeBattle_Battle would be easiest, around line 210, make the if pbIsSnagBall?, part, look like this:
Code:
          if pbIsSnagBall?(ball) && @opponent
            pokemon.pbUpdateShadowMoves rescue nil
            @snaggedpokemon.push(pokemon)
          else
            pbStorePokemon(pokemon)
            pbSafariState.decision=1 if $game_switches[x]
          end
Again, X, is the same switch as you set earlier... This is untested.
Reply With Quote
Reply Post Reply
Quick Reply

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 11:15 PM.


Contact Us Archive Privacy Statement Terms of Service Top