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

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
    • Seen Apr 9, 2021
    Hello (yes I'm back again). The script in my above post is activated like it should, but there are two problems. 1. the sprite I want to move does not move and 2. If I exit out of the map then re-enter the script engages again (I only want the script to happen once and then done). What did I do wrong?

    Make sure the person number in the script is the event number in A-Map. The numbers are in decimal in A-Map but hex in the script (so if it says 10 it's actually A).

    You forgot setvar 0x(whatever variable you put in A-Map) otherwise it will always happen like in your case.
     
    Last edited:
    67
    Posts
    9
    Years
  • You forgot setvar 0x(whatever variable you put in A-Map) otherwise it will always happen like in your case.

    Oh whoops forgot about that thx!

    The applymovement should be 0xA, not 0x10. When you're using XSE you use hexadecimal.

    Ok. I thought I knew hexadecimal but apparently I don't. Is there a tutorial I can learn them?

    Why are you using flag 0x7?

    It was a flag that wasn't used......... Is there a reason why I shouldn't use it?

    You also seem to be clearing the flag whenever you walk over the script again, which will simply reactivate it.

    So I just need to get rid of clearflag and that will solve my reactivate problem, right?
     

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • Oh whoops forgot about that thx!



    Ok. I thought I knew hexadecimal but apparently I don't. Is there a tutorial I can learn them?



    It was a flag that wasn't used......... Is there a reason why I shouldn't use it?



    So I just need to get rid of clearflag and that will solve my reactivate problem, right?

    1: Hex lesson:
    Spoiler:


    1.5: In XSE you can remove the 0x before an integer to make it compile in decimal.

    2: Flag 7 is a game engine flag. It is used for various things, so messing with it is just no bueno. https://www.pokecommunity.com/showthread.php?t=302347
     

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • In FireRed, you can use flag 200 - 2FF.

    You can use those only if you remove the events that they use from vanilla. You can also expand to new flags if you use Jambo's hacks for flags and vars. Although 256 flags is a lot for a standard gen 3 hack, if you want to go overboard then get more.
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    1: Hex lesson:
    Spoiler:

    They're the most common numbers, just type in the decimal number into windows calculator then click hex and it will convert it for you.
     
    Last edited:
    16
    Posts
    9
    Years
    • Seen Jun 28, 2016
    I created a wild encounter script for fire red on PKSVUI, and it works perfectly, except when i catch the Pokemon, it doesn't disappear, but when i run away, it does. Here's the script.
    Spoiler:


    Can anyone fix this? Thanks!
     

    Sniper

    ふゆかい
    1,412
    Posts
    10
    Years
  • I created a wild encounter script for fire red on PKSVUI, and it works perfectly, except when i catch the Pokemon, it doesn't disappear, but when i run away, it does. Here's the script.
    Spoiler:


    Can anyone fix this? Thanks!

    PKSV UI.. I don't script using that so I can't really fix it but I recommend using XSE it's better and easy. Also we have a better tutorial here and it's very easy to understand. Scripting wild encounter with xse it's easier
     
    16
    Posts
    9
    Years
    • Seen Jun 28, 2016
    PKSV UI.. I don't script using that so I can't really fix it but I recommend using XSE it's better and easy. Also we have a better tutorial here and it's very easy to understand. Scripting wild encounter with xse it's easier

    I opened my script with XSE. So can you tell me what i did wrong?
    Spoiler:

    Thanks!
     

    leyn09

    Truant Trainer
    84
    Posts
    13
    Years
  • Hello (yes I'm back again). The script in my above post is activated like it should, but there are two problems. 1. the sprite I want to move does not move and 2. If I exit out of the map then re-enter the script engages again (I only want the script to happen once and then done). What did I do wrong?

    Spoiler:

    You lack some details but let me share my assumptions:

    1. I think flag 0x7 is not safe to use? not sure though. Try using 200-2FF (with exception of 266 tho? i think it is used in egg script?)

    2. And the 0x10, is that your tenth sprite in your map? it should be 0xA. That's why I told you lack some details. hehe. And make sure you put a flag for the spriting your hiding for. no need to set a flag in a script to hide it as it automatically sets the flag when hidden.
     

    Alexander Nicholi

    what do you know about computing?
    5,500
    Posts
    14
    Years
  • That information is largely considered bad practise, from what I understand. The Var number should correlate to a variable that, when set, disables the tile script. The Unknown will happily sit at 0000.
    The unknown word in the screenshot is for the height of the script. It's good form to set your heights appropriately for all your events, and as for the variable... well, some variable has to be set. 0x4050 works fine for custom hacks on all bases provided you don't ignorantly use it somewhere, but at least in Ruby and Emerald 0x4050 is occupied by scripts in Littleroot (if you wanted to keep Hoenn in tact, for instance). I think you're a bit off on it being "bad practice," heh :P
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    The unknown word in the screenshot is for the height of the script. It's good form to set your heights appropriately for all your events, and as for the variable... well, some variable has to be set. 0x4050 works fine for custom hacks on all bases provided you don't ignorantly use it somewhere, but at least in Ruby and Emerald 0x4050 is occupied by scripts in Littleroot (if you wanted to keep Hoenn in tact, for instance). I think you're a bit off on it being "bad practice," heh :P


    It's bad practice as it's not the information you should be putting on every script tile, and people thinking that a magical unknown value fixes things when it doesn't. Height zero is fine, at least one [C] tiles, which are the vast majority.
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    I opened my script with XSE. So can you tell me what i did wrong?
    Spoiler:

    Thanks!

    For a generic wild battle, your script seems quite long. I would do it like this:

    Spoiler:


    Make sure you set the person ID to 1BB. I don't know why you setflag 0x8C1 then cleared it, it doesn't make sense.

    Hope that helps!
     

    Alexander Nicholi

    what do you know about computing?
    5,500
    Posts
    14
    Years
  • It's bad practice as it's not the information you should be putting on every script tile, and people thinking that a magical unknown value fixes things when it doesn't. Height zero is fine, at least one [C] tiles, which are the vast majority.
    Yeah, I don't know about that. Misconceptions don't invalidate the purpose of the values.

    Anyway, as for the question... I think it's really important to remember that the PokéScript engine will only freeze you on the spot under certain commands, and that if you have that variable set up for a script that doesn't need it it may black out, or not work. It's easy to figure out what scripts will need it and what won't (overworld interactions, text boxes, etc will - a checkflag/setflag script won't), so just be careful and always debug your scripts in the game.
     
    14
    Posts
    9
    Years
    • Seen Jun 13, 2016
    Spoiler:


    what is the problem of my script?
     
    15
    Posts
    9
    Years
    • Seen Nov 1, 2017
    Hey guys,

    I'm new here but anyways, I'm trying to script an encounter with a legendary pokemon on the overworld (I'm a noob at scripting) for a Fire Red hack I'm working on (using PKSV) and the battle seems to be working fine but after catching/defeating the pokemon the sprite doesn't disappear from the over world, and I was wondering if someone could help me out?

    Here's the script after I've loaded it in Advance Map

    Spoiler:


    Any help would be much appreciated, thanks heaps! P.S. -Sorry the script seems all jumbled up, it got that way after I applied it to an event in advance map, not really sure if it's meant to be like that or not :S
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    Spoiler:

    what is the problem of my script?

    I'm not really sure about the copy var because I don't use it but assuming that part is correct and you are using XSE try this:

    Spoiler:


    This better?

    Edit: I've left out the dynamic for clarity but you should keep that in btw.
     

    C me

    Creator of Pokemon League Of Legends
    681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    Hey guys,

    I'm new here but anyways, I'm trying to script an encounter with a legendary pokemon on the overworld (I'm a noob at scripting) for a Fire Red hack I'm working on (using PKSV) and the battle seems to be working fine but after catching/defeating the pokemon the sprite doesn't disappear from the over world, and I was wondering if someone could help me out?

    Set the person ID in Amap to 1FE and it will disappear.
     
    Status
    Not open for further replies.
    Back
    Top