• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - 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] Scripting cutscenes?

  • 1
    Posts
    9
    Years
    • Seen Jul 11, 2018
    Right, so I'm kinda new to the romhacking thing, I tried dabbling in it a bit back in 2015 sometime and gave up at some point thinking that it was too hard for me to accomplish. Few years later and here I am back at it again but this time I'm actually going to reach out to the community for a bit of help. I'm hacking Emerald in hopes of adding some stuff to the base game without really changing it too much, I've already got the custom sprites I needed inserted and ready to go, I understand mapping and battle scripts but the big thing I'm posting here for help/advice on is well, scripting cutscenes. If you can even call them that ? I'll try to be as specific as possible by providing examples I actually want to implement in the game...
    Say I wanted to have an NPC appear outside Rusturf Tunnel after the player defeats the Team Aqua grunt in there and rescues Peeko, walk up to the player, talk to them and then disappear. This kind of thing is more or less the main bulk of stuff I want to add to the game (it's more or less a passion project that I've wanted to do for a while, but I digress). I know it has something to do with flags and variables, but are there specific flags for events that tell the game that the player has already defeated said grunt and that it's time to trigger the event where the NPC would speak to the player and then leave so that it only happens that one time? I really hope I explained that well enough, I'm honestly kinda terrible at explaining stuff-- I can provide more examples of things I want to script into the game too if it helps clarify things better.
    Anyway, if anyone can link me tutorials that deal with scripting cutscene events or explain how they work to me I would REALLY appreciate any help at all.
    Thanks in advance !
     
    Anyway, if anyone can link me tutorials that deal with scripting cutscene events or explain how they work to me I would REALLY appreciate any help at all.
    Thanks in advance !

    There are two parts to this. The actual cutscene, and the part where the game remembers to have the guy not show up anymore. I'll address both of these in order.

    Let's, first off, write the script for the NPC event, and set aside the whole "making him appear and dissapear" for now. From reading your post I am going to assume you already know the basics of scripting, but feel free to ask questions or view this thread if this is not the case. You should start with a basic shell for your cutscene, something similar to this:

    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    faceplayer
    [B]
    'The "meat" of the cutscene goes here.[/B]
    
    release
    end

    So for a message box you use msgbox @1 0x6 and put your wanted message at #org @1 (again if you don't understand that command yet read this. You can put as many of these in a row you you want.

    Now we need to talk about movements. You know, stuff like where the game moves the player and other people scripted. In A-Map you need to set the NPC's Person ID to a unique number. This blank is near the bottom and is NOT the Person Number. applymovement is the command for the job. For your purpose of having only one NPC that needs to be scripted to move around you can just set the ID to 1 and use applymovement 0x1 @movements and put the raw code for the movements at #org @movements (learn about those in that magical link I keep using.) Please note the person ID for the player is 0xFF, for when you want the player to move during a cutscene. Use these in conjunction with waitmovement and in between your msgboxes to make a cutscene, then when you are done, you either have the NPC walk off the screen or fade to black with fadescreen, then hide the person with hidesprite. Again, details on that thread.

    Now we are going to address the matter of showing/hiding the NPC for when the time is right. It's actually not complicated. If you go to the header tab on an A-Map map, you will see a level script tab. Add a script and set it to "On Map Entered, Not On Menu Close". Then make a new script in XSE. What this script needs to do is basically use the showsprite or hidesprite commands, but only on certain conditions.

    What we need is a way to keep track of if you've already done the cutscene. Use a flag or a variable, read about them on this seperate thread. Use the setflag or setvar commands, then use compare command to check the values of your flag/variable. diegoisawesome's tutorial explains those commands in detail. Then, in your level script, based on your compare use showsprite or hidesprite depending on what your flags mean to you. The NPC's cutscene can't be activated if the NPC is hidden, so you don't need to put these checks in the actual cutscene script itself, just the level script that shows or hides your NPC.

    Hopefully this nudges you in the right direction.
     
    Back
    Top