• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

Released Making it unable to use Poke Balls

This project has a release available. The full version is still a work in progress.

Jedi Knight

Rookie
Member
Joined
Apr 20, 2025
Posts
2
I will soon have a dungeon with some mutated Pokémon, which have different stats, abilities, types etc. compared to their usual form.However, i don't want the player to be able to catch them. They will be wild encounters, so i cant make an event for every square saying "battle rule = disable pokeball" (i know that isnt the correct formula)

Is there a way in the map metadata or in the script so i can make it impossible for the player to use their balls while being in a certain map?
 
You're in luck, because Essentials has a native feature that does that!

Open up the Script Editor. Scroll down to [[Battle]]. Immediately underneath that is Battle. Click there.

You should see some code like this (if it's slightly different, that's fine, I've put my own stupid edits in):
Code:
Expand Collapse Copy
  #=============================================================================
  # Creating the battle class
  #=============================================================================
  def initialize(scene, p1, p2, player, opponent)
    if p1.length == 0
      raise ArgumentError.new(_INTL("Party 1 has no Pokémon."))
    elsif p2.length == 0
      raise ArgumentError.new(_INTL("Party 2 has no Pokémon."))
    end
  
  
    #kwatar add. Basically just sets a global variable that battle has begun
    $game_switches[439] = true
  
    @scene             = scene
    @peer              = Peer.new
    @battleAI          = AI.new(self)
    @field             = ActiveField.new    # Whole field (gravity/rooms)
    @sides             = [ActiveSide.new,   # Player's side
                          ActiveSide.new]   # Foe's side
    @positions         = []                 # Battler positions
    @battlers          = []
    @sideSizes         = [1, 1]   # Single battle, 1v1
    @backdrop          = ""
    @backdropBase      = nil
    @time              = 0
    @environment       = :None   # e.g. Tall grass, cave, still water
    @turnCount         = 0
    @decision          = 0
    @caughtPokemon     = []
    player   = [player] if !player.nil? && !player.is_a?(Array)
    opponent = [opponent] if !opponent.nil? && !opponent.is_a?(Array)
    @player            = player     # Array of Player/NPCTrainer objects, or nil
    @opponent          = opponent   # Array of NPCTrainer objects, or nil
    @items             = nil
    @ally_items        = nil        # Array of items held by ally. This is just used for Mega Evolution for now.
    @party1            = p1
    @party2            = p2
    @party1order       = Array.new(@party1.length) { |i| i }
    @party2order       = Array.new(@party2.length) { |i| i }
    @party1starts      = [0]
    @party2starts      = [0]
    @internalBattle    = true
    @debug             = false
    @canRun            = true
    @canLose           = false
    @switchStyle       = true
    @showAnims         = true
    @controlPlayer     = false
    @expGain           = true
    @moneyGain         = true
    @disablePokeBalls  = false
    @sendToBoxes       = 1
    @rules             = {}
    @priority          = []
    @priorityTrickRoom = false
    @choices           = []
    @megaEvolution     = [
      [-1] * (@player ? @player.length : 1),
      [-1] * (@opponent ? @opponent.length : 1)
    ]
    @initialItems      = [
      Array.new(@party1.length) { |i| (@party1) ? @party1.item_id : nil },
      Array.new(@party2.length) { |i| (@party2) ? @party2.item_id : nil }
    ]
    @recycleItems      = [Array.new(@party1.length, nil),   Array.new(@party2.length, nil)]
    @belch             = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
    @battleBond        = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
    @corrosiveGas      = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
    @usedInBattle      = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
    @successStates     = []
    @lastMoveUsed      = nil
    @lastMoveUser      = -1
    @switching         = false
    @futureSight       = false
    @endOfRound        = false
    @moldBreaker       = false
    @runCommand        = 0
    @nextPickupUse     = 0

Now, after @disablePokeBalls = false, put the following:

Code:
Expand Collapse Copy
if $game_switches[XXXX] == true
@disablePokeBalls = true
end
Notice there I have XXXX. Swap that to a certain switch in your game. Whatever number that switch is, replace the XXXX in there. So, $game_switches[39] if it's number 39.


Basically, that checks if the switch is on and will disable using Pokeballs as long as you leave that switch on.
 
Back
Top