The PokéCommunity Forums Fan Games ROM Hacking
Script What's wrong with this script?

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.


Reply
 
Thread Tools
  #1    
Old 4 Weeks Ago (12:35 PM).
AbsoluteJustice AbsoluteJustice is offline
     
    Join Date: Jun 2018
    Posts: 3
    So I've been getting into coding and figured a good way to start is by developing a rom hack. I get the basics of XSE and so far I've been able to make simple dialogue boxes and whatnot, but as I moved on to the more advanced stuff things got a little funky.

    I figured I might as well throw in a guy who gives you a Chikorita to test my scripting capabilities. The thing is, XSE keeps giving me the "no #org/#seek directives found" error when I try to compile it.

    Spoiler:

    #dynamic 0x71AC01

    #org @start
    lock
    checkflag 0x250
    if 0x1 jump :end
    msgbox @1 0x5
    setflag FR_POKEMON
    countpokemon
    compare LASTRESULT 6
    if == jump @noroom
    addpokemon CHIKORITA 0x5 PEARL 0 0 0
    setflag 0x25
    0storepokemon 0 CHIKORITA
    msgbox @get-msg
    fanfare 0x101
    showmsg
    waitfanfare
    waitbutton
    :end
    release
    end



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



    #org @1
    = Hey!\pI run a Chikorita farm! \pYou probably already know\nthat 'cause you live here. \pYou look like a good trainer, \nso how about you take this baby\nout on some adventure of yours?

    #org @noroom-msg
    = You don't have enough room in your party.

    #org @get-msg
    = Aquired Chikorita!



    Anyone know what's up? I'd appreciate as much advice as possible as I'm a slow learner when it comes to this complicated stuff.
    Reply With Quote

    Relevant Advertising!

      #2    
    Old 4 Weeks Ago (7:47 PM).
    DrFuji's Avatar
    DrFuji DrFuji is offline
    Heiki Hecchara‌‌
     
    Join Date: Sep 2009
    Location: Aussie
    Age: 25
    Gender: Male
    Nature: Jolly
    Posts: 1,423
    Quote:
    Originally Posted by AbsoluteJustice View Post
    So I've been getting into coding and figured a good way to start is by developing a rom hack. I get the basics of XSE and so far I've been able to make simple dialogue boxes and whatnot, but as I moved on to the more advanced stuff things got a little funky.

    I figured I might as well throw in a guy who gives you a Chikorita to test my scripting capabilities. The thing is, XSE keeps giving me the "no #org/#seek directives found" error when I try to compile it.

    Spoiler:

    #dynamic 0x71AC01

    #org @start
    lock
    checkflag 0x250
    if 0x1 jump :end
    msgbox @1 0x5
    setflag FR_POKEMON
    countpokemon
    compare LASTRESULT 6
    if == jump @noroom
    addpokemon CHIKORITA 0x5 PEARL 0 0 0
    setflag 0x25
    0storepokemon 0 CHIKORITA
    msgbox @get-msg
    fanfare 0x101
    showmsg
    waitfanfare
    waitbutton
    :end
    release
    end



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



    #org @1
    = Hey!\pI run a Chikorita farm! \pYou probably already know\nthat 'cause you live here. \pYou look like a good trainer, \nso how about you take this baby\nout on some adventure of yours?

    #org @noroom-msg
    = You don't have enough room in your party.

    #org @get-msg
    = Aquired Chikorita!



    Anyone know what's up? I'd appreciate as much advice as possible as I'm a slow learner when it comes to this complicated stuff.
    Your script has quite a few commands that don't exist in XSE or are being used incorrectly. Here's a version of your script that should work with some comments to indicate why something has been changed. Also, make sure that you're using XSE v1.1.1 as 1.0.0 is pretty buggy if you're just starting to learn how script. If you're unsure about a XSE command you can check out diegoisawesome's XSE tutorial or search the command list by pressing F1 in XSE.

    Spoiler:
    #dynamic 0x71AC01

    #org @start
    lock
    faceplayer // Added this to make the NPC face the player
    checkflag 0x250
    if 0x1 goto @skip // You have to supply a pointer here. ':' won't work in XSE
    msgbox @Talk 0x5
    compare 0x800D 0x0
    if 0x1 goto @No // You're using a Yes/No msgbox box but didn't check what the player's answer was. This branches off if the player said no
    setflag 0x828
    countpokemon
    compare 0x800D 0x6
    if 0x1 goto @NoRoom // XSE dosn't use notation such as '=='. 0x1 means 'equals''
    givepokemon 0x97 0x5 0x6A 0x0 0x0 0x0 // storepokemon isn't a command in XSE
    setflag 0x250 // Changed this to 0x250 as you were missing the 0 at the end
    msgbox @Get 0x4 // Removed the 'callstd' line and put the value at the end of the msgbox command
    fanfare 0x101 // showmsg isn't a command in XSE and has been deleted
    waitfanfare
    closeonkeypress // waitbutton isn't a command in XSE
    release
    end

    #org @skip
    msgbox @Completed 0x6 // Added text here because otherwise the NPC would never say anything once you received Chikorita from them
    release
    end

    #org @No // New branching path if the player said no to taking Chikorita
    msgbox @AnsweredNo 0x6
    release
    end

    #org @NoRoom
    msgbox @FullParty 0x6 // Removed the 'callstd' line and put the value at the end of the msgbox command
    release
    end

    #org @Talk
    = Hey!\nI run a Chikorita farm!\pYou probably already know that\n'cause you live here.\pYou look like a good trainer,\nso how about you take this baby\lout on some adventure of yours?

    #org @AnsweredNo
    = That's a shame.\nIt could use a real good home...

    #org @FullParty
    = You don't have enough room in\nyour party.

    #org @Get
    = Aquired Chikorita!

    #org @Completed
    = How's that Chikorita I gave\nyou faring?


    Good luck in your scripting/ coding journey!
    __________________
    Reply With Quote
      #3    
    Old 4 Weeks Ago (9:06 AM).
    AbsoluteJustice AbsoluteJustice is offline
       
      Join Date: Jun 2018
      Posts: 3
      Ah, makes sense. Thank you very much dude
      Reply With Quote
        #4    
      Old 3 Weeks Ago (8:23 AM).
      hjk321's Avatar
      hjk321 hjk321 is offline
         
        Join Date: Sep 2017
        Posts: 84
        Just a side note, but ROM hacking is not a good way to learn coding if you are just dipping your feet in for the first time. Hell, I've been coding since I was 10 and I still barely understand how Pokemon hacking works. I would maybe suggest trying Javascript or Python instead?

        But if hacking works for you then welcome to poke community! :)
        Reply With Quote
        Reply

        Quick Reply

        Join the conversation!

        Create an account to post a reply in this thread, participate in other discussions, and more!

        Create a PokéCommunity Account

        Sponsored Links
        Thread Tools

        Posting Rules
        You may not post new threads
        You may not post replies
        You may not post attachments
        You may not edit your posts

        BB code is On
        Smilies are On
        [IMG] code is On
        HTML code is Off

        Forum Jump


        All times are GMT -8. The time now is 4:37 PM.