Thread: [Tutorial] Scripting Tutorial - PokeScript
View Single Post
Old January 25th, 2008 (4:02 PM).
/Circa's Avatar
/Circa /Circa is offline
a face in the clouds.
Join Date: Nov 2007
Location: Melbourne, Victoria
Gender: Male
Nature: Quiet
Posts: 877
Alright, thanks thethethethe.

Someone asked me today, how would they make one event cancel out two, it is actually fairly simple, such as in a starter script.

When you receive the Pokemon you add a setflag, the same for all three.
But for the one you get you add a raw 53 to remove it, so it cant be interacted with.

So in a starter script we would add a question, if you wanted the Pokemon, and then send it to a pointer if they want it. They would receive the Pokemon and the Pokeball would dissapear, (Using #raw 0x53)

Then we would add a setflag. The script would be exactly the same for all three starters, just a different Pokemon Number and Pokemon name in the textbox. So infact, it is fairly simple, i'll write an example.

This will be for Pokemon Yellow, you choose a Pikachu or an Eevee.

#org $begin
checkflag 0x200
if b_true goto $alreadygot
message $wantpikachu
$wantpikachu 1 =Would you like this Pikachu?
boxset 5
compare LASTRESULT 1
if 1 goto $getpika
message $toobad
$toobad 1 =Too bad,\nit would be a good choice.
boxset 6

#org $getpika
givepokemon 0x19 0x5 0x0
message $received
$received 1 =\v\h01 Received a PIKACHU!
boxset 6
#raw 0x53
#raw 0x00
setflag 0x200

#org $alreadygot
message $got
$got 1 =You already got a Pokemon!
boxset 6
When we add #raw 0x53 that person can no longer be interacted with.
Be aware though, I wrote that script in a hurry.

Now you can use that script as a base for the others.
Just change the Pokemon number and your done.