• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Help me learn code Sensei!!!

  • 8
    Posts
    4
    Years
    Anyone Who knows code, will know that segments of this code won't work. I know because I placed the segment and tested it. It failed. What did I do wrong? Something I did not add? A definition I failed to mention? A magic word I did'nt know existed? : ) How long can a single instruction be before the rom runs out of space?

    What I am trying to do is initiate a "follow along" sequence where the NPC "0x09" takes our player 0xFF on a tour of the town that ends inside a building, once inside I want to then program a pokemon exchange animation.

    I realize I have not programmed for 0xFF because my tests on 0x09 haven't worked yet. How do I make one follow the other? how long can the code segment be? Are there any limitations? What is proper code structure? What has to happen first and what can happen later? Thank you for any light you can shed on my problem. From what I know, I think this code can only apply to r/s/e and not Lg/Fr as they are written slightly differently.

    Here's my code so far :

    ---Start-Of-Code---
    ------ ------
    ------ ------


    #dynamic 0x740000
    #org @start
    lock
    faceplayer
    message @talk
    callstd MSG_YESNO
    compare LASTRESULT YES
    if == jump @yes
    jump @no


    #org @yes
    message @speakyes
    callstd MSG_NORMAL
    applymovement 0x09 @move
    release
    end

    #org @no
    message @speakno
    callstd MSG_NORMAL
    release
    end

    #org @speakyes
    message @speakyes
    callstd MSG_NORMAL

    #org @talk
    = Hey, ya'll from out of town?

    #org @speakyes
    = Wonderful! Follow me!

    #org @speakno
    = Dang, been want'n to give a grand ole tour.

    #org @move
    M raw_53 look_up raw_40 walk_down_slow raw_41 end

    ------ ------
    ------ ------
    ---End-Of-Code---

    The code that dosen't work is : "applymovement 0x09 @move" & "#org @move M raw_53 look_up raw_40 walk_down_slow raw_41 end"
     
    I'm starting to understand the code structure.

    After reading a bunch of Sierra's mega thread I linked PKSV-UI with AdvanceMap and used AdvanceMap to read the scripts to see if I could decipher anything. I looked in the relavent maps looking at the scripts of the different events. like in Oldale town when you enter it and talk to the shop keeper on the right side of the Oldale map. He will ask a question, take you on a walk, and give you an item, the script even plans for a "full inventory" conflict. I delved further, looking at what I think are the npc's scripts themselves. These scripts contain all the events and the pointers and specific hex codes for each event and so on for this particular npc. I still have a few questions but I think I should continue to read and test and experiment. I really can't think of the actual questions I want to ask. But one might be, can these pointers and hex lines be recycled or ammended? Or do I have to create entirely new sets of pointers and hex lines?
     
    But one might be, can these pointers and hex lines be recycled or ammended? Or do I have to create entirely new sets of pointers and hex lines?

    If you're asking whether pointers from one script can be reused in another, then yep! One script is all you need to define the pointer, such as:
    #org 0x8000000
    = This is my text that I've written!

    You can call on that text for a msgbox in any other script by using:
    msgbox 0x88000000
    (followed by the rest of the regular msgbox code).

    Remember that you have to use static pointers like I've done for this, not "@text" .

    That'll work for movement data too!
     
    If you're asking whether pointers from one script can be reused in another, then yep! One script is all you need to define the pointer, such as:
    #org 0x8000000
    = This is my text that I've written!

    You can call on that text for a msgbox in any other script by using:
    msgbox 0x88000000
    (followed by the rest of the regular msgbox code).

    Remember that you have to use static pointers like I've done for this, not "@text" .

    That'll work for movement data too!

    Thank you Asith, I'll really study how this works. I was able to get the player to move along a path, open a door and warp to a new map after talking with an npc. Thank you!
    I'll have more questions in the future but I'll study/test some more.
     
    Back
    Top