Every Wizard needs a Library


#1

I would like to propose the addition of a new “Level”, called the Library. Here players can create scripts that can be used in any other level.

This way players can define snippets that they might use in multiple places, such as finding the lowest health character in an array. It’s a common idiom, developers working on multiple projects often find it useful to split off commonly used code into a single library they can reuse in multiple projects, and that they can update (to a point) without having to update all their code that uses that library.

It would of course need to act somewhat like a normal level, in order to give players a chance to test their code as they’re working. This means there needs to be a split between library code and test code. Test code would be the same as the code for any other level, meaning that while it persists like other code, it is only available inside the Library level. The UI for this warrants some consideration…


#2

We’ll definitely need some way of doing this. Interesting idea with the special Library level. Another Archmage has proposed doing this with snippets, where you can save any bit of code to your editor config snippets and then have both a storage place and a quick way to insert the snippets. There’s also a design, which I quite like, of all your code for all your levels being available in a library section in your account.

It’s a bit tricky, because the methods and properties available from level to level are often quite different, so what works in one may be disallowed in another. So in this Library level, it’s unclear which Thangs would be programmable, with which properties available. Thoughts?