| 12-03-2003, 03:59 PM | #1 |
Proper Commenting Techniques are important for map design, everyone knows (Or should know) this. What are some of the ways that people help make their Triggers/Jass more Readable? For me: I always make sure the Trigger Comment Field is used, especially on big projects. You never know when you may need to go back to even a simple trigger later on. Second: Organize your Triggers into Categories that keep all of a type in an area. Cinematics, Boss Battles, Spawners, whatever. That way you can find a trigger you need to modify quickly. Third: Mneumonic Variable names, with Alphabetic ordering. If you use a lot of Variables in a map, try making the first letter of each Variable the same as the first letter of the Variable TYPE. This way, you can look through all of your INTEGERS by looking at the "I" entry in your Variable list. Follow the I by an A if it's an array, add an Underscore, and then the Variable Name. This willl keep your variables orderly, and easy to manage. Fourth: Use Variables! If you have a number that is used a lot in a map, and you may decide to change it later, set it to a Variable. For instance, if you are making a 'Warz' Map, and want an effect to occur after 30 Kills, set 30 to a Variable (Name = 'I_KILL') and use that instead. Then if you later decide you want to make it 25 kills instead of 30, you don't have to change each and every instance of the Number.. you just change it in the Variables area. Fifth: One thing I've been doing lately that increases the readibility of Functions is using: If Condition - True = True Actions - ... If blocks can be collapsed. If you have a lot of actions in a trigger that are repetitive (Like creating/destroying floating texts, and setting them to variables) throw them all into a If block to make the Trigger easier to understand at a glance. Preceed this IF by a Comment like: ---If = Reset the Floating Texts --- Last: Proper Comments in General! Make notes of all the things you do, ESPECIALLY the silly little variables settings that aren't necessarily obvious. Coming back 3 weeks later, and trying to remember why: IA_KillList {0} = 12 Could be a hassle. |
