- 9
- Posts
- 13
- Years
- Toronto, Canada
- Seen Apr 16, 2015
Hey guys, I wanted to ask how to place the Player's party Pokémon in a temporary location. I have a situation where the player must select a Pokémon from a predetermined set, and battle with one of them rather than the Player's party.
Here's what I've figured out so far:
Now, even with all this knowledge, I still have no idea what I'm doing. I tried making a simple event that calls a script that, like the Bug Catching Contest, adds the player's current party to a temporary array, then adds the selected Pokemon.
Script:
Event Page 1:
Of course, it doesn't work, and I get NoMethod errors when I view the party or take a step. I know I'm doing this completely wrong. Does anyone else have any ideas?
Here's what I've figured out so far:
First I looked into the Bug Catching Contest to see what happens there.
So, first it pushes the player's other party Pokemon into a separate array, and sets the player's party to just the one they selected. It then adds them back at the end of the contest.
I then checked out the wiki and found that there's a handy script that adds a pokemon to the party.
Looks like that will do the trick.
Spoiler:
Code:
chosenpkmn=$Trainer.party[@chosenPokemon]
for i in 0...$Trainer.party.length
if i!=@chosenPokemon
@otherparty.push($Trainer.party[i])
end
end
...
$Trainer.party=[chosenpkmn]
...
for poke in @otherparty
$Trainer.party.push(poke)
end
So, first it pushes the player's other party Pokemon into a separate array, and sets the player's party to just the one they selected. It then adds them back at the end of the contest.
I then checked out the wiki and found that there's a handy script that adds a pokemon to the party.
Spoiler:
Code:
pbAddToPartySilent(PBSpecies::species,level)
Looks like that will do the trick.
Now, even with all this knowledge, I still have no idea what I'm doing. I tried making a simple event that calls a script that, like the Bug Catching Contest, adds the player's current party to a temporary array, then adds the selected Pokemon.
Script:
Spoiler:
Code:
def pbStorePokemon(variable)
@otherparty=[]
for i in 0...$Trainer.party.length
@otherparty.push($Trainer.party[i])
end
end
Event Page 1:
Spoiler:
Code:
@>Text: Choose a Pokemon. I'll hold the rest.
@>Script:pbStorePokemon(1)
@>Show Choices: Mew, Mewtwo
: When [Mew]
@>Conditional Branch: Script: pbAddToParty(PBSpecies::MEW,50)
@>Text: Excellent.
@>
: Else
@>
: Branch End
@>
: When [Mewtwo]
@>Conditional Branch: Script: pbAddToParty(PBSpecies::MEWTWO,50)
@>Text: Excellent.
@>
: Else
@>
: Branch End
@>
: Branch End
@>
Of course, it doesn't work, and I get NoMethod errors when I view the party or take a step. I know I'm doing this completely wrong. Does anyone else have any ideas?