• 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.
[v13+] Punch Bag Game

Resource [v13+] Punch Bag Game 1.2

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
307
-FL- submitted a new resource:

[v13+] Punch Bag Game - Simple minigame where the player must hit the center. EVs and IVs can be the rewards.

gif.gif
screen.png

The player select a pokémon for a simple minigame where he gains points the closer to the center the cursor is when the button is pressed. EVs and IVs can be the rewards.

Tested on Essentials v13, v18.1 and v20.1. If this script isn't working on latest Essentials version, please inform...

Read more about this resource...
 

BiggusWeeabus

"What's so funny about Biggus Dickus?"
Member
Joined
Sep 1, 2020
Posts
105
I'm in v19.1. When i hit a punch, this error mesage pops up:
Ruby:
Expand Collapse Copy
[Pokémon Essentials version 19.1]
[Generation 8 Project v1.1.2]

Exception: RuntimeError
Message: Script error in event 20 (coords 23,8), map 97 (Pokémon Center):
Exception: TypeError
Message: nil can't be coerced into Integer

***Full script:
param = PunchBag::Parameters.new(5)
param.stats = :HP
param.minScore = 10
param.setEvGain(5)
param.acceptFainted = true
param.blockMax = true
PunchBag.play(param)


Backtrace:
295:UI_PunchingBag:315:in `+'
295:UI_PunchingBag:315:in `computeScore'
295:UI_PunchingBag:366:in `updateAnimationBag'
295:UI_PunchingBag:345:in `updateAnimation'
295:UI_PunchingBag:305:in `update'
295:UI_PunchingBag:268:in `block in pbMain'
295:UI_PunchingBag:265:in `loop'
295:UI_PunchingBag:265:in `pbMain'
295:UI_PunchingBag:420:in `pbStartScreen'
295:UI_PunchingBag:438:in `block in play'


Backtrace:
033:Interpreter:192:in `rescue in execute_script'
033:Interpreter:138:in `execute_script'
034:Interpreter_Commands:1030:in `command_355'
034:Interpreter_Commands:116:in `execute_command'
033:Interpreter:130:in `block in update'
033:Interpreter:87:in `loop'
033:Interpreter:87:in `update'
033:Interpreter:100:in `block in update'
033:Interpreter:87:in `loop'
033:Interpreter:87:in `update'

This is the structure of the common event i'm using to call the minigame, not sure if there's something wrong with it:
Captura de tela 2023-01-05 185108.png
 

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
307
I'm in v19.1. When i hit a punch, this error mesage pops up:
Ruby:
Expand Collapse Copy
[Pokémon Essentials version 19.1]
[Generation 8 Project v1.1.2]

Exception: RuntimeError
Message: Script error in event 20 (coords 23,8), map 97 (Pokémon Center):
Exception: TypeError
Message: nil can't be coerced into Integer

***Full script:
param = PunchBag::Parameters.new(5)
param.stats = :HP
param.minScore = 10
param.setEvGain(5)
param.acceptFainted = true
param.blockMax = true
PunchBag.play(param)


Backtrace:
295:UI_PunchingBag:315:in `+'
295:UI_PunchingBag:315:in `computeScore'
295:UI_PunchingBag:366:in `updateAnimationBag'
295:UI_PunchingBag:345:in `updateAnimation'
295:UI_PunchingBag:305:in `update'
295:UI_PunchingBag:268:in `block in pbMain'
295:UI_PunchingBag:265:in `loop'
295:UI_PunchingBag:265:in `pbMain'
295:UI_PunchingBag:420:in `pbStartScreen'
295:UI_PunchingBag:438:in `block in play'


Backtrace:
033:Interpreter:192:in `rescue in execute_script'
033:Interpreter:138:in `execute_script'
034:Interpreter_Commands:1030:in `command_355'
034:Interpreter_Commands:116:in `execute_command'
033:Interpreter:130:in `block in update'
033:Interpreter:87:in `loop'
033:Interpreter:87:in `update'
033:Interpreter:100:in `block in update'
033:Interpreter:87:in `loop'
033:Interpreter:87:in `update'

