Pokémon SDK Wiki
Credits

Give a badge

This page comes from the old Wiki. It's probably not up to date.

Give a badge to the player

Command

To give a badge to the player you can use the following command :

$trainer.set_badge(badge_num, region_num, obtenu_ou_non)

Where :

Examples

Give the 5th badge :

$trainer.set_badge(5)

Withdraw the 5th badge :

$trainer.set_badge(5, 1, false)

Give the 5th badge of the 3rd region :

$trainer.set_badge(5, 3)

Getting how many badges the player has got so far

To get exactly how many badges the player possesses, use the following command :

$trainer.badge_counter

Check if the player has a specific badge

Command

To detect if the player has got a specific badge, you can use the command :

$trainer.badge_obtained?(badge_num, region_num)

Examples

Check if the player has got the 5th badge:

$trainer.badge_obtained?(5)

Detect if the player has got the 5th badge of the 3rd region :

$trainer.badge_obtained?(5, 3)