• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Help Thread: Script Help Thread

Status
Not open for further replies.
41
Posts
10
Years
    • Seen Feb 29, 2016
    Help needed on scripting

    I am making a hack of emerald and I need some help on scripting.
    I want to add scripts for move tutor and I am not sure how to do so, Can someone explain and give me the move table for emerald too, also explain how to select a pokemon which can learn certain move. I will be very thankful to you :)
     

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    I am making a hack of emerald and I need some help on scripting.
    I want to add scripts for move tutor and I am not sure how to do so, Can someone explain and give me the move table for emerald too, also explain how to select a pokemon which can learn certain move. I will be very thankful to you :)

    Take a look at the other move tutor scripts. If I recall correctly, the move that is going to be taught is controlled by a var which determines which move in the table to choose from. If you want to edit which Pokemon can learn which move, download G3HS.
     

    JoshTheTrainer

    Glaceon Lover ~
    101
    Posts
    15
    Years
  • Hey,

    I recently made a Steven trainer script. It basically progresses the trainer (Pokemon Fire Red) and after the battle the player needs to obtain a MysticTicket (for Navel Rock).

    There are 2 problems:

    1. When I win I don't get the item straight away. I need to talk to him again and then he'll give. But he'll keep on giving me the ticket which shouldn't be.
    2. When I have the ticket I still can't go to Navel Rock (you need to activate a flag or something, but which flag, IDK).

    Spoiler:


    Basically what needs to happen:

    1. If the player hasn't fought Steven, show message with @intro.
    2. Start the battle with Steven (trainer ID 001)
    3. If the player win, show message with @afterwards
    4. Give the player a MisticTicket and enable Navel Rock access.
    5. Show message with @afterwards2

    And after that if the player talks to Steven again:

    1. Show message with @afterwards2

    I hope somebody can help me. I'm no pro in scripting yet so I don't know what I'm doing wrong. I'm using PKSV-UI.
     
    5,256
    Posts
    16
    Years
  • Hey,

    I recently made a Steven trainer script. It basically progresses the trainer (Pokemon Fire Red) and after the battle the player needs to obtain a MysticTicket (for Navel Rock).

    There are 2 problems:

    1. When I win I don't get the item straight away. I need to talk to him again and then he'll give. But he'll keep on giving me the ticket which shouldn't be.
    2. When I have the ticket I still can't go to Navel Rock (you need to activate a flag or something, but which flag, IDK).

    Spoiler:


    Basically what needs to happen:

    1. If the player hasn't fought Steven, show message with @intro.
    2. Start the battle with Steven (trainer ID 001)
    3. If the player win, show message with @afterwards
    4. Give the player a MisticTicket and enable Navel Rock access.
    5. Show message with @afterwards2

    And after that if the player talks to Steven again:

    1. Show message with @afterwards2

    I hope somebody can help me. I'm no pro in scripting yet so I don't know what I'm doing wrong. I'm using PKSV-UI.

    Here's what you'd want to do:

    Spoiler:

    I noticed your syntax looks like it is from a different program, so I'm sorry for that. If you don't have XSE 1.1.1, the program whose syntax my fixed script is using, you can download it here. Note that the flag is being set but if you're only using it for this script you can omit it.
     

    JoshTheTrainer

    Glaceon Lover ~
    101
    Posts
    15
    Years
  • Here's what you'd want to do:

    Spoiler:
    I'm sorry if I'm being stupid but won't it start the trainer battle every time you talk with this script?
     
    5,256
    Posts
    16
    Years
  • I'm sorry if I'm being stupid but won't it start the trainer battle every time you talk with this script?

    Nope! The trainerbattle command essentially checks if the trainer flag is cleared or not, and if it is it skips it entirely. You can take a look at how the vanilla trainer scripts are structured too, it works the same way.
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • I've made some decent progress now. ( I feel like a proud kid right now, "I did it all by myself!") Now, I don't have a specific problem but rather a question. Is it possible to set an NPC script to make changes depending on the direction they're facing when spoken to? The idea I have in mind will either require different movements depending on facing, or changing it to a level script instead.
     
    5,256
    Posts
    16
    Years
  • I've made some decent progress now. ( I feel like a proud kid right now, "I did it all by myself!") Now, I don't have a specific problem but rather a question. Is it possible to set an NPC script to make changes depending on the direction they're facing when spoken to? The idea I have in mind will either require different movements depending on facing, or changing it to a level script instead.

    Surely the easier option would be to check which tile the player is stood on and make the relevant changes from that? You'd need to look into the getplayerpos command.
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • Surely the easier option would be to check which tile the player is stood on and make the relevant changes from that? You'd need to look into the getplayerpos command.

    Okay thanks, I might need a little help understanding how to set that up. If it's not too much trouble, can someone provide a simple sample script on using that command?
     
    5,256
    Posts
    16
    Years
  • Okay thanks, I might need a little help understanding how to set that up. If it's not too much trouble, can someone provide a simple sample script on using that command?

    Spoiler:

    It's that simple, really. You'd then just look at where the NPC would face depending on where the player is and script accordingly.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Why it doesnt work?
    Spoiler:

    Someone said that I need to use Cleartrainerflag command and set the Persons ID to the flag I used in cleartrainer flag, the trainer will battle me anytime I also tried using this:
    Spoiler:


    I also had this kind of problem,
    I used:
    Spoiler:

    The screen fades and back to normal, but the person #9 didnt disappeared, it disappeared only when I leave the map. I want when the screen fades, Person 9 completely disappears.
    thanks.
     
    5,256
    Posts
    16
    Years
  • If you wanted to make Trainer 0x3D rematchable every time, you'd cleartrainerflag 0x3D as that is their Trainer ID. I think you're confused between the Person ID, for the event in A-Map, and the Trainer ID, for the Trainer, and their team, itself.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • If you wanted to make Trainer 0x3D rematchable every time, you'd cleartrainerflag 0x3D as that is their Trainer ID. I think you're confused between the Person ID, for the event in A-Map, and the Trainer ID, for the Trainer, and their team, itself.

    ahhh.. how noob I really am,
    another 1,
    this script makes the OW disappears but when the player moves, it appears again, even if I left the OW.
    Spoiler:
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • ahhh.. how noob I really am,
    another 1,
    this script makes the OW disappears but when the player moves, it appears again, even if I left the OW.
    Spoiler:
    Set the overworld you want to disappear's person ID to the flag. In this case that would be 317.
     
    5,256
    Posts
    16
    Years
  • You're using disappear for some reason? Try using hidesprite. Also, flags above 0x2FF, in general, are unsafe, so it's best to stick within the range of 0x200 to 0x2FF.
     
    Status
    Not open for further replies.
    Back
    Top