View Single Post
  #7320    
Old September 18th, 2012 (09:33 AM).
Alignment's Avatar
Alignment Alignment is offline
Revered with the stars
 
Join Date: Mar 2010
Gender: Male
Nature: Lonely
Posts: 308
Quote originally posted by Inkblots:
Okay, I'm brand new to this, so I'm sure it's a really simple fix, but I cannot see what's wrong for the life of me.
I'm just trying to do a simple yes/no script in which the player receives a Treecko if they push yes (copying a script almost directly from a tutorial by Full Metal). However, when I go to test it, "yes" ends up getting treated the same as "no", and I can't get the pokemon. Can anybody see what I did wrong?

Game: Ruby
Type: Person event
Editor: PKSV
Script:
Spoiler:
#dynamic 0x740000

#org @main
lock
faceplayer
checkflag 0x200
if 0x1 jump @haveit
message @want
callstd MSG_YESNO
if 0x1 jump @yes
jump @no

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @yes
setflag 0x200
addpokemon TREECKO 5 00 0 0 0
message @herego
callstd MSG_NORMAL
release
end

#org @no
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= I have this TREECKO, but I don't want it. \nWould you like it?

#org @howsit
= How is my TREECKO doing?

#org @dontwant
= Oh, ok. I'll find another trainer.

#org @herego
= Here you go. Please take good care of my TREECKO!
If you're using PKSV you don't need to say 0x1 and stuff, it provides confusion. Just say compare LASTRESULT YES and it should work. If 0x1 will not work, you need to check the last result.

Spoiler:
#dynamic 0x740000

#org @main
lock
faceplayer
checkflag 0x200
if TRUE jump @haveit ' it's a good habit to use words like TRUE and YES because they help the scripter avoid confusion when they're reviewing the script
msgbox @want
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @yes

call @no


#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @yes
setflag 0x200
addpokemon TREECKO 5 00 0 0 0
message @herego
callstd MSG_NORMAL
release
end

#org @no
message @dontwant
callstd MSG_NORMAL
release
end

#org @want
= I have this TREECKO, but I don't want it. \nWould you like it?

#org @howsit
= How is my TREECKO doing?

#org @dontwant
= Oh, ok. I'll find another trainer.

#org @herego
= Here you go. Please take good care of my TREECKO!


That's the fix, try it out should work