Just a quickie, once you've got a grip on 3dgs scripting, and you have a larger number of functions that do something useful, I really recommend buidlng them into some kind of library,

This library can be used by any future or present projects you have, providing you maintain your library properely, and don't make too many fundemental changes to your core scripts, the the library can be improved and this improvement, is passed on to all your projects.

To link the library(s), use use includes paths and soe ifdefs to turn things off or on