View Single Post
  #4924    
Old November 18th, 2010, 03:38 PM
DrFuji's Avatar
DrFuji
Helfen, Wehren, Heilen
 
Join Date: Sep 2009
Location: Upside-downia
Age: 21
Gender: Male
Nature: Jolly
Quote:
Originally Posted by >Entei< View Post
I am having trouble with making a script that gives a Jirachi Egg in Emerald.

This is the script as I have put it in:
Spoiler:
#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' Excuse me.\nI found...
callstd MSG_YESNO
compare LASTRESULT YES
if == jump @code2 ' Equal To
compare LASTRESULT 0x0
if == jump @code3 ' Equal To
release
end

#org @code2
lock
checkflag 0x200
if 0x1 jump @end
giveegg Jirachi
countpokemon
compare LASTRESULT 6
if == jump @noroom
message @get-msg
fanfare 0x101
showmsg
waitfanfare
waitbutton
message @code4
release
end

#org @noroom
msgbox @noroom-msg
callstd MSG_NOCLOSE
release
end

#org @code3
lock
faceplayer
msgbox @text2 ' Sigh.\pI suppose that...
callstd MSG_NOCLOSE
release
end

#org @code4
lock
faceplayer
msgbox @text3 ' Please, take ...
callstd MSG_NORMAL
release
end

#org @end
lock
faceplayer
msgbox @text4 ' How is the egg doing?
callstd MSG_NORMAL
release
end

#org @text4
= How is the egg doing?

#org @text
= Excuse me.\nI found this egg while walking this morning.\nI'm not a trainer, but you seem to be.\lWould you take it?

#org @noroom-msg
= Oh? You have no room to take it.

#org @get-msg
= You recieved the egg!

#org @text2
= Sigh.\lI suppose that you have other things\lto do than to help an old man.\nI'll still be here if you decide you want\lthe egg.

#org @text3
= Please, take\l very good care of it.


But this is what the script shows when I reopen it using Advance Map
Spoiler:
#org @start
'-----------------------------------
lock
faceplayer
msgbox @text1 ' Excuse me.\nI found ...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT YES
if == jump @code2 ' Equal To
compare LASTRESULT 0x0
if == jump @code3 ' Equal To
release
end

#org @code2
'-----------------------------------
lock
checkflag 0x200
if true jump @code4 ' Flag is set
giveegg 0x199
countpokemon
compare LASTRESULT 0x6
if == jump @code5 ' Equal To
message @text2 ' You recieved the egg...
fanfare 0x101
showmsg
waitfanfare
waitbutton
message @text3 ' \h6A\h5A\h0F \h91\h0...
release
end

#org @code4
'-----------------------------------
lock
faceplayer
msgbox @text4 ' How is the egg doing...
callstd MSG_LOCK ' Built-in lock command
release
end

#org @code3
'-----------------------------------
lock
faceplayer
msgbox @text5 ' Sigh.\lI suppose tha...
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end

#org @code5
'-----------------------------------
msgbox @text6 ' Oh? You have no room...
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end


#org @text1
= Excuse me.\nI found this egg while walking this morning.\nI'm not a trainer, but you seem to be.\lWould you take it?

#org @text2
= You recieved the egg!

#org @text3
= \h6A\h5A\h0F \h91\h0D\h9C\h08\h09\h06\h6C\h02\h6A\h5A\h0F \h25y\h8A\h08\h09\h06\h6C\h02 \h01 \h403 \h8A\h12

#org @text4
= How is the egg doing?

#org @text5
= Sigh.\lI suppose that you have other things\lto do than to help an old man.\nI'll still be here if you decide you want\lthe egg.

#org @text6
= Oh? You have no room to take it.


So exactly where am I screwing up?
While I work with XSE, the random line '\h6A\h5A\h0F \h91\h0D\h9C\h08\h09\h06\h6C\h02\h6A\h5A\h0F \h25y\h8A\h08\h09\h06\h6C\h02 \h01 \h403 \h8A\h12' is most likely there because your script was incorrectly inserted/ edited and is now conflicting with the data of the ROM or another script.

Quote:
Originally Posted by >Entei< View Post
Yes I have, and it only shows bits and pieces of it. The Jirachi Egg is added to the party, but then the event is repeatable.
You've got the command 'checkflag 0x200' in the @code2 part of your script, but I can't see where you have set that flag in the script. Even if you did have the flag set, it would display the 'Excuse me.\nI found this egg' text before you reached the checkflag command, which would be really strange.

Anyway, the script should look more like this:

Code:
#dyn 0x740000
#org @start
lock
faceplayer
checkflag 0x200
if 0x1 jump @end
msgbox @text ' Excuse me.\nI found...
callstd MSG_YESNO
...
 
#org @code2
lock
setflag 0x200
giveegg Jirachi
countpokemon
__________________