Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Allow Libraries to be Defined by Quests, Reusing Files of Interest. #522

Closed
ekureina opened this issue May 24, 2014 · 2 comments
Closed

Comments

@ekureina
Copy link
Contributor

Right now, quests that contain files of interest are copied to quests by interested quest makers. Although I am not quite sure how to implement searching for libraries, libraries would be quests, or quests that only contain necessary components, that could be accessed by another quest. May help with #517.

Example API usage from scripts:

sol.main.define_lib(lib_name, lib_loc)

Then, when calling functions that use library data, add an optional library option to the end, defaulting to "self" which causes the engine to continue normal behavior. With this system, reusablility can be increased.

@ekureina
Copy link
Contributor Author

This might already be possible using sol.file. I am sure a lua library to be added to a quest could do the trick.

@christopho
Copy link
Collaborator

So you want several different quests to be able to use a common library? This is indeed the ideal way to do things.
Yes, this should already be possible with a simple require(), I think we don't even need sol.file. require() looks first in the quest directory, and then in usual Lua paths exactly like the standard require().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants