• 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.

Sierra's MEGA-HUGE XSE Scripting Tutorial

3
Posts
5
Years
  • DIEGOISAWESOME. PLZ!!!. I have played pokémon crystaldust and I LOVED it. But the things you changed like opeing and the color when the pokémon word shines. PLEASE! make tutorials of them. EVEN IF THIS IS THE FUTURE. PLZ!
    !!!!
    !!!!
    !!!!
    PLEASE!!!!!!!!!!!
    PLEASE!!!!!!!
    I BEG YOU!
    PLZ!! :(
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • Having some problems moving the camera with a script tile. I'm setting unknown to 3 and my script doesn't crash. It simply doesn't move the camera. Even using a waitmovement 0x7F after my applymovement call.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Having some problems moving the camera with a script tile. I'm setting unknown to 3 and my script doesn't crash. It simply doesn't move the camera. Even using a waitmovement 0x7F after my applymovement call.

    Are you able to post your script so other members can analyse it and find out what's wrong?

    Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • Are you able to post your script so other members can analyse it and find out what's wrong?

    Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.

    Special 0x113 and 0x114 were the problem, I hadn't heard about them. Thanks :)

    Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.
     
    Last edited by a moderator:

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.
    try with the npc id 0xFE (or 0xFF? i can't remember)
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

    Spoiler:


    there is the body if anyone wants to check it out...
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.

    There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.

    The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

    there is the body if anyone wants to check it out...

    I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

    Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

    Spoiler:
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.



    I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

    Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

    Spoiler:

    Thanks for all the help! I've deduced that its the trainerbattle 0x1 cmd that's causing the movement... I assume that it has a faceplayer call... I figured this out by trying to turn the sprite, just to have her turn back when the @before msgbox appears for the trainerbattle.
     
    62
    Posts
    5
    Years
  • Is there a way to compare a variable based on whether it is higher or lower than a certain number?

    For example..

    if 0x4011 > 20 event happens
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Is there a way to compare a variable based on whether it is higher or lower than a certain number?

    For example..

    if 0x4011 > 20 event happens

    You can use the 'compare' command to do that easily. Here's what your example would look like with it:

    Code:
    compare 0x4011 0x14
    if 0x2 goto @EventHappens

    The first line is pretty simple, you just write the variable you want to use and then the value that you want to compare it to. The second line is tricky if you don't know what XSE's 'if values' mean. Here's a table that diegoisawesome has on the first page:

    Code:
    Lower Than (0x0)
    Equals (0x1)
    Greater Than (0x2)
    Lower than or Equal to (0x3)
    Greater than or Equal to (0x4)
    Not exactly equal to (0x5)

    Since I'm using 'if 0x2', the script will only move onto @EventHappens if 0x4011 is greater than 20 (0x14). Hopefully that all makes sense.
     
    62
    Posts
    5
    Years
  • Hi, I'm trying to execute a code that allows me to evolve a certain pokemon in my party (I'm actually form changing it, but I have inserted a routine to skip the evolution sequence. The issue I'm having is forcing the game to specifically ONLY evolve the particular pokemon.

    So far I have this code: (note that my issue isn't with the routine, but rather with making the game understand that I picked A certain pokemon and any other pokemon will not be allowed to evolve)
    Spoiler:


    So, yeah.. Basically I need the game to check if I have the pokemon, find which slot that pokemon is in and execute that ASM to evolve it... Does anyone have any information? It would be greatly appreciated. BTW I got the ASM from here if that helps..

    https://www.pokecommunity.com/showpost.php?p=8513813&postcount=39
     
    Last edited:
    15
    Posts
    4
    Years
    • Seen Jun 16, 2019
    I have a question. If I use special 0x9f to select a pokemon. How would I execute a script to basically say if the chosen pokemon is (let's say pikachu) perform this script. If it's not pikachu perform this script. Basically I'm wondering if special 0x9f stores the index pokemon of the pokemon u chose and if I can use a compare to set up 2 scenarios. I'm wondering which var it would load the index number to
     
    15
    Posts
    4
    Years
    • Seen Jun 16, 2019
    Or better yet is there a way to script an event so that a certain pokemon MUST be the 1st pokemon in your party to proceed ? Like basically I want to put a pokemon at the front of your party and have a guy stop you unless that pokemon is the first one in your party. It's really important that it's the first one in your slot.
     
    2
    Posts
    4
    Years
    • Seen Nov 7, 2019
    Is there a way to prevent you from stepping on a tile unless you have at least one Pokémon? It's supposed to be like when Professor Oak stops you from going on route 1 in Fire Red/Leaf Green.
     
    1,309
    Posts
    12
    Years
    • She/Her
    • Seen Nov 24, 2023
    Is there a way to prevent you from stepping on a tile unless you have at least one Pokémon? It's supposed to be like when Professor Oak stops you from going on route 1 in Fire Red/Leaf Green.

    You could use a level script triggered in the overworld for that (the green "S" tiles). Diego's covered how these work in this tutorial already, alternatively there's this post. You could use that in combination with a flag check for if the Pokemon menu has been activated (flag 0x828 for FR, 0x860 for EM) or the countpokemon command. Hope that helps!
     
    2
    Posts
    4
    Years
    • Seen Nov 7, 2019
    Thanks for your response! Your post helped me understand variables better, but I just ended up using flags like you suggested since the variables seemed to reset once I left the map and came back.
     
    7
    Posts
    4
    Years
    • Seen Oct 3, 2019
    Very handy tutorial! I'm just getting started with scripting, and I'm sure I will be jumping back for keywords and values often!
     
    Back
    Top