View Single Post
  #6348    
Old December 30th, 2011, 11:42 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Megiddo-san View Post
The script executes perfectly, unless the player decides to give their pokemon a nickname.
In that case, it calls the nickname script and comes up with a screen asking if I want
to give a nickname to question mark. Completing this results in the pokeball never disappearing,
and the real pokemon is not given a nickname.
Spoiler:
#org @begin
compare 0x4055 0x3
if 0x4 goto @done
cry 0x42 0x0
showpokepic 0x42 0xA 0x3
waitcry
msgbox @question 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
hidepokepic
release
end

#org @done
msgbox @notakey 0x2
release
end

#org @take
givepokemon 0x42 0xA 0x0 0x0 0x0 0x0
hidepokepic
addvar 0x4055 0x1
fanfare 0x13E
msgbox @received 0x4
waitfanfare
closeonkeypress
msgbox @nick 0x5
compare LASTRESULT 0x1
if 0x1 call @name
hidesprite 0x5
setflag 0x206
release
end

#org @name
countpokemon
copyvar 0x8004 LASTRESULT
subvar 0x8004 1

call 0x1A74EB
return

#org @question
= Would you like Machop, the\nmartial arts pokemon?

#org @received
= [player] received a Machop!

#org @nick
= Would you like to nickname your\nMachop?

#org @notakey
= It's best to leave the rest alone.
You told the game to "goto" the naming script so the return command doesn't function correctly. If you change the "goto" to "call," it should work. Also, the question mark glitch is caused by not initializing variable 0x8004 to the number of the pokemon that you want to nickname. Changes are in bold.

Quote:
Originally Posted by AustinWolff View Post
hello I'm trying to make a script where you cannot pass unless you have a certain pokemon. But I get stuck when I am transferring the buffer value to the setvar (have no idea what i just said) anyway here is what I have so far:

Spoiler:
#dynamic 0x800000

#org @start
applymovement 0x2 @move
waitmovement 0x0
msgbox @1 0x6
bufferpokemon 0x1
setvar 0x4004 0x1
compare 0x4004 0x1

if 0x1 goto @continue
................................


any idea of where to go from there?
I'm not sure what you were hoping to accomplish here. The bold commands make the conditional completely useless because you set variable 0x4004 to 1 right before you compare it to 1. Therefore, the compare will always return true.
__________________

Brother of Vrai