• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Script: Punch Bag Game

54
Posts
4
Years
Did you added '@pkmn = pkmn' after line 'def pbStartScene(pkmn,rounds)'?

I've moved it to the correct place, but now i'm getting this error whenever i try to punch the bag instead:

Code:
---------------------------
Pokemon Immortal X/Oblivion Y
---------------------------
[Pokémon Essentials version 17.2]

Exception: RuntimeError

Message: Script error within event 23 (coords 30,16), map 82 (Route 2):

Exception: NoMethodError

Message: PMinigame_PunchingBag:61:in `giveSpecificEVs'undefined method `eachStat' for PBStats:Module

***Full script:

$game_variables[87] = pbPunchBag(5,true,true)


Interpreter:243:in `pbExecuteScript'

PMinigame_PunchingBag:52:in `giveEvs'

PMinigame_PunchingBag:50:in `each'

PMinigame_PunchingBag:50:in `giveEvs'

PMinigame_PunchingBag:287:in `updateAnimationPokemon'

PMinigame_PunchingBag:247:in `updateAnimation'

PMinigame_PunchingBag:206:in `pbMain'

PMinigame_PunchingBag:179:in `loop'

PMinigame_PunchingBag:207:in `pbMain'

PMinigame_PunchingBag:323:in `pbStartScreen'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:179:in `old_update_ab'

Scene_Map:177:in `loop'

Scene_Map:186:in `old_update_ab'

Acro/Mach Bike:229:in `update'
 
Last edited:

FL

Pokémon Island Creator
2,448
Posts
13
Years
  • Seen yesterday
I've moved it to the correct place, but now i'm getting this error whenever i try to punch the bag instead:

Code:
---------------------------
Pokemon Immortal X/Oblivion Y
---------------------------
[Pokémon Essentials version 17.2]

Exception: RuntimeError

Message: Script error within event 23 (coords 30,16), map 82 (Route 2):

Exception: NoMethodError

Message: PMinigame_PunchingBag:61:in `giveSpecificEVs'undefined method `eachStat' for PBStats:Module
The line 'PBStats.eachStat { |s| evTotal += @pkmn.ev[stat] }' only works starting on V18 . Change this line to
Code:
   [PBStats::HP,PBStats::ATTACK,PBStats::DEFENSE,
        PBStats::SPEED,PBStats::SPATK,PBStats::SPDEF].each { |s| evTotal += @pkmn.ev[s] }
 
54
Posts
4
Years
The line 'PBStats.eachStat { |s| evTotal += @pkmn.ev[stat] }' only works starting on V18 . Change this line to
Code:
   [PBStats::HP,PBStats::ATTACK,PBStats::DEFENSE,
        PBStats::SPEED,PBStats::SPATK,PBStats::SPDEF].each { |s| evTotal += @pkmn.ev[s] }

Now i get this error when i try to punch:
Code:
---------------------------
Pokemon Immortal X/Oblivion Y
---------------------------
[Pokémon Essentials version 17.2]

Exception: RuntimeError

Message: Script error within event 23 (coords 30,16), map 82 (Route 2):

Exception: NameError

Message: PMinigame_PunchingBag:63:in `giveSpecificEVs'uninitialized constant PokeBattle_Pokemon::EV_LIMIT

***Full script:

$game_variables[87] = pbPunchBag(5,true,true)


Interpreter:243:in `pbExecuteScript'

PMinigame_PunchingBag:52:in `giveEvs'

PMinigame_PunchingBag:50:in `each'

PMinigame_PunchingBag:50:in `giveEvs'

PMinigame_PunchingBag:288:in `updateAnimationPokemon'

PMinigame_PunchingBag:248:in `updateAnimation'

PMinigame_PunchingBag:207:in `pbMain'

PMinigame_PunchingBag:180:in `loop'

PMinigame_PunchingBag:208:in `pbMain'

PMinigame_PunchingBag:324:in `pbStartScreen'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:179:in `old_update_ab'

Scene_Map:177:in `loop'

Scene_Map:186:in `old_update_ab'

Acro/Mach Bike:229:in `update'
 

FL

Pokémon Island Creator
2,448
Posts
13
Years
  • Seen yesterday
Now i get this error when i try to punch:
Code:
---------------------------
Pokemon Immortal X/Oblivion Y
---------------------------
[Pokémon Essentials version 17.2]

Exception: RuntimeError

Message: Script error within event 23 (coords 30,16), map 82 (Route 2):

Exception: NameError

Message: PMinigame_PunchingBag:63:in `giveSpecificEVs'uninitialized constant PokeBattle_Pokemon::EV_LIMIT
Again, things created on V18. Change all 'EV_LIMIT' to 'EVLIMIT' and all 'EV_STAT_LIMIT' to 'EVSTATLIMIT'.
 

FL

Pokémon Island Creator
2,448
Posts
13
Years
  • Seen yesterday
Updated to work with v20.1. Also this script now gives EV/IVs as rewards!
 
1
Posts
2
Years
  • Age 19
  • Seen Nov 20, 2023
Hello, although I know it is for 20.1, I have tried to test it in 21.1 and no error occurs, the only problem is that both the bag and the bar are static, so it is not known when to hit, do you know how to solve it?
 

FL

Pokémon Island Creator
2,448
Posts
13
Years
  • Seen yesterday
Hello, although I know it is for 20.1
Actually, the script support multiple Essentials versions. Thanks for reporting an error with v21.1.

Hello, although I know it is for 20.1, I have tried to test it in 21.1 and no error occurs, the only problem is that both the bag and the bar are static, so it is not known when to hit, do you know how to solve it?
Here, the arrow disappears. I updated the script added arrow graphic, since it was removed in Essentials v21, and made the script FPS-agnostic,
 
Back
Top