Thread: [Tutorial] Flags, Vars, & Script Tiles
View Single Post
Old November 8th, 2013 (11:34 PM).
mf91 mf91 is offline
    Join Date: Sep 2013
    Posts: 30
    Originally Posted by karatekid552 View Post
    A var always starts at 0x0000. If you have ever programmed, you have used vars. If you have ever done algebra, you have used vars. Vars are variables. They can be anything. In high-level programming, they have names like "place_to_store_stuff" and you can set it to whatever you want. In math, it is almost always X.

    Now, a variable is a memory location that you use to store data in. Here, these are two byte data locations accessed by their number, which in this case is 0x4050. So, by doing setvar 0x4050 0x1, you are storing 01 at the location of var 0x4050 for later access. Think of the var number like a book cover on an encyclopedia. Most of the time with encyclopedia volumes, all there is, is a name and a number on the cover. inside is what counts. So here, setvar 0x4050 0x1, is essentially changing the pages of that book.

    Thanks for reply :)

    I have had some basic Java and C++, so I know what a variable is.. Very basic tough! But yeah, I think I get it now! Just to be 100% sure, you could say setvar 0x4050 0x1 would be int 4050 = 1 basically? And everything from 0x0000 to 0xFFFF are variables the game can use?

    I guess what made me a bit confused is the random use of 1 and 4 numbers as the value, which probably is very common in languages I havent used yet. What is the value set to; 0x0001 or 0x1000?
    Reply With Quote