View Single Post
Old January 13th, 2013 (8:25 PM). Edited January 13th, 2013 by DrFuji.
DrFuji's Avatar
DrFuji DrFuji is online now
Heiki Hecchara‌‌
Join Date: Sep 2009
Location: Aussie
Age: 25
Gender: Male
Nature: Jolly
Posts: 1,466
Originally Posted by Powerflare View Post
I'm having a few problems with one of my scripts. First of all, the nicknaming portion of the script does not work (when it goes to nickname the Pokémon ingame, it nicknames "?" and not the appropriate Pokémon - the Magikarp given in this script). My second issue: the flag (0x9006) which prevents the guy from selling the Magikarp twice (instead he just tells you to scram) appears to work; however, when I leave the room/open the start menu etc., it seemingly clears the flag/ignores the checkflag and acts as if you've never talked to the guy before (so you can buy another Magikarp - c'mon, that'd be WAY too overpowered if someone could buy TWO Magikarp ^_^). Any suggestions/thoughts/corrections?

PS: I am aware there is no offset after the #dynamic 0x in the spoiler. I didn't think it mattered which offset it was set to. I compiled the script in a test ROM so the offset used for that would be different than the actual offset I intend to compile this script to.

EDIT: Also, another minor glitch/oddity that came up: right around when the Pokémon is given, the lock on the NPC is seemingly released and he begins moving again.

#dynamic 0x

#org @start
checkflag 0x9006
if 0x1 goto @start2
showmoney 0x0 0x0 0x0
textcolor 0x0
msgbox @msg1 0x5
compare LASTRESULT 0x1
if 0x0 goto @end
checkmoney 0x1F4 0x0
compare LASTRESULT 0x1
if 0x0 goto @notenough
compare LASTRESULT 0x6
if 0x1 goto @fullparty
textcolor 0x0
msgbox @msg4 0x6
paymoney 0x1F4 0x0
updatemoney 0x0 0x0 0x0
givepokemon 0x81 0x5 0x0 0x0 0x0 0x0
fanfare 0x101
textcolor 0x2
msgbox @gotpokemon 0x4
textcolor 0x2
msgbox @liketoname 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
textcolor 0x0
msgbox @msg5 0x6
setflag 0x9006
hidemoney 0x0 0x0

#org @start2
textcolor 0x0
msgbox @msg6 0x6

#org @name
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1 
special 0x166

#org @end
textcolor 0x0
msgbox @msg2 0x6
hidemoney 0x0 0x0

#org @notenough
textcolor 0x0
msgbox @msg3 0x6
hidemoney 0x0 0x0

#org @fullparty
textcolor 0x2
msgbox @full 0x6
hidemoney 0x0 0x0

#org @liketoname
= Would you like to give a\nnickname to MAGIKARP?

#org @gotpokemon
= [player] paid an outrageous [$]500\nand bought a[.] MAGIKARP?!

#org @msg1
= MAN: Hey, kid!\pHave I got a deal just for you!\pSee, in the HOENN region,\nthere's this rare POKéMON\lknown as FEEBAS.\pI'll sell one to you for just\n[$]500!\pSo whaddaya say, deal?

#org @msg2
= MAN: I'm just trying to help\nyou out!

#org @msg3
= MAN: Hey, you'll need more\nthan THAT!

#org @msg4
= MAN: Heh-heh, gee thanks kid!

#org @msg5
= MAN: Now git outta 'ere.\pScram!

#org @msg6
= MAN: Git outta 'ere.\pScram!

#org @full
= You're party is full.
The flag doesn't work because that one is simply way beyond what is should be. You should be using flags in the are of 0x200 rather than 0x9000+.

Edit: Just figured out you were hacking Emerald so some of my stuff was wrong
Reply With Quote