• 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.
19
Posts
8
Years
  • My script works, but when the npc moves the float instead of walking, here is my script.

    Spoiler:
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    I am sorry but I didn't understand what u said.Can u give a bit more information

    I'm not destinedjagold but I can explain.
    All movement commands have to have a #raw 0xFE at the end of each section as it signals to the game that all the movements have completed and to return to the script. Your second movement section was missing that #raw 0xFE and would never continue the script.
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    I am sorry but I didn't understand what u said.Can u give a bit more information

    See the spoiler in my previous comment.

    My script works, but when the npc moves the float instead of walking, here is my script.

    Spoiler:

    The NPC OverWorld sprite doesn't have walking sprites. Check an OW Editor like NSE.
     

    Tapan681

    RiverDream
    66
    Posts
    8
    Years
  • I'm not destinedjagold but I can explain.
    All movement commands have to have a #raw 0xFE at the end of each section as it signals to the game that all the movements have completed and to return to the script. Your second movement section was missing that #raw 0xFE and would never continue the script.

    oh yeah...so stupid of me
     
    19
    Posts
    8
    Years
  • See the spoiler in my previous comment.



    The NPC OverWorld sprite doesn't have walking sprites. Check an OW Editor like NSE.

    NSE Doesn't work on my Computer any other suggestions? Also while I'm at it, any ideas for an Advance Text alternative? I keep getting the error comdlg32 is missing or something...
     
    17
    Posts
    8
    Years
    • Seen Jul 23, 2022
    So I'm working on a script in XSE where an NPC speaks to the player from afar, the player walks towards them and faces them, and the NPC faces the player and continues talking...

    Spoiler:


    And here are the movements:

    Spoiler:


    I highlighted the "faceplayer" in red because that's where the script fails. After the player completes the movements in @mov2, nothing happens. I'm wondering why this is happening. Instead of using the faceplayer command, I tried using another movement that told the NPC to face left, but the same thing happened. Anybody know what's wrong?
     

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • So I'm working on a script in XSE where an NPC speaks to the player from afar, the player walks towards them and faces them, and the NPC faces the player and continues talking...

    Spoiler:


    And here are the movements:

    Spoiler:


    I highlighted the "faceplayer" in red because that's where the script fails. After the player completes the movements in @mov2, nothing happens. I'm wondering why this is happening. Instead of using the faceplayer command, I tried using another movement that told the NPC to face left, but the same thing happened. Anybody know what's wrong?

    You need "waitmovement", not "waitstate". waitstate is used for things that pause scripts completely like specials and the like. applymovement doesn't pause scripts. It just runs with scripts. So essentially everything after that applymovement is running in an order instead of waiting for the player.
     
    17
    Posts
    8
    Years
    • Seen Jul 23, 2022
    You need "waitmovement", not "waitstate". waitstate is used for things that pause scripts completely like specials and the like. applymovement doesn't pause scripts. It just runs with scripts. So essentially everything after that applymovement is running in an order instead of waiting for the player.

    Gah, obvious mistake. Thanks for your help! It's working perfectly now.
     

    PankajBlitz

    Taiyoh!
    216
    Posts
    8
    Years
  • The Sprite is not hiding anyways heres the code
    Spoiler:
     

    0

    Happy and at peace. :)
    556
    Posts
    8
    Years
  • To PankajBlitz:

    Show sprite and hide sprite are only somewhat useful for making a sprite immediately disappear. However, you need to set a flag to make it permanent. When your flag is set to 1, the person will not appear anymore. To do this, you need to add something like setflag 0x920 to the end of your script, before you release the player. Then, in advance map, you need to add the flag number to the person ID. Attached is said picture. Once you do so, the person will never appear again until the flag is cleared. How this helped, have a great day.

    Revised code with my example:

    Spoiler:
     

    Attachments

    • Script Help Thread
      flag.png
      5.1 KB · Views: 8
    Last edited:
    17
    Posts
    8
    Years
    • Seen Jul 23, 2022
    So here's the deal... I'm trying to make a script that makes the player fight wild battles until they catch a pokemon. The player starts with a single pokemon and after a wild battle, the script checks if they have two pokemon in the party, and if not it starts another wild battle. Try to follow along with this script if you can:

    Spoiler:


    (never mind the weird pokemon names, those are my fakemon that haven't been implemented yet)

    I highlighted the problem area in red. When I get to that part of the code in the game, the script ends without doing any wild battle. Any idea what's wrong? Am I using "goto" and "return" properly?

    If it helps, something I found weird was that in diego's XSE tutorial, it says that "wildbattle" only requires three arguments, the pokemon number, level, and held item. However, when I used wildbattle like that, XSE gave me an error, and it would only compile if I added the extra 0x0. I find that pretty strange
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    So here's the deal... I'm trying to make a script that makes the player fight wild battles until they catch a pokemon. The player starts with a single pokemon and after a wild battle, the script checks if they have two pokemon in the party, and if not it starts another wild battle. Try to follow along with this script if you can:

    Spoiler:


    (never mind the weird pokemon names, those are my fakemon that haven't been implemented yet)

    I highlighted the problem area in red. When I get to that part of the code in the game, the script ends without doing any wild battle. Any idea what's wrong? Am I using "goto" and "return" properly?

    If it helps, something I found weird was that in diego's XSE tutorial, it says that "wildbattle" only requires three arguments, the pokemon number, level, and held item. However, when I used wildbattle like that, XSE gave me an error, and it would only compile if I added the extra 0x0. I find that pretty strange

    Goto sends the script processing to the new location without remembering where it came from. What you need is a call. That's what works with return.
     
    17
    Posts
    8
    Years
    • Seen Jul 23, 2022
    Goto sends the script processing to the new location without remembering where it came from. What you need is a call. That's what works with return.

    I tried this, and now my script isn't stopping at that point, which is good. However, I'm still having other problems. Here is my revised code:

    Spoiler:


    In addition to replacing "goto" with "call", I made a new part of the code to make sure the player has enough pokeballs, which I highlighted in blue. Now I have two problems:

    - When I get to the wildbattle section of the code, it just skips it completely.
    - After skipping the wild battle, the script replenishes my pokeballs, even though I have 10 of them in my inventory. It should only replenish when I have less than 5.

    I checked other scripts already in the game, such as the regirock and kyogre battles, and they have "startwildbattle" instead of "wildbattle", so I tried that instead, but it's still not working. It could be a problem with my random thing? Also why is the pokeball code running when it shouldn't be?
     

    0

    Happy and at peace. :)
    556
    Posts
    8
    Years
  • For Gelatino:
    I spent a bit working on the script. A few changes I've made:
    1. I used 1 call function, through testing i learned you can only use one at a time AFAIK.
    2. I changed the message boxes to have 0x6 at the end, instead of callstd. I did it to make it a bit neater, so change it back if need be.
    3. This script will continue until the player has two Pokemon.
    4. The script is ordered a bit different. I added dynamic offset for completion of script, remove that as necessary.
    5. I have actually tested this and it works.
    6. Again it'll look different, but I have left notes explaining what each thing does.

    Problems:
    None, Vendily posted the solution, and I have updated the script for you.

    Thanks for reading, and good luck in your endeavors.

    EDIT: By the way, after repeated testing, I've noticed that if you wanted to keep the person locked, you would have to enter a lockall after each message, and a faceplayer after the wildbattle. I've put the faceplayer after the battles for you.

    Script:
    Spoiler:


    Side note:
    I actually thought it was quite funny you posted this, because a few days ago I made a wild shiny Pokemon script that gives the Pokemon in the area a chance to be shiny. It works fairly well, and can only be detected by ROM hackers.
     
    Last edited:
    1,682
    Posts
    8
    Years
    • Seen yesterday
    For Gelatino:
    I spent a bit working on the script. A few changes I've made:
    1. I used 1 call function, through testing i learned you can only use one at a time AFAIK.
    2. I changed the message boxes to have 0x6 at the end, instead of callstd. I did it to make it a bit neater, so change it back if need be.
    3. This script will continue until the player has two Pokemon.
    4. The script is ordered a bit different. I added dynamic offset for completion of script, remove that as necessary.
    5. I have actually tested this and it works.
    6. Again it'll look different, but I have left notes explaining what each thing does.

    Problems:
    The one problem that exists with the script is the fact that I can't get the balls to work properly, the same issue as you. I've tried different ways, but none see to have worked.

    Thanks for reading, and good luck in your endeavors.

    Script:
    Spoiler:


    Side note:
    I actually thought it was quite funny you posted this, because a few days ago I made a wild shiny Pokemon script that gives the Pokemon in the area a chance to be shiny. It works fairly well, and can only be detected by ROM hackers.


    I just want to add that your compare is off.
    Code:
    checkitem 0x4 0x5 'check pokeballs
    compare 0x800D 0x1 'check that we do have 5.
    if 0x3 call @balls 'suppose to read "If the player has less then or equal to 5 balls, give him 5 balls."

    The checkitem command returns 0x1 if the player has enough, and 0x0 if the player has less than the quantity.
    So your if/call isn't "If the player has less then or equal to 5 balls, give him 5 balls.", it's now checking if var 0x800D is less than or equal to 0x1, which it always will be. Try, if 0x0 call @balls, which reads "if var 0x800D is less than 0x1, give 5 balls."
     

    Hajima

    Manga Artist 101
    111
    Posts
    7
    Years
    • Seen Nov 4, 2016
    How do I make those Text Boxes\Msg Boxes that dosen't have an npc? Like a pop-up message or narration.
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    How do I make those Text Boxes\Msg Boxes that dosen't have an npc? Like a pop-up message or narration.

    Not sure what you mean? A message box can be triggered by any script, not just a person event. You could use a script tile or a level script to activate one, for instance.
     

    Desert Stream~

    Holy Kipper!
    3,269
    Posts
    8
    Years
    • She/Her
    • Seen Aug 20, 2023
    I'm trying to make it so you can choose a pokemon without prof. oak's event, and you can still only choose 1.
     

    0

    Happy and at peace. :)
    556
    Posts
    8
    Years
  • No offense, but why not try to analyze and attempt the script before posting asking simply for a script. Try it first and people will be more willing to help you.
     
    Status
    Not open for further replies.
    Back
    Top