- Pokémon Essentials Version
- v21.1 ✅
# Challenge Modes - Complete Function Guide
## Overview
Challenge Modes is a comprehensive challenge system for Pokemon Essentials v21.1 that transforms your game into an engaging, rule-based experience. This plugin includes classic Nuzlocke rules, new challenge modes like Monotype and Randomizer, and advanced integrations with Level Caps and AI systems.
Key Features:
---
## Installation
### First Time Installation
1. Extract the "Challenge Modes" folder to your
2. Compile your game (Debug > Compile)
3. Test with a new save file
### Updating from Nuzlocke EX
1. Delete the old "Nuzlocke EX" folder from
2. Extract the new "Challenge Modes" folder to
3. Compile your game
4. Existing save files remain compatible
### Additional Plugins (Optional)
For full functionality, consider installing:
---
## Core Features
### Automatic Activation
Challenge modes activate automatically when:
1. The player selects rules via
2. The player has at least one Pokeball in their bag
3. Challenge begins with
### Save Integration
All challenge progress is automatically saved:
The plugin tracks all challenge attempts:
## Challenge Rules
### Available Rules
#### 1. Permafaint (PERMAFAINT)
Description: Once a Pokemon faints, it cannot be revived until the challenge ends.
Effects:
---
#### 2. One Capture per Map (ONE_CAPTURE)
Description: Only the first Pokemon encountered on each map can be caught.
Effects:
Configuration:
---
#### 3. Shiny Clause (SHINY_CLAUSE)
Description: Shiny Pokemon are exempt from the "One Capture per Map" rule.
Effects:
#### 4. Dupes Clause (DUPS_CLAUSE)
Description: Pokemon from evolution lines you already own don't count as encounters.
Effects:
---
#### 5. Gift Clause (GIFT_CLAUSE)
Description: Gifted Pokemon or eggs don't count as encounters.
Effects:
#### 6. Monotype Challenge (MONOTYPE_MODE)
Description: You can only use Pokemon of a single type.
Type Selection:
At challenge start, you'll choose from:
---
#### 7. Randomizer Mode (RANDOMIZER_MODE)
Description: Wild Pokemon, trainer Pokemon, and gifts are randomized.
Settings:
How it Works:
---
#### 8. Forced Nicknames (FORCE_NICKNAME)
Description: Any Pokemon caught or obtained must be nicknamed.
Effects:
#### 9. Forced Set Battle Style (FORCE_SET_BATTLES)
Description: No switch prompt after fainting opponent's Pokemon.
Effects:
#### 10. No Items in Trainer Battles (NO_TRAINER_BATTLE_ITEMS)
Description: Item usage disabled in trainer battles.
Effects:
#### 11. No White-out (GAME_OVER_WHITEOUT)
Description: If all party Pokemon faint, you lose the challenge immediately.
Effects:
---
#### 12. Level Cap (LEVEL_CAP)
Description: Pokemon cannot exceed certain level caps.
Requires: Level Caps EX plugin
Three Modes:
1. Hard Cap (Mode 1) - Cannot gain EXP past cap
2. EXP Cap (Mode 2) - Reduced EXP (1/10th) past cap
3. Obedience Cap (Mode 3) - Pokemon disobey past cap
Mode Selection:
Player chooses mode when challenge starts (if LEVEL_CAP rule is active)
Variables:
Usage:
Example Progression:
---
#### 13. Hardcore Mode (HARDCORE_MODE)
Description: All Pokemon have perfect IVs (31) and EVs are completely disabled.
Effects:
#### 14. Trainer Scaling (TRAINER_SCALING)
Description: All trainers receive significant difficulty boosts including level increases, better items, improved stats, and additional Pokemon.
Effects:
Example:
Note: This rule must be selected during challenge setup. It does NOT activate automatically with other challenge modes.
---
#### 15. No Pokémon Centers (NO_POKEMON_CENTER)
Description: All Pokémon Center healing is completely blocked.
Effects:
Workarounds:
#### 16. No Legendaries (NO_LEGENDARIES)
Description: Legendary and Mythical Pokémon cannot be caught or used in battle.
Effects:
Affected Pokémon (Examples):
---
#### 17. Limited Healing (LIMITED_HEALING)
Description: Pokémon Center visits are limited to 3 per town/area.
Effects:
Counter Tracking:
Script Command:
Example Messages:
Note: Each town/city has its own counter. Moving to a new area resets the available heals.
---
#### 18. Species Clause (SPECIES_CLAUSE)
Description: Only one Pokémon of each species is allowed in your party at a time.
Effects:
Script Command:
Example:
Form Handling:
#### 19. Item Restrictions (ITEM_RESTRICTIONS)
Description: X-Items are banned, and Revives/Full Restores are limited per battle.
Banned Items:
Item Usage Tracking:
Script Command:
Example Messages:
Note: Item counter resets at the start of each battle. Healing items like Potions are NOT affected.
---
## Script Commands
### Basic Commands
#### Start Challenge Selection
Opens the rule selection interface for the player.
#### Begin Challenge
Activates the challenge with selected rules. Usually called automatically after first Pokeball.
#### Check if Challenge Active
#### Get Active Rules
#### Reset Challenge
Clears all challenge data and stops the challenge. Resets Level Cap variables if active.
---
### Victory/Defeat Tracking
#### Record Victory
Records a challenge victory in the Hall of Fame.
Parameters:
-
Example:
#### Record Defeat
Records a challenge defeat.
Example:
#### Check Victory/Defeat
---
### Forced Rules Mode
#### Enable Forced Rules
When enabled, skips rule selection and uses pre-defined rules.
#### Set Forced Rules
Example:
---
### Level Cap Commands
#### Update Level Cap
Increases the level cap and shows a message.
Example:
#### Direct Variable Access
---
### Randomizer Commands
#### Early Randomizer Activation
Call BEFORE starter selection to randomize starters.
Example:
---
## Configuration
### File: 000_Config.rb
#### One Capture Whitelist
Pokemon in this list ignore the One Capture rule.
#### Split Maps
Maps in the same array share encounter slots.
#### Monotype Types
Available types for Monotype mode.
#### Randomizer Settings
---
### File: 013_Trainer_Scaling.rb
#### Trainer Scaling Configuration
Trainer Scaling activates automatically when ANY challenge mode is running.
---
## Integration Features
### Trainer Scaling System
IMPORTANT: Trainer Scaling is now a SELECTABLE RULE. It must be enabled during challenge setup to take effect.
When the TRAINER_SCALING rule is active, all trainer battles are automatically scaled:
Level Boost:
- All trainer Pokemon receive +2 levels (configurable)
Extra Pokemon:
- 40% chance trainers get an extra Pokemon (if < 6)
Evolution Upgrade:
- 30% chance Pokemon evolve to next form
Better Items:
Select "Trainer Scaling" during challenge mode setup, or use:
Example:
---
### Advanced AI Integration
If the Advanced AI System plugin is installed:
Automatic Activation:
---
### Level Caps EX Integration
Full integration with Level Caps EX plugin:
Automatic Setup:
---
## Event Integration
### Starting a Challenge
#### Method 1: Simple Start
#### Method 2: Forced Rules
---
### Level Cap Progression
---
### White-out Handling
---
### Hall of Fame
---
### Conditional Dialogue
---
### Starter Selection
---
## Advanced Usage
### Custom Rule Combinations
---
### Dynamic Rule Display
---
### Save/Load Compatibility
Challenge data is stored in
---
### Permafaint Pokemon Management
---
### Encounter Tracking
---
### Monotype Type Checking
---
## Troubleshooting
### Common Issues
#### Rules Not Applying
Problem: Challenge rules don't seem to be working
Solutions:
1. Verify challenge started:
2. Check rules array:
3. Ensure
4. Verify player has Pokeballs
---
#### Level Cap Not Working
Problem: Pokemon still gain EXP past cap
Solutions:
1. Check Level Caps EX plugin is installed
2. Verify variables set:
3. Check bypass switch:
4. Ensure mode is 1, 2, or 3
---
#### Trainer Scaling Not Active
Problem: Trainers aren't scaled
Solutions:
1. Verify any challenge mode is active
2. Check console for scaling messages
3. Review
---
#### Randomizer Inconsistent
Problem: Same Pokemon randomizes differently
Solutions:
1. Seed may have changed - check
2. Clear randomizer map to reset:
3. Ensure consistent game state
---
### Debug Commands
#### View Challenge State
#### Force Rules (Testing)
#### Reset Everything
---
## FAQ
### Q: Can I add custom rules?
A: Yes! Add new rules to
### Q: Are save files compatible between versions?
A: Yes, save files from Nuzlocke EX are compatible. New features activate automatically.
### Q: Can I change rules mid-challenge?
A: Not recommended. Rules are locked at challenge start. Changing them may cause issues.
### Q: Does this work with other plugins?
A: Generally yes. Tested with Level Caps EX, Advanced AI, and Voltseon's Pause Menu.
### Q: Can I disable trainer scaling?
A: Yes, set all values in
### Q: What happens if Level Caps EX isn't installed?
A: Level Cap rule will be available but won't function. Other rules work normally.
### Q: Can I use this for a story-enforced challenge?
A: Yes! Use
### Q: How do I translate this plugin?
A: All text uses
## Overview
Challenge Modes is a comprehensive challenge system for Pokemon Essentials v21.1 that transforms your game into an engaging, rule-based experience. This plugin includes classic Nuzlocke rules, new challenge modes like Monotype and Randomizer, and advanced integrations with Level Caps and AI systems.
Key Features:
- 19 selectable challenge rules that can be combined
- Monotype and Randomizer modes
- Hardcore mode with perfect IVs and no EVs
- Trainer scaling for increased difficulty
- Level cap integration with 3 difficulty modes
- Item restrictions and species limitations
- Advanced AI system integration
---
## Installation
### First Time Installation
1. Extract the "Challenge Modes" folder to your
Plugins/ directory2. Compile your game (Debug > Compile)
3. Test with a new save file
### Updating from Nuzlocke EX
1. Delete the old "Nuzlocke EX" folder from
Plugins/2. Extract the new "Challenge Modes" folder to
Plugins/3. Compile your game
4. Existing save files remain compatible
### Additional Plugins (Optional)
For full functionality, consider installing:
- Level Caps EX - For level cap challenges
- Advanced AI System - For enhanced trainer AI
- Voltseon's Pause Menu - For level cap HUD display
---
## Core Features
### Automatic Activation
Challenge modes activate automatically when:
1. The player selects rules via
ChallengeModes.start2. The player has at least one Pokeball in their bag
3. Challenge begins with
ChallengeModes.begin_challenge### Save Integration
All challenge progress is automatically saved:
- Active rules
- Encounter tracking
- Victory/defeat records
- Challenge-specific data (Monotype type, Randomizer seed, etc.)
The plugin tracks all challenge attempts:
- Records victories and defeats
- Stores which rules were active
- Accessible via script commands
## Challenge Rules
### Available Rules
#### 1. Permafaint (PERMAFAINT)
Description: Once a Pokemon faints, it cannot be revived until the challenge ends.
Effects:
- Fainted Pokemon are marked with
perma_faintflag - Cannot be used in battle or healed
- Party menu shows them as permanently fainted
Ruby:
if ChallengeModes.on?(:PERMAFAINT)
pbMessage("Your Pokemon has permanently fainted!")
end
#### 2. One Capture per Map (ONE_CAPTURE)
Description: Only the first Pokemon encountered on each map can be caught.
Effects:
- Tracks first encounter per map area
- Blocks catching additional Pokemon on the same map
- Split maps (connected areas) share encounter slots
ONE_CAPTURE_WHITELISTConfiguration:
Ruby:
# In 000_Config.rb
ONE_CAPTURE_WHITELIST = [
:DIALGA, :PALKIA, :GIRATINA, :ARCEUS
]
SPLIT_MAPS_FOR_ENCOUNTERS = [
[44, 45], # These maps share an encounter slot
[49, 50, 51] # These maps share an encounter slot
]
#### 3. Shiny Clause (SHINY_CLAUSE)
Description: Shiny Pokemon are exempt from the "One Capture per Map" rule.
Effects:
- Shiny encounters don't count as "first encounter"
- Can catch shinies even if you already caught on that map
- Only works when ONE_CAPTURE is also active
#### 4. Dupes Clause (DUPS_CLAUSE)
Description: Pokemon from evolution lines you already own don't count as encounters.
Effects:
- Checks entire evolution family
- Prevents catching duplicate lines
- Only works when ONE_CAPTURE is also active
---
#### 5. Gift Clause (GIFT_CLAUSE)
Description: Gifted Pokemon or eggs don't count as encounters.
Effects:
- Gift Pokemon don't consume encounter slots
- Eggs don't count as encounters
- Only works when ONE_CAPTURE is also active
#### 6. Monotype Challenge (MONOTYPE_MODE)
Description: You can only use Pokemon of a single type.
Type Selection:
At challenge start, you'll choose from:
- Normal, Fire, Water, Electric, Grass, Ice
- Fighting, Poison, Ground, Flying, Psychic
- Bug, Rock, Ghost, Dragon, Dark, Steel, Fairy
- Cannot catch Pokemon without your chosen type
- Cannot use Pokemon in battle without your chosen type
- Blocks receiving gift Pokemon that don't match
- Dual-type Pokemon must have your type as primary OR secondary
Ruby:
# Access chosen type
$PokemonGlobal.challenge_monotype_type
# Returns :FIRE, :WATER, etc.
#### 7. Randomizer Mode (RANDOMIZER_MODE)
Description: Wild Pokemon, trainer Pokemon, and gifts are randomized.
Settings:
Ruby:
RANDOMIZER_SETTINGS = {
:wild_pokemon => true, # Randomize wild encounters
:trainer_pokemon => true, # Randomize trainer Pokemon
:starter_pokemon => true, # Randomize starters
:gift_pokemon => true, # Randomize gifts
:legendary_separate => true,# Keep legendaries separate
:similar_strength => true # Match BST within ±100
}
- Seed-based randomization for consistency
- Same species always randomizes to same replacement
- Similar strength matching for balance
- Legendary Pokemon stay as legendaries (if enabled)
Ruby:
# For starter randomization, call before starter selection
ChallengeModes.begin_randomizer_early
#### 8. Forced Nicknames (FORCE_NICKNAME)
Description: Any Pokemon caught or obtained must be nicknamed.
Effects:
- Sets
$PokemonSystem.givenicknames = 0(always ask) - Cannot skip nickname prompt
#### 9. Forced Set Battle Style (FORCE_SET_BATTLES)
Description: No switch prompt after fainting opponent's Pokemon.
Effects:
- Sets
$PokemonSystem.battlestyle = 1(Set mode) - Increases difficulty significantly
#### 10. No Items in Trainer Battles (NO_TRAINER_BATTLE_ITEMS)
Description: Item usage disabled in trainer battles.
Effects:
- Cannot use items from bag during trainer battles
- Held items still work normally
#### 11. No White-out (GAME_OVER_WHITEOUT)
Description: If all party Pokemon faint, you lose the challenge immediately.
Effects:
- Instant challenge failure on party wipe
- Should call
ChallengeModes.set_loss(true)
Ruby:
# In your white-out event
if ChallengeModes.on?(:GAME_OVER_WHITEOUT)
ChallengeModes.set_loss(true)
pbMessage("Your challenge has ended...")
# Game over sequence
else
# Normal white-out handling
end
#### 12. Level Cap (LEVEL_CAP)
Description: Pokemon cannot exceed certain level caps.
Requires: Level Caps EX plugin
Three Modes:
1. Hard Cap (Mode 1) - Cannot gain EXP past cap
2. EXP Cap (Mode 2) - Reduced EXP (1/10th) past cap
3. Obedience Cap (Mode 3) - Pokemon disobey past cap
Mode Selection:
Player chooses mode when challenge starts (if LEVEL_CAP rule is active)
Variables:
Ruby:
# Variable 198 = Current level cap
# Variable 199 = Level cap mode (1-3)
# Switch 200 = Bypass for enemy trainers
Ruby:
# Set level cap
$game_variables[198] = 20
# Update level cap with message
ChallengeModes.update_level_cap(25)
# Check current cap
LevelCapsEX.level_cap # Returns current cap value
Ruby:
# After 1st Gym
ChallengeModes.update_level_cap(15)
# After 2nd Gym
ChallengeModes.update_level_cap(20)
# After 3rd Gym
ChallengeModes.update_level_cap(25)
#### 13. Hardcore Mode (HARDCORE_MODE)
Description: All Pokemon have perfect IVs (31) and EVs are completely disabled.
Effects:
- All Pokemon: 31 IVs in all stats
- EVs locked at 0 (cannot be gained)
- Applies to wild, gift, and trainer Pokemon
- Creates balanced competitive environment
- Vitamins: HP Up, Protein, Iron, Calcium, Zinc, Carbos
- Wings: Health Wing, Muscle Wing, Resist Wing, etc.
- Feathers: Health Feather, Muscle Feather, etc.
- Power Items: Power Weight, Power Bracer, Power Belt, etc.
- Macho Brace
- EV-reducing Berries: Pomeg, Kelpsy, Qualot, etc.
- Automatic application to all new Pokemon
- Trainer Pokemon also get 31 IVs, 0 EVs
- Fair competitive battles
#### 14. Trainer Scaling (TRAINER_SCALING)
Description: All trainers receive significant difficulty boosts including level increases, better items, improved stats, and additional Pokemon.
Effects:
- +2 Level Boost - All trainer Pokemon are 2 levels higher (configurable)
- 40% Extra Pokemon - Trainers have a chance to add an extra Pokemon (if < 6)
- 30% Evolution Chance - Pokemon may evolve to their next form
- Better Items - Trainer items upgraded (Potion → Super Potion → Hyper Potion → Full Restore)
- Improved IVs - All trainer Pokemon get 25 IVs instead of random
- Held Items - Pokemon receive type-appropriate held items (Charcoal, Mystic Water, etc.)
Ruby:
# In 013_Trainer_Scaling.rb
TRAINER_SCALING = {
:level_boost => 2, # Levels to add
:extra_pokemon_chance => 40, # % chance for extra Pokemon
:evolution_upgrade_chance => 30,# % chance to evolve
:better_items => true,
:improved_ivs => true,
:held_items => true
}
Code:
Normal Mode:
Lass Marie
Poliwag Lv.4
With TRAINER_SCALING:
Lass Marie
Poliwag Lv.6 @ Mystic Water
IVs: 25/25/25/25/25/25
40% chance: Goldeen Lv.5 @ Mystic Water
---
#### 15. No Pokémon Centers (NO_POKEMON_CENTER)
Description: All Pokémon Center healing is completely blocked.
Effects:
- Cannot heal at Pokémon Centers
- Blocks
pbPokeCenterPCfunction - Shows rejection message when attempted
- Forces alternative healing methods (Potions, Berries, etc.)
Ruby:
# Check if rule is active
if ChallengeModes.no_pokemon_center?
pbMessage("Find another way to heal!")
end
- Use healing items (Potions, Full Heals, etc.)
- Use healing moves (Softboiled, Heal Pulse, etc.)
- Rest at home (if implemented in your game)
#### 16. No Legendaries (NO_LEGENDARIES)
Description: Legendary and Mythical Pokémon cannot be caught or used in battle.
Effects:
- Cannot catch Legendary/Mythical Pokémon
- Blocks Poké Ball usage on legendaries
- Removes legendaries from party if somehow obtained
- Checks
LegendaryandMythicalflags
Ruby:
# Check if Pokémon is legendary
ChallengeModes.is_legendary?(pokemon)
# Returns true for Legendary or Mythical flagged Pokémon
- Articuno, Zapdos, Moltres
- Mewtwo, Mew
- Lugia, Ho-Oh
- Groudon, Kyogre, Rayquaza
- Dialga, Palkia, Giratina, Arceus
- All other Legendary/Mythical Pokémon
---
#### 17. Limited Healing (LIMITED_HEALING)
Description: Pokémon Center visits are limited to 3 per town/area.
Effects:
- Tracks healing counter per map ID
- Maximum 3 heals per area (configurable)
- Shows remaining heals after each visit
- Counter persists until challenge reset
Ruby:
# In 000_Config.rb
LIMITED_HEALING_COUNT = 3 # Max heals per area
Ruby:
# Get healing count for current map
ChallengeModes.get_healing_count
# Returns: 0, 1, 2, or 3
# Get remaining heals
ChallengeModes.remaining_heals
# Returns: 3, 2, 1, or 0
# Check if healing allowed
ChallengeModes.can_heal_on_map?
# Returns: true or false
Ruby:
# Check healing status for current map
pbCheckHealingStatus
# Shows: "Healing visits in Pewter City: 2 used, 1 remaining"
Code:
"You have 2 healing visits left in Pewter City."
"This was your last healing visit in Pewter City!"
"You've already used your 3 healing visits in Pewter City."
---
#### 18. Species Clause (SPECIES_CLAUSE)
Description: Only one Pokémon of each species is allowed in your party at a time.
Effects:
- Blocks catching duplicate species
- Sends duplicates to PC automatically
- Checks base species (ignores forms)
- Works during catches and gift Pokémon
Ruby:
# Check if species already in party
ChallengeModes.species_in_party?(:PIKACHU)
# Returns: true or false
# Get current party species
ChallengeModes.get_party_species
# Returns: [:PIKACHU, :CHARMANDER, :BULBASAUR]
Ruby:
# View current party species
pbCheckPartySpecies
# Shows: "Party Species: 1. Pikachu, 2. Charmander, 3. Bulbasaur"
Code:
You already have a Pikachu in your party!
Species Clause: Only one of each species allowed!
Pikachu was sent to the PC.
- Alolan Raichu and regular Raichu = SAME species (blocked)
- Mega evolutions count as same species
- Regional forms count as same species
#### 19. Item Restrictions (ITEM_RESTRICTIONS)
Description: X-Items are banned, and Revives/Full Restores are limited per battle.
Banned Items:
- X Attack, X Defense, X Special, X Speed, X Accuracy
- X Sp. Atk, X Sp. Def
- Dire Hit, Guard Spec.
- Revive (3 uses)
- Max Revive (3 uses)
- Full Restore (3 uses)
Ruby:
# In 000_Config.rb
ITEM_RESTRICTIONS_CONFIG = {
:banned_items => [
:XATTACK, :XDEFEND, :XSPATK, :XSPDEF,
:XSPEED, :XACCURACY, :DIREHIT, :GUARDSPEC
],
:limited_items => [
:REVIVE, :MAXREVIVE, :FULLRESTORE
],
:item_limits => {
:REVIVE => 3,
:MAXREVIVE => 3,
:FULLRESTORE => 3
}
}
Ruby:
# Check if item can be used
ChallengeModes.can_use_item?(:REVIVE)
# Returns: true or false
# Get remaining uses
ChallengeModes.remaining_uses(:REVIVE)
# Returns: 3, 2, 1, or 0
# Get current usage
ChallengeModes.get_item_usage(:REVIVE)
# Returns: 0, 1, 2, or 3
Ruby:
# Check item usage for current battle
pbCheckItemUsage
# Shows: "Revive: 2/3, Full Restore: 1/3"
Code:
"X Attack is banned in Challenge Mode!"
"You've already used Revive this battle! Limit: 3 per battle"
"(2 Revive remaining this battle)"
"(That was your last Full Restore for this battle)"
---
## Script Commands
### Basic Commands
#### Start Challenge Selection
Ruby:
ChallengeModes.start
#### Begin Challenge
Ruby:
ChallengeModes.begin_challenge
#### Check if Challenge Active
Ruby:
ChallengeModes.on?
# Returns true if any challenge is active
ChallengeModes.on?(:PERMAFAINT)
# Returns true if specific rule is active
ChallengeModes.running?
# Returns true if challenge has been started
Ruby:
ChallengeModes.rules
# Returns array of active rule symbols
# Example: [:PERMAFAINT, :ONE_CAPTURE, :LEVEL_CAP]
Ruby:
ChallengeModes.reset
---
### Victory/Defeat Tracking
#### Record Victory
Ruby:
ChallengeModes.set_victory(should_reset = false)
Parameters:
-
should_reset: If true, also resets challenge after recordingExample:
Ruby:
# After defeating Elite Four
if ChallengeModes.on?
ChallengeModes.set_victory(false) # Record but don't reset
pbMessage("You've completed the challenge!")
# Show victory sequence
ChallengeModes.reset # Reset when ready
end
Ruby:
ChallengeModes.set_loss(should_reset = true)
Example:
Ruby:
# On white-out with GAME_OVER_WHITEOUT
if ChallengeModes.on?(:GAME_OVER_WHITEOUT)
ChallengeModes.set_loss(true)
pbMessage("Your challenge has ended...")
end
Ruby:
ChallengeModes.won?
# Returns true if player won any challenge
ChallengeModes.won?(hall_no)
# Check specific Hall of Fame entry
ChallengeModes.lost?
# Returns true if player lost any challenge
ChallengeModes.lost?(hall_no)
# Check specific loss record
### Forced Rules Mode
#### Enable Forced Rules
Ruby:
ChallengeModes.use_forced_rules(true)
#### Set Forced Rules
Ruby:
ChallengeModes.set_forced_rules(rules_array)
Ruby:
# Force specific rules for story mode
ChallengeModes.use_forced_rules(true)
ChallengeModes.set_forced_rules([
:PERMAFAINT,
:ONE_CAPTURE,
:FORCE_SET_BATTLES,
:LEVEL_CAP
])
ChallengeModes.start
# Don't forget to disable after
ChallengeModes.use_forced_rules(false)
### Level Cap Commands
#### Update Level Cap
Ruby:
ChallengeModes.update_level_cap(new_cap)
Example:
Ruby:
# After gym leader defeat
ChallengeModes.update_level_cap(20)
# Shows: "The level cap has been raised to 20!"
Ruby:
# Set cap directly
$game_variables[198] = 25
# Set mode directly
$game_variables[199] = 1 # 1=Hard, 2=EXP, 3=Obedience
# Toggle trainer bypass
$game_switches[200] = true # Trainers ignore cap
### Randomizer Commands
#### Early Randomizer Activation
Ruby:
ChallengeModes.begin_randomizer_early
Example:
Ruby:
# In starter selection event
if ChallengeModes.on?(:RANDOMIZER_MODE)
ChallengeModes.begin_randomizer_early
end
# Then continue with normal starter selection
## Configuration
### File: 000_Config.rb
#### One Capture Whitelist
Ruby:
ONE_CAPTURE_WHITELIST = [
:DIALGA, :PALKIA, :GIRATINA, :ARCEUS
]
#### Split Maps
Ruby:
SPLIT_MAPS_FOR_ENCOUNTERS = [
[44, 45],
[49, 50, 51]
]
#### Monotype Types
Ruby:
MONOTYPE_TYPES = [
:NORMAL, :FIRE, :WATER, :ELECTRIC, :GRASS, :ICE,
:FIGHTING, :POISON, :GROUND, :FLYING, :PSYCHIC,
:BUG, :ROCK, :GHOST, :DRAGON, :DARK, :STEEL, :FAIRY
]
#### Randomizer Settings
Ruby:
RANDOMIZER_SETTINGS = {
:wild_pokemon => true,
:trainer_pokemon => true,
:starter_pokemon => true,
:gift_pokemon => true,
:legendary_separate => true,
:similar_strength => true
}
### File: 013_Trainer_Scaling.rb
#### Trainer Scaling Configuration
Ruby:
TRAINER_SCALING = {
:level_boost => 2, # Add 2 levels to all trainer Pokemon
:extra_pokemon_chance => 40, # 40% chance for extra Pokemon
:evolution_upgrade_chance => 30,# 30% chance to evolve Pokemon
:better_items => true, # Upgrade trainer items
:improved_ivs => true, # Set IVs to 25
:held_items => true # Add type-based held items
}
---
## Integration Features
### Trainer Scaling System
IMPORTANT: Trainer Scaling is now a SELECTABLE RULE. It must be enabled during challenge setup to take effect.
When the TRAINER_SCALING rule is active, all trainer battles are automatically scaled:
Level Boost:
- All trainer Pokemon receive +2 levels (configurable)
Extra Pokemon:
- 40% chance trainers get an extra Pokemon (if < 6)
Evolution Upgrade:
- 30% chance Pokemon evolve to next form
Better Items:
- Potion → Super Potion
- Super Potion → Hyper Potion
- Hyper Potion → Full Restore
- Revive → Max Revive
- IVs increased to 25
- Type-appropriate held items added
Select "Trainer Scaling" during challenge mode setup, or use:
Ruby:
# Include :TRAINER_SCALING in your rules
ChallengeModes.use_forced_rules(true)
ChallengeModes.set_forced_rules([
:PERMAFAINT,
:ONE_CAPTURE,
:TRAINER_SCALING # Enable trainer scaling
])
ChallengeModes.start
Code:
Without TRAINER_SCALING:
Lass Marie
Poliwag Lv.4
With TRAINER_SCALING:
Lass Marie
Poliwag Lv.6 @ Mystic Water
IVs: 25/25/25/25/25/25
40% chance: Goldeen Lv.5 @ Mystic Water
### Advanced AI Integration
If the Advanced AI System plugin is installed:
Automatic Activation:
- AI enhances when challenge modes are ON
- Or when trainer skill level ≥ 48
- Intelligent move selection
- Strategic switching
- Type advantage calculations
- Status move evaluation
- Weather awareness
- Hazard management
Ruby:
# In Advanced AI System/[001] Settings.rb
ACTIVATE_WITH_CHALLENGE_MODES = true
MIN_SKILL_FOR_AUTO_ACTIVATION = 48
### Level Caps EX Integration
Full integration with Level Caps EX plugin:
Automatic Setup:
- Level cap variables configured on challenge start
- Player chooses cap mode (Hard/EXP/Obedience)
- Automatic reset on challenge end
- 198: Current level cap
- 199: Level cap mode (1-3)
- Switch 200: Trainer bypass
Ruby:
# Update cap with message
ChallengeModes.update_level_cap(25)
# Check current cap
LevelCapsEX.level_cap
# Check if hard cap active
LevelCapsEX.hard_cap?
## Event Integration
### Starting a Challenge
#### Method 1: Simple Start
Ruby:
# In an event at game start
ChallengeModes.start
Ruby:
# Force specific rules
ChallengeModes.use_forced_rules(true)
ChallengeModes.set_forced_rules([
:PERMAFAINT,
:ONE_CAPTURE,
:LEVEL_CAP
])
ChallengeModes.start
ChallengeModes.use_forced_rules(false)
### Level Cap Progression
Ruby:
# Conditional Branch: Script
# After Gym Leader 1 defeat
if ChallengeModes.on?(:LEVEL_CAP)
ChallengeModes.update_level_cap(15)
end
# After Gym Leader 2
if ChallengeModes.on?(:LEVEL_CAP)
ChallengeModes.update_level_cap(20)
end
# After Gym Leader 3
if ChallengeModes.on?(:LEVEL_CAP)
ChallengeModes.update_level_cap(25)
end
# And so on...
### White-out Handling
Ruby:
# In white-out event
# Conditional Branch: Script
if ChallengeModes.on?(:GAME_OVER_WHITEOUT)
# Challenge mode game over
ChallengeModes.set_loss(true)
pbMessage("Your challenge has ended in defeat...")
# Show game over screen
# Return to title screen or load last save
else
# Normal white-out
# Heal party, return to Pokemon Center, etc.
end
### Hall of Fame
Ruby:
# After defeating Champion
# Conditional Branch: Script
if ChallengeModes.on?
ChallengeModes.set_victory(false)
num_rules = ChallengeModes.rules.length
pbMessage("Incredible! You completed a #{num_rules}-rule challenge!")
pbMessage("Your victory will be recorded in history!")
# Show credits/victory sequence
ChallengeModes.reset
else
# Normal Hall of Fame
pbMessage("Welcome to the Hall of Fame!")
end
### Conditional Dialogue
Ruby:
# Different dialogue for challenge players
# Conditional Branch: Script
if ChallengeModes.on?
pbMessage("Taking on a challenge? You're brave!")
if ChallengeModes.on?(:PERMAFAINT)
pbMessage("Be careful - you can't revive fainted Pokemon!")
end
else
pbMessage("Welcome, trainer!")
end
### Starter Selection
Ruby:
# For Randomizer mode
# BEFORE showing starters
if ChallengeModes.on?(:RANDOMIZER_MODE)
ChallengeModes.begin_randomizer_early
end
# Then continue with normal starter selection
# The starters will be randomized automatically
## Advanced Usage
### Custom Rule Combinations
Ruby:
# Check multiple rules
if ChallengeModes.on?(:PERMAFAINT) && ChallengeModes.on?(:LEVEL_CAP)
pbMessage("Hardcore mode: Permafaint + Level Cap!")
end
# Check rule count
rule_count = ChallengeModes.rules.length
if rule_count >= 5
pbMessage("You're playing with #{rule_count} rules! Impressive!")
end
### Dynamic Rule Display
Ruby:
# Show active rules to player
if ChallengeModes.on?
rules = ChallengeModes.rules
rule_names = rules.map { |r| ChallengeModes::RULES[r][:name] }
message = "Active Rules:\n" + rule_names.join("\n")
pbMessage(message)
end
### Save/Load Compatibility
Challenge data is stored in
$PokemonGlobal:challenge_started: Booleanchallenge_rules: Array of symbolschallenge_encs: Hash of encounter datachallenge_monotype_type: Symbol (e.g., :FIRE)challenge_randomizer_seed: Integerchallenge_randomizer_map: Hashchallenge_state: Hash of victory/defeat records
---
### Permafaint Pokemon Management
Ruby:
# Check if Pokemon is perma-fainted
if pkmn.perma_faint
pbMessage("#{pkmn.name} has permanently fainted!")
end
# Manually set (not recommended)
pkmn.perma_faint = true
# Clear permafaint (on challenge reset)
pbEachPokemon do |pkmn, _|
pkmn.perma_faint = false if pkmn.respond_to?(:perma_faint)
end
### Encounter Tracking
Ruby:
# Check if encounter used on current map
map_id = $game_map.map_id
if $PokemonGlobal.challenge_encs[map_id]
pbMessage("You already caught a Pokemon here!")
end
# Manually set encounter (not recommended)
$PokemonGlobal.challenge_encs[map_id] = true
### Monotype Type Checking
Ruby:
# Get chosen type
monotype = $PokemonGlobal.challenge_monotype_type
# Check if Pokemon valid
pkmn = $player.party[0]
if ChallengeModes.on?(:MONOTYPE_MODE)
if pkmn.hasType?(monotype)
pbMessage("#{pkmn.name} is valid for Monotype!")
else
pbMessage("#{pkmn.name} doesn't match your type!")
end
end
## Troubleshooting
### Common Issues
#### Rules Not Applying
Problem: Challenge rules don't seem to be working
Solutions:
1. Verify challenge started:
p ChallengeModes.running?2. Check rules array:
p ChallengeModes.rules3. Ensure
begin_challenge was called4. Verify player has Pokeballs
Ruby:
# Debug check
if ChallengeModes.running?
pbMessage("Challenge is running")
pbMessage("Rules: #{ChallengeModes.rules.inspect}")
else
pbMessage("Challenge not started")
end
#### Level Cap Not Working
Problem: Pokemon still gain EXP past cap
Solutions:
1. Check Level Caps EX plugin is installed
2. Verify variables set:
p [imath]game_variables[198] (cap) and p[/imath]game_variables[199] (mode)3. Check bypass switch:
p $game_switches[200]4. Ensure mode is 1, 2, or 3
Ruby:
# Debug level cap
pbMessage("Cap: #{$game_variables[198]}")
pbMessage("Mode: #{$game_variables[199]}")
pbMessage("Bypass: #{$game_switches[200]}")
#### Trainer Scaling Not Active
Problem: Trainers aren't scaled
Solutions:
1. Verify any challenge mode is active
2. Check console for scaling messages
3. Review
TRAINER_SCALING configuration
Ruby:
# Check in battle
if ChallengeModes.running?
pbMessage("Scaling should be active")
else
pbMessage("No challenge - no scaling")
end
#### Randomizer Inconsistent
Problem: Same Pokemon randomizes differently
Solutions:
1. Seed may have changed - check
$PokemonGlobal.challenge_randomizer_seed2. Clear randomizer map to reset:
$PokemonGlobal.challenge_randomizer_map = {}3. Ensure consistent game state
Ruby:
# View randomizer state
pbMessage("Seed: #{$PokemonGlobal.challenge_randomizer_seed}")
pbMessage("Map size: #{$PokemonGlobal.challenge_randomizer_map.size}")
### Debug Commands
#### View Challenge State
Ruby:
# In an event or console
p "Started: #{$PokemonGlobal.challenge_started}"
p "Rules: #{$PokemonGlobal.challenge_rules}"
p "Encounters: #{$PokemonGlobal.challenge_encs}"
p "Monotype: #{$PokemonGlobal.challenge_monotype_type}"
p "Seed: #{$PokemonGlobal.challenge_randomizer_seed}"
Ruby:
# Manually set rules for testing
$PokemonGlobal.challenge_rules = [:PERMAFAINT, :ONE_CAPTURE]
$PokemonGlobal.challenge_started = true
ChallengeModes.toggle(true)
Ruby:
# Nuclear option - clear all challenge data
$PokemonGlobal.challenge_started = nil
$PokemonGlobal.challenge_rules = nil
$PokemonGlobal.challenge_encs = nil
$PokemonGlobal.challenge_monotype_type = nil
$PokemonGlobal.challenge_randomizer_seed = nil
$PokemonGlobal.challenge_randomizer_map = nil
ChallengeModes.toggle(false)
## FAQ
### Q: Can I add custom rules?
A: Yes! Add new rules to
RULES hash in 000_Config.rb and implement the logic in appropriate files.### Q: Are save files compatible between versions?
A: Yes, save files from Nuzlocke EX are compatible. New features activate automatically.
### Q: Can I change rules mid-challenge?
A: Not recommended. Rules are locked at challenge start. Changing them may cause issues.
### Q: Does this work with other plugins?
A: Generally yes. Tested with Level Caps EX, Advanced AI, and Voltseon's Pause Menu.
### Q: Can I disable trainer scaling?
A: Yes, set all values in
TRAINER_SCALING to false or 0.### Q: What happens if Level Caps EX isn't installed?
A: Level Cap rule will be available but won't function. Other rules work normally.
### Q: Can I use this for a story-enforced challenge?
A: Yes! Use
use_forced_rules(true) and set_forced_rules() to force specific rules.### Q: How do I translate this plugin?
A: All text uses
_INTL() for translation. Edit your language files in PBS/Text/.- Credits
- Nononever
