• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Other] A question about scripting, if I may ask...

Status
Not open for further replies.
  • 16
    Posts
    14
    Years
    • Seen May 21, 2015
    Hello there, good people of PokéCommunity. :]​

    I recently got into ROM hacks (mainly by playing great ones like the Ruby Destiny series and Prism), and I became interested in how they were made.
    I looked more into it a few days ago, and from then on became set on beginning to teach myself.
    So, I downloaded the tools, played with them, looked up some tutorials, yada yada.

    The mapping basics came quickly, but scripting is giving me a bit of a problem when it comes to combining certain factors, and I would like to know if I can get some help.

    The test script I'm trying to figure out is basically: Initiate trainer battle, battle finishes, trainer gives you a level 5 pokemon for defeating him. When it came to writing the script for the trainer battle,
    I did just fine by following simple tutorials and came up with this TTGL reference trainer:

    Code:
    #dynamic 0x71AC00
    
    #org @start
    lock
    faceplayer
    trainerbattle 0x0 0x2E2 0x0 @challenge @defeat
    msgbox @talk1 0x6
    textcolor 0x01
    end
    
    #org @challenge
    = A trainer?!\nEAT THIS.\p\v\h01: NEVER.
    
    #org @defeat
    = ...Wow, kid.\nYou're not half bad!
    
    #org @talk1
    = Y'know, kid, you're not half bad.\nI'll give you this...\pLET THIS BE THE DRILL THAT\n PIERCES THE HEAVENS.\p\v\h01 has recieved a RHYHORN!
    
    #org @done
    lock
    faceplayer
    release
    end

    That code works just fine. He spots me, says his text in the correct blue color, and the battle begins. His name is correct, he has the Pokémon I gave him, and he says the correct ending/after text.

    Here are some quick screenshots I took:
    Spoiler:

    (Sorry about the horrible resizing of the screenshots. >_> I'll play with that later when I actually need to make them pretty, lol.)

    So, that worked out okay. The thing I'm having a problem with is combining the trainerbattle and givepokemon commands.
    I wasn't about to just give up and not try it, so here's my attempted text from everything I've learned:

    Code:
    #dynamic 0x71AC00
    
    #org @start
    lock
    faceplayer
    trainerbattle 0x0 0x2E2 0x0 @challenge @defeat
    msgbox @talk1 0x2
    checkflag 0x1019
    if 0x1 call @nomore
    givepokemon 0x6F 0x5 0x0 0x0 0x0 0x0
    setflag 0x1019
    end
    
    #org @challenge
    = A trainer?!\nEAT THIS.\p\v\h01: NEVER.
    
    #org @defeat
    = ...Wow, kid!
    
    #org @talk1
    = Y'know, kid, you're not half bad.\nI'll give you this...\pLET THIS BE THE DRILL\nTHAT PIERCES THE HEAVENS.\p\v\h01 has recieved a RHYHORN!
    
    #org @nomore
    msgbox @msg 0x2
    end
    
    #org @msg
    = Don't believe in yourself.\nBelieve in me who believes in you.


    What did I get as soon as he spotted me?
    A funny text saying something like, "eeeee!!!!%%%&^#&&***...." and so on and so forth. It was endless.

    So, I attempted to have him initiate the battle, say his thing, fight me, lose, and after the battle when I talk to him again, he gives me a level 5 rhyhorn. After that, I wanted him to just keep repeating,
    "Don't believe in yourself. Believe in me who believes in you" every time I talk to him, but I obviously didnt' get to see how that worked out.


    Other components I wanted to factor in but had absolutely no idea where to put them were:

    Code:
    fanfare 0x13E
    waitfanfare
    Some way to nickname it...?

    And that wraps up that portion of my question...

    ----------~----------~----------~----------~----------~

    Another question I had is one concerning events that kind of confused me.

    For example, say there was an event that was going on in which a raging venasaur attacked my home village. The only two maps involved are the home village and route 1.

    I go downstairs, my mom stops me and, in short, says, "Something's going on. Take my Pokémon to protect you." and gives me her guardian friend, Latios.
    So, I go outside, eerie music is playing and it's heavily raining/thunderstorming. There is an elderly man outside of my house that's laying on the ground
    and a young child at the top of the map before route 1. The elderly man says something like, "...A Pokémon attacked the village...It fled to route 1," and the young girl says something like,
    "Mommy ran after daddy when he chased the weird Pokémon to route 1! Please, help them!"
    Screenshots:
    Spoiler:


    So, I go to route 1 (which is also rainy with other dreary music), an event of some kind plays, I fight and faint the venasaur, it flees. Then...I pass out or something and script a fadescreen command.

    When I "come to" is where my question lies. How do I make it so that the village and route 1 is back to normal? I.E.: Sunny weather, the old man is no longer laying down, the young girl is running around with her parents, route 1 is cloudy, and everyone has completely different scripts...? That completely puzzled me, and I've seen it done on other games many times before.

    In short, how to go from:

    [Event]
    Dreary rainy village with scared/hurt villagers
    Route 1 with fighting event and rainy weather
    Pass out/Fade screen, maybe warp back to home

    to

    Sunny village with normal villagers with different messages/scripts
    Route 1 is cloudy/sunny/normal.


    ----------~----------~----------~----------~----------~

    Thank you so much in advance, everyone. I would really appreciate any help I can get! I'm really interested in ROM hacking and all of its components! It's fascinating, in my opinion.
     
    for nicknaming use these commands:-
    fadescreen 0x1
    special 0x9E
    waitstate

    for the trainer not battling again, you need to add in a command BEFORE the trainerbattle command saying:-
    checkflag 0x(trainerflag)
    if 0x1 goto @whatever

    then you need to add in a new paragraph:-
    #org @whatever
    msgbox @msg 0x2
    callstd 0x4
    release
    end

    for the weather thing you need to make it so that the maps and music are set to how you want them to be after all of this has happened and add a level script to these maps telling them to play the dreary song and to have the weather as stormy; and have it so that before you go outside the variable for the level scripts are set to happen, but make sure that the script for setting the variable to make it happen can only be run once and also at the end of all of this stormy stuff there is a script then sets the variable number one higher so that it doesn't happen twice. Haha I know this is really complicating and confusing.
     
    Status
    Not open for further replies.
    Back
    Top