• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Other] Flags or Variables?

Which one do you use more?


  • Total voters
    29

NiKaNoRoU

we are but particles
  • 658
    Posts
    15
    Years
    Hello all, I've started to learn scripting recently, as it will fill a huge gap in my potential and let me start considering myself a 'hacker'. I've been reading HackMew's guide, the one attached to XSE (which is pretty nice, and I wonder why there are several tutorials out there, since that guide covers up several contents better than them), and so far I've reached the variable stage (not very advanced, and a slow reader, am I...), and that last part made me wonder: would variables be better in scripts than flags?

    Let's leave out all the flags that are necessarily used (gym badges, etc), and have unused flags as well as unused variables in a debate.

    Now, flags are more like a yes/no texbox, not shown of course, afaik.
    Variables, on the other hand, have more functions that allow them to be more like an invisible multibox, but seem more complicated as well, mostly for a script that has only two options.

    this debate now is about, which one do you use more? [provided there is a fixed amount of scripts]

    Mm, I guess I still need to learn a few things before I state my personal opinion. But I guess more advanced people can state their own, since I'm so curious as to whether flags or variables are more useful in a script.

    Cheers.
     
    Well, I would usually use flags but if the scripts are linked to each other in a way, I would usually use variables.
     
    Well, I would usually use flags but if the scripts are linked to each other in a way, I would usually use variables.

    In a nutshell, yeah.

    I normally use variables if I need to do more than one thing with it, but if it's only one thing I need to do with it, I'll use flags, "it" being whatever I'm setting the variable or flag for.
     
    Out of habit I use flags- because I've always been using them :P
     
    You can't really compare the two because they're used for different things. Flags are boolean data types and thus can only be set to true or false while Variables are halfwords and can store numbers up to 65,535. So the two aren't interchangeable at all. You could use variables in the place of flags but, as I see it, it would be pointless and wasteful.
     
    You can't really compare the two because they're used for different things. Flags are boolean data types and thus can only be set to true or false while Variables are halfwords and can store numbers up to 65,535. So the two aren't interchangeable at all. You could use variables in the place of flags but, as I see it, it would be pointless and wasteful.
    But it's still doable, and thus makes them competitive. Be it pointless and wasteful.
     
    Because of level scripting a lot, I've gotten into the habit of using variables more often than flags.
     
    I like maths, and Itend to use Variables MUCH more often then flags. I end up comparing tons of things for scripts...
    Heck, features in my hack that I would be making if it werent for my PC use variables to function properly...
     
    It really depends on the script. If it is a really complicated script or is related to a lot of other scripts, then variables are better. Flags are usable in simpler scripts.

    Also, there are a lot more variables and they can do more things. But flags are necessary to have things disappear. It depends on the situation.
     
    Back
    Top