This is the structure of the common event i'm using to call the minigame, not sure if there's something wrong with it:
View attachment 14883
You posted the script call code, the error and when the error occurs, very good!

I tested now on v19.1 and it's working. Also, ZeT0ken tested before on this Essentials. Your error sounds like @score or @lastScore are nil, but both are zeroed when scene starts.

I suggest you copy/pasting the script again (only script, not the graphics), maybe some line was accidentally deleted. If the error persists, try again on a fresh v19.1. If it works on v19.1, so will be a change that you made at your project



Tip unrelated to the error: After this error was solved, I suggest you changing your event to

fItfm6R.png


Code:
Code:
Expand Collapse Copy
param = PunchBag::Parameters.new(5)
param.stats = [:HP,:SPEED,:ATTACK,
 :SPECIAL_ATTACK,:DEFENSE,
 :SPECIAL_DEFENSE][pbGet(1)]
param.minScore = 10
param.setEvGain(5)
param.acceptFainted = true
param.blockMax = true
PunchBag.play(param)

pbGet(1) returns the value of variable 1 (Temp Pokemon Choice).

This way you do the same thing without repeating the code.
 

BiggusWeeabus

"What's so funny about Biggus Dickus?"
Member
Joined
Sep 1, 2020
Posts
105
You posted the script call code, the error and when the error occurs, very good!

I tested now on v19.1 and it's working. Also, ZeT0ken tested before on this Essentials. Your error sounds like @score or @lastScore are nil, but both are zeroed when scene starts.

I suggest you copy/pasting the script again (only script, not the graphics), maybe some line was accidentally deleted. If the error persists, try again on a fresh v19.1. If it works on v19.1, so will be a change that you made at your project



Tip unrelated to the error: After this error was solved, I suggest you changing your event to

fItfm6R.png


Code:
Code:
Expand Collapse Copy
param = PunchBag::Parameters.new(5)
param.stats = [:HP,:SPEED,:ATTACK,
 :SPECIAL_ATTACK,:DEFENSE,
 :SPECIAL_DEFENSE][pbGet(1)]
param.minScore = 10
param.setEvGain(5)
param.acceptFainted = true
param.blockMax = true
PunchBag.play(param)

pbGet(1) returns the value of variable 1 (Temp Pokemon Choice).

This way you do the same thing without repeating the code.
Thanks for the tip, wasn't aware you could get the chosen stat from an Array.
Also, not sure why. But i did reinstall the script before posting the question and it didn't work, but now i did it again and it worked lol.

Thanks for the help anyway!
 

xDracolich

Novice
Member
Joined
Jun 2, 2019
Posts
28
I'm extremely confused as to how to actually download things from GitHub
 

Willøw

Mew and Slither Wing Fan
Member
Joined
Nov 1, 2023
Posts
98
I'm extremely confused as to how to actually download things from GitHub
When you click on the link, you'll see a button called "Code", click on it and you'll see an option "download Zip" or something like that, voila, you've downloaded the file
Hence just do the same scheme as always to extract the file in the folder where Game File is
 

xDracolich

Novice
Member
Joined
Jun 2, 2019
Posts
28
When you click on the link, you'll see a button called "Code", click on it and you'll see an option "download Zip" or something like that, voila, you've downloaded the file
Hence just do the same scheme as always to extract the file in the folder where Game File is
Ahhh, yeah that did it, thank you!

The plugin works perfectly
 
Last edited:

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
307
When you click on the link, you'll see a button called "Code", click on it and you'll see an option "download Zip" or something like that, voila, you've downloaded the file
Hence just do the same scheme as always to extract the file in the folder where Game File is
Yeah, Alternatively, you can also enter in the file and copy/past it's contents.
 
Back
Top