- 7
- Posts
- 7
- Years
- Seen Mar 1, 2017
I'm a scripting super-newbie who's been doing my best to self-teach, and reaching out for help when I need it, and now's one of those times I could use a quick lesson.
My end goal is to have an Event Encounter that is a double battle, with one wild Pokémon always being male and the other always being female.
Looking at the "Modifying the Pokémon" section of the Essentials Wiki's Event Encounters page, I understand the concept of creating a switch and editing the PField_EncounterModifiers section of the script. What I need assistance with is how to make one thing happen to one Pokémon, and a different thing happen to the other.
I tried the following:
The error message I get when the event runs is as follows:
And yes, I combined NIDORANm and NIDORANf into a single NIDORAN species in my heavily-edited Pokédex, which is why I'm needing to figure out how to do this at all. Although my game is going to be Double Battle-centric, so I'm sure I'll need to figure out how to modify double battle Event Encounters eventually.
The part of the error message reading "Message: Section104:20undefined local variable or method `pokemon1' for nil:NilClass" makes me figure that it's my naming of "pokemon1" and "pokemon2" that's incorrect, but I'm not sure where to find the proper way to refer to them.
Any help would be appreciated. Thanks!
My end goal is to have an Event Encounter that is a double battle, with one wild Pokémon always being male and the other always being female.
Looking at the "Modifying the Pokémon" section of the Essentials Wiki's Event Encounters page, I understand the concept of creating a switch and editing the PField_EncounterModifiers section of the script. What I need assistance with is how to make one thing happen to one Pokémon, and a different thing happen to the other.
I tried the following:
Code:
Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[61]
pokemon1.makeMale
pokemon2.makeFemale
end
}
The error message I get when the event runs is as follows:
Spoiler:
Code:
Exception: RuntimeError
Message: Script error within event 4, map 42 (Forest):
Exception: NameError
Message: Section104:20undefined local variable or method `pokemon1' for nil:NilClass
***Full script:
pbDoubleWildBattle(PBSpecies::NIDORAN,1,PBSpecies::NIDORAN,1,26,FALSE,TRUE)
Interpreter:243:in `pbExecuteScript'
PField_EncounterModifiers:17:in `call'
Event:54:in `trigger'
Event:49:in `each'
Event:49:in `trigger'
PField_Field:868:in `pbGenerateWildPokemon'
PField_Field:956:in `pbDoubleWildBattle'
(eval):1:in `pbExecuteScript'
Interpreter:1606:in `eval'
Interpreter:243:in `pbExecuteScript'
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:103:in `updateold'
Scene_Map:101:in `loop'
Scene_Map:114:in `updateold'
Unreal_Time:151:in `update'
The part of the error message reading "Message: Section104:20undefined local variable or method `pokemon1' for nil:NilClass" makes me figure that it's my naming of "pokemon1" and "pokemon2" that's incorrect, but I'm not sure where to find the proper way to refer to them.
Any help would be appreciated. Thanks!
Last edited: