|
This is as simple as using hidesprite and setflag commands. If you want to make 2 Oak battles, you'd open up the preffered trainer editor and make 2 seperate teams for professor Oak. Below, I'll write a script in which a trainer (in this case the professor) is battled and then disappears. But I'll first make the player choose between 2 pokeballs and based on their choice the professor will have the other Pokemon (First script).
#dynamic 0x800000
#org @start
lock
msgbox @ChoseBulbasaur 0x5
compare lastresult 0x1
if 0x1 call @Bulbasaur
msgbox @ChoseSquirtle 0x5
compare lastresult 0x1
if 0x1 call @Squirtle
msgbox @NotYet 0x6
release
end
'------------------------------
#org @Bulbasaur
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0 '------------ This gives us a level 5 Bulbasaur with no items
hidesprite 0x1 '------------ If the pokeball's person event number is 1
setflag 0x201 '------------ If you put 201 as pokeball's person ID number (we set a flag so that the pokeball disappears forever and that professor
return knows which pokemon we took so that he could chose the opposite pokemon)
#org @Squirtle
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0 '------------ This gives us a level 5 Squirtle with no items
hidesprite 0x2 '------------ If the pokeball's person event number is 2
setflag 0x202 '------------ If you put 202 as pokeball's person ID number
return
'-----------------------------
#org @ChoseBulbasaur
= Take Bulbasaur?
#org @ChoseSquirtle?
= Take Squirtle?
#org @NotYet
= I should think more about\nthis...
'-----------------------------
#dynamic 0x800000
#org @start
checkflag 0x201 '------------- (Oak checks if we took Bulbasaur)
compare lastresult 0x1
if 0x1 goto @BulbasaurBattle
checkflag 0x202 '------------- (Oak checks if we took Squirtle)
compare lastresult 0x1
if 0x1 goto @SquirtleBattle
'--------------- If we still haven't picked the starter Pokemon, Oak just says Hi.
lock
faceplayer
msgbox @hello 0x6
release
end
'-------------------------
#org @BulbasaurBattle
lock
faceplayer
msgbox @t1 0x6
trainerbattle 0x0 0x1 0x0 @challenge @defeat '----------- This initiates a trainer battle, 0x1 is the ID of a trainer you can find in a pokemon trainer editor
'----------- tool, and for the trainer with the ID of 0x1, make his sprite be the professor and his team
'----------- consist of only Bulbasaur, for the ID of 0x2, make the team be Squirtle only.
hidesprite 0x1 '-------------- this command hides the professor, 0x1 is the person event number in Advance Map
setflag 0x210 '-------------- this command permanently hides the professor. Safe values are from 0x200 to 0x2ff (if I recall correctly) and you write this
release box in Advance Map in the person ID
end
'-------------------------
#org @SquirtleBattle
lock
faceplayer
msgbox @t1 0x6
trainerbattle 0x0 0x2 0x0 @challenge @defeat
hidesprite 0x1
setflag 0x210
release
end
'------------------------
#org @t1
= Hi there, [player]
#org @challenge
= Can you defeat me with\nthe Pokemon you just chose?
#org @defeat
= Impressive indeed.
#org @hello
= Hello [player], are you\nready to choose a Pokemon?
'-----------------------
This was a rather long post, but hopefully some things should be more clear now.
|