Notices
For all updates, view the main page.

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
 
Thread Tools
  #1    
Old March 20th, 2013 (11:10 PM). Edited June 1st, 2016 by mej71.
Yusshin's Avatar
Yusshin Yusshin is offline
♪ Yggdrasil ♪
 
Join Date: Jul 2009
Location: Quebec, Canada
Age: 23
Nature: Brave
Posts: 2,424
Spent about an hour using Search and going through the Wiki, using terms like "Uncatchable Pokemon," "Force Pokemon Battle," etc. and finally landed on "Event Encounters."

Now I look through the Wiki and I've searched here, terms such as "can't catch," "can't capture," "prohibit capture," etc. and nothing pops up, so I shall ask:

http://pokemonessentials.wikia.com/wiki/Event_encounters

Quote:
Invent certain battle conditions that depend on a Global Switch being ON (e.g. all Poké Balls used will always fail, or the weather randomly changes every turn), and turn that Switch ON just before the battle (and OFF again afterwards, of course). In this way, you can customise certain wild encounters to make them unique/harder.
How do I make a switch like that, where you are prohibited from using PokeBalls? I don't want the player to be able to capture a Pokemon; just defeat it.

A quick ALT+F search for "Pokeball" here:

http://pokemonessentials.wikia.com/wiki/Events

Indicates it's a customized switch and not a pre-implemented one.

Thanks.
__________________


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club
Reply With Quote

Relevant Advertising!

  #2    
Old March 21st, 2013 (6:58 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,294
Basically, within the script section on RPGMaker, you need to put a switch-script in there.

So first things first, find where you will edit... The script that already does this, exists already, so we'll use that as a base and a place to start:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
That there is an already working script that we can use... To find it, press CTRL+SHIFT+F, type "don't be a thief", viola.

Now we'll want to add our "own" script to make our battles do what we want:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
    if $game_switches[227]==true
    @scene.pbThrowAndDeflect(ball,1)
    pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
    return
    end
So we'll enter our own script directly underneath the already working script... Now within the event you want to use this new script, turn switch 227, on before the battle.

You can also do this with wild Pokémon such as legendaries that you don't want to be caught at a certain time:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
    if $game_switches[450]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("Seems \n{1} doesn't want to be caught!",wildpoke.name))
      return
    end
Notice the green part, that will call the opposing Pokémons name where {1} exists... Again, turn switch 450, on before the battle.

There is no limit to how many you can use, just keep adding them directly under the original and/or after your new "script".

Have fun.
Reply With Quote
  #3    
Old March 21st, 2013 (6:51 PM). Edited March 22nd, 2013 by Yusshin.
Yusshin's Avatar
Yusshin Yusshin is offline
♪ Yggdrasil ♪
 
Join Date: Jul 2009
Location: Quebec, Canada
Age: 23
Nature: Brave
Posts: 2,424
Hey Nick, I really appreciate you answering me on this :D but it's a lot of information to apply, and I'm still a bit confused.

Spoiler:
I think I kinda get it better. I approached this wrong...

I went into Script Database and I found this in PokeBattle_Battle:

end
if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
pokemon=battler.pokemon
species=pokemon.species
if !rareness
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,species,16)
rareness=dexdata.fgetb # Get rareness from dexdata file
dexdata.close
end

So where do I put this:

if $game_switches[227]==true
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
return
end

I know you said right underneath, but there's already stuff underneath it! so does it go underneath that stuff, or above it, and how do I preserve the already-conditional'd branch in the script?

I did this:



but I can still catch the Pokemon, even when I add this script to true above the Pokemon battle:

$game_switches[227]==true

It just ignores what I added in the script...


I misunderstood what a Global Switch meant! I just call them Switch and Self-Switch so I figured Global Switch was an internal Pokemon Essentials thing.

Thanks Nick :D
__________________


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club
Reply With Quote
  #4    
Old March 22nd, 2013 (6:09 PM). Edited March 22nd, 2013 by Yusshin.
Yusshin's Avatar
Yusshin Yusshin is offline
♪ Yggdrasil ♪
 
Join Date: Jul 2009
Location: Quebec, Canada
Age: 23
Nature: Brave
Posts: 2,424
I have a new issue now.

The reason the Pokemon is uncatchable is because of its moveset.

I'm trying to edit in in PokemonEncounterModifiers, as per the Wiki, into this:

Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[79]
pbAutoLearnMove(poke,PBMoves::BUBBLEBEAM)
pbAutoLearnMove(poke,PBMoves::THUNDERWAVE)
pbAutoLearnMove(poke,PBMoves::EMBER)
pbAutoLearnMove(poke,PBMoves::THUNDERSHOCK)
end
}

But I get an error in-game that says:

Spoiler:
---------------------------
PKMN
---------------------------
Exception: RuntimeError

Message: Script error within event 3, map 35 (Power Plant):

Exception: NameError

Message: Section087:11undefined local variable or method `poke' for nil:NilClass

***Full script:

pbWildBattle(PBSpecies::PIKACHU,18)


Interpreter:243:in `pbExecuteScript'

PokemonEncounterModifiers:8:in `call'

PBEvent:54:in `trigger'

PBEvent:49:in `each'

PBEvent:49:in `trigger'

PokemonField:956:in `pbGenerateWildPokemon'

PokemonField:980:in `pbWildBattle'

(eval):1:in `pbExecuteScript'

Interpreter:1600:in `eval'

