Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
hpl3:game:guides:scripters_guide [2014/03/12 08:24] ian.thomas [Code Structure] |
hpl3:game:guides:scripters_guide [2014/11/11 21:01] thomas [Code Structure] |
||
---|---|---|---|
Line 76: | Line 76: | ||
class cScrMap : iScrMap | class cScrMap : iScrMap | ||
{ | { | ||
- | //-------------------------------------------- | + | //-------------------------------------------- |
- | ///////////////////////////////////////// | + | ////////////////////////////////////////////////////////////////////////////////////////// |
- | // ============== | + | // ============== |
- | // MAIN CALLBACKS | + | // MAIN CALLBACKS |
- | // ============== | + | // ============== |
- | ///////////////////////////////////////// | + | //{/////////////////////////////////////////////////////////////////////////////////////// |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | /*OnStart, OnEnter, OnLeave, Update (avoid this), OnAction (debug only), OnPlayerDead, etc are here.*/ | + | /*OnStart, OnEnter, OnLeave, Update (avoid this), OnAction (debug only), OnPlayerDead, etc are here.*/ |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | ///////////////////////////////////////// | + | //} END MAIN CALLBACKS |
- | // ============== | + | |
- | // MAIN FUNCTIONS | + | |
- | // ============== | + | |
- | ///////////////////////////////////////// | + | |
- | //------------------------------------------------------- | + | ////////////////////////////////////////////////////////////////////////////////////////// |
+ | // ============== | ||
+ | // MAIN FUNCTIONS | ||
+ | // ============== | ||
+ | //{/////////////////////////////////////////////////////////////////////////////////////// | ||
- | /*Put any variables that are used in more than one scene here.*/ | + | //------------------------------------------------------- |
- | //------------------------------------------------------- | + | /*Put any variables that are used in more than one scene here.*/ |
- | /*Put any functions that are used in more than one scene here.*/ | + | //------------------------------------------------------- |
- | //------------------------------------------------------- | + | /*Put any functions that are used in more than one scene here.*/ |
- | ///////////////////////////////////////// | + | //------------------------------------------------------- |
- | // ============== | + | |
- | // SCENE X *NAME OF SCENE* | + | |
- | // ============== | + | |
- | ///////////////////////////////////////// | + | |
- | //------------------------------------------------------- | + | //} END MAIN FUNCTIONS |
- | /*Put any variables that are used by many events in Scene X here.*/ | + | ////////////////////////////////////////////////////////////////////////////////////////// |
+ | // ============== | ||
+ | // SCENE X *NAME OF SCENE* | ||
+ | // ============== | ||
+ | //{////////////////////////////////////////////////////////////////////////////////////// | ||
- | //------------------------------------------------------- | + | ///////////////////////////////////////// |
+ | // Scene X GENERAL | ||
+ | //{////////////////////////////////////// | ||
+ | //------------------------------------------------------- | ||
- | /*Put any functions that are used in more than one event in Scene X here.*/ | + | /*Put any variables that are used by many events in Scene X here.*/ |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | ///////////////////////////////////////// | + | /*Put any functions that are used in more than one event in Scene X here.*/ |
- | // Scene X Event X *Name Of Event* | + | |
- | ///////////////////////////////////////// | + | |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
+ | //} END Scene X General | ||
- | /*Put any variables that are only used in Scene X, Event X here.*/ | + | ///////////////////////////////////////// |
+ | // Event X *Name Of Event* | ||
+ | //{////////////////////////////////////// | ||
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | /*Put any functionsthat are only used in Scene X, Event X here.*/ | + | /*Put any variables that are only used in Scene X, Event X here.*/ |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | ///////////////////////////////////////// | + | /*Put any functionsthat are only used in Scene X, Event X here.*/ |
- | // ============== | + | |
- | // TERMINALS | + | |
- | // ============== | + | |
- | ///////////////////////////////////////// | + | |
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | ///////////////////////////////////////// | + | //} END Event X |
- | // Terminal *Name Of Terminal* | + | |
- | ///////////////////////////////////////// | + | |
- | //------------------------------------------------------- | + | //} END SCENE X |
- | /*Put any variables that are only used Terminal here.*/ | + | ///////////////////////////////////////// |
+ | // ============== | ||
+ | // TERMINALS | ||
+ | // ============== | ||
+ | //{////////////////////////////////////// | ||
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
- | /*Put any functions that are only used Terminal here.*/ | + | ///////////////////////////////////////// |
+ | // Terminal *Name Of Terminal* | ||
+ | //{////////////////////////////////////// | ||
- | //------------------------------------------------------- | + | //------------------------------------------------------- |
+ | |||
+ | /*Put any variables that are only used Terminal here.*/ | ||
+ | |||
+ | //------------------------------------------------------- | ||
+ | |||
+ | /*Put any functions that are only used Terminal here.*/ | ||
+ | |||
+ | //------------------------------------------------------- | ||
+ | |||
+ | //} END Terminal *Name Of Terminal* | ||
+ | |||
+ | //} END TERMINALS | ||
} | } | ||
Line 165: | Line 181: | ||
**Note2:** \\ | **Note2:** \\ | ||
+ | Have snuck in some { and } to make code folding for sections possible. | ||
+ | |||
+ | **Note3:** \\ | ||
Remember to always separate functions with a comment line, like this: | Remember to always separate functions with a comment line, like this: | ||
Line 179: | Line 198: | ||
} | } | ||
</code> | </code> | ||
+ | |||
==== Naming Conventions ==== | ==== Naming Conventions ==== | ||