Creating Libraries

Hi, Not sure where to put this question, so I'll put it in the general forum as it's not a library or a code sample.
Whilst I'm not at a stage yet to create my own library, I've seen a few of 'The Pixies' and also KV's DoorLib.
A few questions therefore, just for clarification and curiosity.

  1. Is there a set order to how a library is laid out: i.e. functions, commands, interface, etc.
  2. The use of templates:
    If an interface tab has been created for the library and checkboxes are in use, should the caption be written on the tab or a template used instead.
    Should a template be also used in commands or verbs of the library, as opposed to having a message written in the command or verb itself.
    (I hope that makes sense)

I know the above is probably up to the creator themselves, but just wondering what best practice might be.


  1. No. You are free to mix them up as you like, except for templates (as opposed to dynamic templates), which I think need to go before they are used. Personally I like to keep functions together, etc. and always put interface at the end.

Templates (again as opposed to dynamic templates) are kind of weird as they can used when you load your game into the editor, whereas everything else happens when the game is played. If you copy a function or commands from the core library through the editor, you will find all the template substitutions have already been applied.

  1. You can have templates for the editor and for the game. Templates (and dynamic templates) for the game allow the user to customise what the player will see. It is more effort, but makes it easier for creators using another language, or doing it as third person, past tense or whatever.

Templates for the editor are only to support other languages and are not as readily done. You would have to supply two libraries, one with the templates, and the second with the interface. Anyone wanting to use it in French, say, would need to add the French template file after or instead of your template library but before the interface library, because the editor will use the last template it found when it adds the editor elements (I think).

It is doubtful if editor templates are worth bothering with in non-core libraries.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums