View Single Post
  #392    
Old June 26th, 2009, 02:52 AM
score_under's Avatar
score_under
I program the *other* ASM.
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 21
Nature: Rash
Quote:
Originally Posted by iTAIYO View Post
MY code messed up please help

i put in this code
Code:
#org 0x8800638
'-----------------------------------
checkflag 0x9999
if 0x1 jump 0x88006F6 ' Equal To
msgbox 0x8800657 ' I found this helples...
callstd MSG_NORMAL ' Normal message
addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300
setflag 0x9999

#org 0x88006F6
'-----------------------------------
msgbox 0x88006FF ' Please take it away.
callstd MSG_NORMAL ' Normal message
end


#org 0x8800657
= take this Charmander.

#org 0x88006FF
= Please take it away.
Then it turned into this after i compiled it
5 problems with that code:
  • 0x9999 is not a valid flag, if I recall correctly. Try 0x200, 0x500, 0x250, or something similar.
  • Your #orgs are too close together - first erase the script by replacing all #org with #eorg and compiling the original script, then replace all #eorg with #org again and use dynamic offsets instead.
  • You're missing an "end" after the setflag
  • He says "Please take it away" if you talk to him *after* you take it away.
  • No Lock/Faceplayer/Release


The script to erase your current script:
Code:
#eorg 0x8800638
'-----------------------------------
checkflag 0x9999
if 0x1 jump 0x88006F6 ' Equal To
msgbox 0x8800657 ' I found this helples...
callstd MSG_NORMAL ' Normal message
addpokemon 0x4 0xB 0x0 0x0 0xF000000 0xC300C300
setflag 0x9999

#eorg 0x88006F6
'-----------------------------------
msgbox 0x88006FF ' Please take it away.
callstd MSG_NORMAL ' Normal message
end


#eorg 0x8800657
= take this Charmander.

#eorg 0x88006FF
= Please take it away.
The script with dynamic offsets:
Code:
#dynamic 0x800000
#org @start
'-----------------------------------
lock
faceplayer
checkflag 0x251
if true jump @already-have
msgbox @take-this
callstd MSG_NORMAL
addpokemon CHARMANDER 0xB 0x0 0x0 0x0000000 0x00000000
setflag 0x251
release
end

#org @already-have
'-----------------------------------
msgbox @take-it-away
callstd MSG_NORMAL
release
end


#org @take-this
= take this Charmander.

#org @take-it-away
= Please take it away.
Notice that you can also use "CHARMANDER" in "addpokemon".

It would be better if you checked if you had enough party space first, and changed the "Please take it away" message to "How's my CHARMANDER doing?" or something.
If this is the first pokémon you get in the game, you have to add another setflag, "setflag FR_POKEMON" (if you're hacking fire red) or "setflag RS_POKEMON" (if you're hacking R/S). This tells the game that you are allowed to access the "Pokémon" item on the pause menu.
__________________
Plz not to PM me, I don't come here often enough. Email if you need me

Last edited by score_under; June 26th, 2009 at 05:23 AM.