Advertiser Content

Vendily

Female
Seen 3 Hours Ago
Posted 18 Hours Ago
956 posts
4.2 Years
You can use pbCheckMove(move) to find the pokemon with the move or nil if none are available.
Despite the comment describing it, it returns a pokemon object, and not an index in the party.

I don't really event, but maybe a parallel process to set the switch?

Seen 1 Hour Ago
Posted September 9th, 2019
63 posts
1.3 Years
I found out how to do it:
def pbMoveFinder
move = getID(PBMoves,:PSYCHIC) || getID(PBMoves,:EXTRASENSORY)
movefinder = Kernel.pbCheckMove(move)
if !movefinder
return false
else
return true
end
return false
end
Make a new script above Main that has this, then make a conditional branch in an event with pbMoveFinder. Obviously change Psychic or Extrasensory to whatever moves you want to trigger the event.

mgriffin

Online now
Posted 1 Hour Ago
707 posts
5.5 Years
Did you intend for your code to check for either Physic or Extrasensory? Because as-written it doesn't do that (it actually checks for Psychic, unless Psychic isn't in your game at all in which case it checks for Extrasensory).

Also
if !movefinder
  return false
else
  return true
end
Could simply be
return movefinder
And that trailing return false is unreachable (i.e. if you deleted it nothing would change, because the code can never get to that point—the if/else always returns from the function first).
Advertiser Content