Record is a box where you put your variables to keep them organized. Helps to understand and manage your code without going insane.
For example, I have dozens of different systems in my map (hero inventory, dynamic spell transfer, player data and so on), and I put variables used in these systems in their corresponding records, so when I work with them I know exactly what I have and where I have it. It also helps to keep variable window less polluted.
Another great use is to create syntax words for use in data tables (if you rely on them).
Say you want to make a new type of variable (java calls them classes). Lets say you want to make a variable called cars.
Cars would have in it:
String Make
String Model
Int 1=suv 2=sedan 3= motarcycle
Real Engine size
Int cylinder
Color Color
and so forth
Now you can make a car variable called SherliaCar and SoulTakerCar and DuckyTheDuckCar without having to copy those global variable into a dizzying mess of arrays or into a String called "make [name here]". you have one variable that holds all the information you need.
For my map i have a variable called map. when i use a constructor it loads the variable with a layout type, all points of entry, all points of exits, the destinations of those exits and on what maps those exits are, along with all the premade units for that map layout. without using records it would be a nightmares of arrays and sorting out which exits belonged to which map and connected to other maps and map names and entry points blah blah
I don't use them. There is/was a problem when you copy paste code that uses records from one map to another. I had to fix all record appearences. Now I won't ever use them. I'm using names to group variables together.
The only benefit I can see is that you can collapse/expand them in the trigger debugger. But other people just love them. So, I expect it's personal preference.
I switched to records a few projects back, it definitely has it's benefits but it's not with out its flaws.
For example, my triggering has been much neater. But it makes it very annoying when I'm really in the zone and I have to spend the extra few seconds clicking to get to the record members. I almost exclusively use the search which paired well with my directive naming, but I keep having to spend the time to click on the right record before typing in the search bar. Which is annoying.
But like I said, it makes things look neater. I wouldn't say it provides any huge benefit unless you have very vague naming. In my ideal world, I'd be able to search all variable members from within the first variable browsing window. So that I would retain both the neat/pretty triggers and time efficiency of having no records.
I'm working on a very, very large map called Starmon (it's like a fully fleshed out pokemon game, so you can imagine what the triggers look like). Suffice to say there's a metric ton of variables involved. By using records, I can easily organize all of the variables into their respective systems. There's a record for battles, one for banks, one for dialogs, one for the world generation, etc.... This means that I can easily find any variable I want by opening the record for it's respective system. They're very easy to expand/collapse in the trigger debugger, and it makes things much, much neater and more organized. The other benefit is that you can reuse variable names. You can't have two global variables called "Main Dialog" for example, but you can have two variables with the same name if they are in different records.
The downside is that, unfortunately, it takes longer to set variables if you use records. Instead of clicking opening the parameter window and choosing your variable, you have to choose your record, press okay, open the window again, and then select the actual variable from inside the record. That's definitely a pain, and will slow you down when working with larger projects. If you don't want to use records, you could accomplish a similar(ish) organization by just using a prefix system. For example, all of your banking variables would be prefixed with "BNK-". So you'd have "BNK-Somename".
In my case, I feel the benefits outweigh the negatives. But it's really up to you to decide if you want to use records.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Thanks allot for all replies, I fully understand it now, in short, it's a folder for variables that adds a invisible prefix infront of all variables it holds. I can se how this can be handy if you have allot of variables with similar names, kinda hate to backtrack in the code to see what the name of the variable i need is, however this could also be solved with prefixes, then again how would it look if all files on my hdd was on one folder? Nhaa would prefer to have it in folders :)
One thing to mention on the topic is that with the new way the trigger editor works; it works much like a library in the local window. So now you can hide variables and action definitions for use in their local folder only. Making records mostly necessary only if you have a lot of variables in one place.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
To post a comment, please login or register a new account.
I don't fully understand what a record is and I can't understand why or how its better then normall variables with arrays. can sombody please tell me.
Record is a box where you put your variables to keep them organized. Helps to understand and manage your code without going insane.
For example, I have dozens of different systems in my map (hero inventory, dynamic spell transfer, player data and so on), and I put variables used in these systems in their corresponding records, so when I work with them I know exactly what I have and where I have it. It also helps to keep variable window less polluted.
Another great use is to create syntax words for use in data tables (if you rely on them).
so its more or less the same thing but its more organized with records when you get many variables?
Say you want to make a new type of variable (java calls them classes). Lets say you want to make a variable called cars.
Cars would have in it:
String Make
String Model
Int 1=suv 2=sedan 3= motarcycle
Real Engine size
Int cylinder
Color Color
and so forth
Now you can make a car variable called SherliaCar and SoulTakerCar and DuckyTheDuckCar without having to copy those global variable into a dizzying mess of arrays or into a String called "make [name here]". you have one variable that holds all the information you need.
For my map i have a variable called map. when i use a constructor it loads the variable with a layout type, all points of entry, all points of exits, the destinations of those exits and on what maps those exits are, along with all the premade units for that map layout. without using records it would be a nightmares of arrays and sorting out which exits belonged to which map and connected to other maps and map names and entry points blah blah
I don't use them. There is/was a problem when you copy paste code that uses records from one map to another. I had to fix all record appearences. Now I won't ever use them. I'm using names to group variables together.
The only benefit I can see is that you can collapse/expand them in the trigger debugger. But other people just love them. So, I expect it's personal preference.
@Ahli634: Go
Your posts kill me inside
I switched to records a few projects back, it definitely has it's benefits but it's not with out its flaws.
For example, my triggering has been much neater. But it makes it very annoying when I'm really in the zone and I have to spend the extra few seconds clicking to get to the record members. I almost exclusively use the search which paired well with my directive naming, but I keep having to spend the time to click on the right record before typing in the search bar. Which is annoying.
But like I said, it makes things look neater. I wouldn't say it provides any huge benefit unless you have very vague naming. In my ideal world, I'd be able to search all variable members from within the first variable browsing window. So that I would retain both the neat/pretty triggers and time efficiency of having no records.
?? I don't see anything illogical in his post ??
As others have stated, there's pros and cons.
I'm working on a very, very large map called Starmon (it's like a fully fleshed out pokemon game, so you can imagine what the triggers look like). Suffice to say there's a metric ton of variables involved. By using records, I can easily organize all of the variables into their respective systems. There's a record for battles, one for banks, one for dialogs, one for the world generation, etc.... This means that I can easily find any variable I want by opening the record for it's respective system. They're very easy to expand/collapse in the trigger debugger, and it makes things much, much neater and more organized. The other benefit is that you can reuse variable names. You can't have two global variables called "Main Dialog" for example, but you can have two variables with the same name if they are in different records.
The downside is that, unfortunately, it takes longer to set variables if you use records. Instead of clicking opening the parameter window and choosing your variable, you have to choose your record, press okay, open the window again, and then select the actual variable from inside the record. That's definitely a pain, and will slow you down when working with larger projects. If you don't want to use records, you could accomplish a similar(ish) organization by just using a prefix system. For example, all of your banking variables would be prefixed with "BNK-". So you'd have "BNK-Somename".
In my case, I feel the benefits outweigh the negatives. But it's really up to you to decide if you want to use records.
Thanks allot for all replies, I fully understand it now, in short, it's a folder for variables that adds a invisible prefix infront of all variables it holds. I can se how this can be handy if you have allot of variables with similar names, kinda hate to backtrack in the code to see what the name of the variable i need is, however this could also be solved with prefixes, then again how would it look if all files on my hdd was on one folder? Nhaa would prefer to have it in folders :)
Have to start using it on larger maps.
One thing to mention on the topic is that with the new way the trigger editor works; it works much like a library in the local window. So now you can hide variables and action definitions for use in their local folder only. Making records mostly necessary only if you have a lot of variables in one place.