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

[Script✓] I want to know if this is safe

rubenturen

Also Known as: Canned Brain
51
Posts
5
Years
  • (Info:I'm using emerald)
    I think I found a way to save vars so I want to know if it's safe.

    Ok, it goes like this you create a script like this:

    #dynamic 0x800000
    #org @start
    Checkflag 0x(flag)
    If 0x0 goto @flagisnotactive
    End

    #org @flagisnotactive
    Lock
    Setflag 0x(flag)
    (Make your script here)
    Release
    End

    And then you use one var for all level/event scripts
    That uses vars.

    So what I think will happen:
    the var is allways active,
    So normally the script would play again and again,
    But because of the flag that activates the first Time the script runs,
    It Will do so that it will not play again.

    Pls tell if this is possible and what side effects it will make.
    Thx.
     
    Last edited:

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Its is certainly usable in the sense that that you wouldn't need to use any variables and the scripts will run correctly if you step on a green script tile, but I don't believe that the trade off is worth it.

    You will have two bugs that will occur if you only use checkflags. Firstly, the player will lose all of their momentum when they step on the script tile, even if you've already set the flag. This is most easily seen when you ride over the tile on a bike. Secondly, if you step on the tile shortly after entering a map, the map name in the top left corner will suddenly disappear, rather than being shown for the correct amount of time.

    If you're looking to save variables, you can merge a number of scripts to run off a single variable. For example, You put script A in the starting town, script B on Route 1 and script C in the second town. You've set the scripts up so that Its impossible for the player to avoid any of the script, making them activate in the succession of A > B > C. When you activate script A, you set the variable to 0x1 so that it won't run again. You then set up script B so that it only activates when the variable is equal to 0x1 and then change the variable to 0x2 when the player activates the script. You do the same with script C, making activate when the variable is equal to 0x2 and then change it to 0x3 during the script. You can continue this chain for as long as you like, so long as the scripts will be activated in a linear fashion. Now you're only using one variable, rather than using three flags, its neater and has no bugs attached.

    While variables can be intimidating when you're just starting out (especially when compared to the simplicity of flags) they certainly aren't enemies.
     

    rubenturen

    Also Known as: Canned Brain
    51
    Posts
    5
    Years
  • Its is certainly usable in the sense that that you wouldn't need to use any variables and the scripts will run correctly if you step on a green script tile, but I don't believe that the trade off is worth it.

    You will have two bugs that will occur if you only use checkflags. Firstly, the player will lose all of their momentum when they step on the script tile, even if you've already set the flag. This is most easily seen when you ride over the tile on a bike. Secondly, if you step on the tile shortly after entering a map, the map name in the top left corner will suddenly disappear, rather than being shown for the correct amount of time.

    If you're looking to save variables, you can merge a number of scripts to run off a single variable. For example, You put script A in the starting town, script B on Route 1 and script C in the second town. You've set the scripts up so that Its impossible for the player to avoid any of the script, making them activate in the succession of A > B > C. When you activate script A, you set the variable to 0x1 so that it won't run again. You then set up script B so that it only activates when the variable is equal to 0x1 and then change the variable to 0x2 when the player activates the script. You do the same with script C, making activate when the variable is equal to 0x2 and then change it to 0x3 during the script. You can continue this chain for as long as you like, so long as the scripts will be activated in a linear fashion. Now you're only using one variable, rather than using three flags, its neater and has no bugs attached.

    While variables can be intimidating when you're just starting out (especially when compared to the simplicity of flags) they certainly aren't enemies.

    Thank you.
    When I read the beginning I thought there was no way.
    But I'm thankful that there was.
     

    rubenturen

    Also Known as: Canned Brain
    51
    Posts
    5
    Years
  • Its is certainly usable in the sense that that you wouldn't need to use any variables and the scripts will run correctly if you step on a green script tile, but I don't believe that the trade off is worth it.

    You will have two bugs that will occur if you only use checkflags. Firstly, the player will lose all of their momentum when they step on the script tile, even if you've already set the flag. This is most easily seen when you ride over the tile on a bike. Secondly, if you step on the tile shortly after entering a map, the map name in the top left corner will suddenly disappear, rather than being shown for the correct amount of time.

    If you're looking to save variables, you can merge a number of scripts to run off a single variable. For example, You put script A in the starting town, script B on Route 1 and script C in the second town. You've set the scripts up so that Its impossible for the player to avoid any of the script, making them activate in the succession of A > B > C. When you activate script A, you set the variable to 0x1 so that it won't run again. You then set up script B so that it only activates when the variable is equal to 0x1 and then change the variable to 0x2 when the player activates the script. You do the same with script C, making activate when the variable is equal to 0x2 and then change it to 0x3 during the script. You can continue this chain for as long as you like, so long as the scripts will be activated in a linear fashion. Now you're only using one variable, rather than using three flags, its neater and has no bugs attached.

    While variables can be intimidating when you're just starting out (especially when compared to the simplicity of flags) they certainly aren't enemies.

    Oh I also want to know about some useable vars who will not corrupt my game.
    For emerald
     
    Last edited:
    Back
    Top