Thread: Script Help!
View Single Post
  #6  
Old 01-12-2012, 07:50 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

If I may interject some simple additions, I have some Basic experience from programming data loggers, but relatively new user to C# scripting myself however some rules apply to all programming all scripters should consider always to keep track of things.

Number 1
Document.

You should always date the lastest mods(keen programmers will even document mod changes in separate txt file)

For this sort of stuff, probably not essential, but do put a "Last Mod date" at the top of your script, maybe with any specific operational notes
ie
//Last update 12/01/2012

If you work with 2 or 3 others and pass the mis set about it is easy to get versions mixed up, a last mod date will help keep this error low.

Documentation of what the programe does helps, and helps development aswell.

2nd major consideration is repeat programming.
It can be far more effective to lower syntax errors by using commonly used components once and pull that item into code elsewhere by it's name.

For example the file path for missions.
if you do this at the start of the script,

string MissionPath = "missions/channelv6/BM1/";

When you call missions you only have to add the mis name
from this
GamePlay.gpPostMissionLoad("missions/channelv6/BM1/Practice2.mis");

to this
GamePlay.gpPostMissionLoad(MissionPath + "Practice2.mis");

The advantage is 2 fold, one, if you alter the folder naming you only have to do it once and two(more importantly) you are less likely to make simple syntax errors when adding multi missions to a larger script.
Reply With Quote