• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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

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:
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] }
 
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'
 
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'.
 
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?
 
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