Interpreter:243:in `pbExecuteScript'



Interpreter:276:in `pbExecuteScript'

Interpreter:1600:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:103:in `update'

Scene_Map:101:in `loop'

Scene_Map:114:in `update'

Scene_Map:68:in `main'



This exception was logged in

C:\Users\Irene\Saved Games/PKMN/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


What's wrong? I know it can learn moves outside its set, because it tried to add these to my Oshawott when I added poke=$Trainer.party[0]

I tried adding these inside the script (after the game switch is turned on):

poke=$Trainer.party[0]
poke=pbFirstAblePokemon
poke=pbGetPokemon(1)
* Tried the third one as poke=pbGetPokemon(PIKACHU) and it did not work either

The first one edits MY Pokemon; the other two turn up as Run-Time errors when initiating the battle.
__________________


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club
Reply With Quote
  #5    
Old March 23rd, 2013 (7:27 AM).
TACHAN TACHAN is offline
 
Join Date: Jan 2010
Gender: Female
Posts: 198
Use this:

Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[79]
pbAutoLearnMove(pokemon,PBMoves::BUBBLEBEAM)
pbAutoLearnMove(pokemon,PBMoves::THUNDERWAVE)
pbAutoLearnMove(pokemon,PBMoves::EMBER)
pbAutoLearnMove(pokemon,PBMoves::THUNDERSHOCK)
end
}
Reply With Quote
  #6    
Old March 23rd, 2013 (7:45 AM).
Yusshin's Avatar
Yusshin Yusshin is offline
♪ Yggdrasil ♪
 
Join Date: Jul 2009
Location: Quebec, Canada
Age: 23
Nature: Brave
Posts: 2,424
That worked :D Thanks a lot, guys
__________________


Polaret | Fourette | Ecuret | Axew | Zorua | Nanette [Shiny]
"My scar makes me sassy, child!"
The Big Bang Theory Fan Club - Click To Join!
The French Club
Reply With Quote
  #7    
Old May 24th, 2016 (10:58 AM).
KingOrgana's Avatar
KingOrgana KingOrgana is offline
シン・ゴジラ
 
Join Date: May 2012
Location: Florida
Age: 21
Gender: Male
Posts: 2
Quote:
Originally Posted by Nickalooose View Post
Basically, within the script section on RPGMaker, you need to put a switch-script in there.

So first things first, find where you will edit... The script that already does this, exists already, so we'll use that as a base and a place to start:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
That there is an already working script that we can use... To find it, press CTRL+SHIFT+F, type "don't be a thief", viola.

Now we'll want to add our "own" script to make our battles do what we want:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
    if $game_switches[227]==true
    @scene.pbThrowAndDeflect(ball,1)
    pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
    return
    end
So we'll enter our own script directly underneath the already working script... Now within the event you want to use this new script, turn switch 227, on before the battle.

You can also do this with wild Pokémon such as legendaries that you don't want to be caught at a certain time:

Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
    if $game_switches[450]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("Seems \n{1} doesn't want to be caught!",wildpoke.name))
      return
    end
Notice the green part, that will call the opposing Pokémons name where {1} exists... Again, turn switch 450, on before the battle.

There is no limit to how many you can use, just keep adding them directly under the original and/or after your new "script".

Have fun.
If there if no limit, then I'm doing something wrong.

Here's my code:
Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else
    if $game_switches[59]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("This GDF Mech cannot be caught!"))
    else
    if $game_switches[60]==true
      @scene.pbThrowAndDeflect(ball,1)
    pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
    return
  end
The first code I entered (the one with GDF mech, underneath "don't be a thief") gives me no problems.

However, when I added a second code.....
I get an error that reads "Script 'PokeBattle_Battle' line 4089: SyntaxError occured".
I would also like to note that I have switches configured.

What could I possibly be doing wrong?
__________________

Jirachi|Draconovus|Godzilla
Because why not.
Reply With Quote
  #8    
Old May 24th, 2016 (11:40 AM).
Rot8er_ConeX's Avatar
Rot8er_ConeX Rot8er_ConeX is offline
 
Join Date: May 2015
Location: The Dissa Region
Gender: Male
Posts: 698
Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
      return
    elsif $game_switches[59]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("This GDF Mech cannot be caught!"))
      return
    elsif $game_switches[60]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
      return
    end
Else/if means you'd need two "end"s. "elsif" is else and if in a single command, and counts as an extension of the existing "if" tree.

@Vendily: The indents aren't actually important; if I remember correctly, the compiler completely removes them. They're only there for human legibility.
__________________
Features of Pokemon Entropy

The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
Reply With Quote
  #9    
Old May 26th, 2016 (7:08 AM).
KingOrgana's Avatar
KingOrgana KingOrgana is offline
シン・ゴジラ
 
Join Date: May 2012
Location: Florida
Age: 21
Gender: Male
Posts: 2
Quote:
Originally Posted by Rot8er_ConeX View Post
Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
      return
    elsif $game_switches[59]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("This GDF Mech cannot be caught!"))
      return
    elsif $game_switches[60]==true
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Pokémon attacked the Ball!\nSeems it cannot be caught!"))
      return
    end
Else/if means you'd need two "end"s. "elsif" is else and if in a single command, and counts as an extension of the existing "if" tree.

@Vendily: The indents aren't actually important; if I remember correctly, the compiler completely removes them. They're only there for human legibility.
It worked! Thanks!
__________________

Jirachi|Draconovus|Godzilla
Because why not.
Reply With Quote
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 5:51 AM.