Scripting tips for new users
Posted: Thu Feb 23, 2006 8:20 pm
Some things I find useful when scripting are...
1 If I want to try out something new in a script, I make a small script with just a pawn and that particular feature.
No movement code, attack code , just the new command.
This way I remove all other variables and concentrate just on one thing.
Once it works properly (and I understand it properly)I then add it to my full script and test again.
Use debug() code in the script and check your results.
Are the results what was expected?
2 Only change 1 part of the script at a time, and test often.
This way its much easier to track down your errors, especially in a really big script.
Hope this helps.
Anyone else have scripting tips?
1 If I want to try out something new in a script, I make a small script with just a pawn and that particular feature.
No movement code, attack code , just the new command.
This way I remove all other variables and concentrate just on one thing.
Once it works properly (and I understand it properly)I then add it to my full script and test again.
Use debug() code in the script and check your results.
Are the results what was expected?
2 Only change 1 part of the script at a time, and test often.
This way its much easier to track down your errors, especially in a really big script.
Hope this helps.
Anyone else have scripting tips?