{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/19178","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/19178/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/19178/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/19178/events","html_url":"https://github.com/godotengine/godot/issues/19178","id":326738331,"number":19178,"title":"Proposal: New Add-On (sub-project) system","user":{"login":"reduz","id":6265307,"avatar_url":"https://avatars2.githubusercontent.com/u/6265307?v=4","gravatar_id":"","url":"https://api.github.com/users/reduz","html_url":"https://github.com/reduz","followers_url":"https://api.github.com/users/reduz/followers","following_url":"https://api.github.com/users/reduz/following{/other_user}","gists_url":"https://api.github.com/users/reduz/gists{/gist_id}","starred_url":"https://api.github.com/users/reduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reduz/subscriptions","organizations_url":"https://api.github.com/users/reduz/orgs","repos_url":"https://api.github.com/users/reduz/repos","events_url":"https://api.github.com/users/reduz/events{/privacy}","received_events_url":"https://api.github.com/users/reduz/received_events","type":"User","site_admin":false},"labels":[{"id":279097162,"url":"https://api.github.com/repos/godotengine/godot/labels/discussion","name":"discussion","color":"ee77ee","default":false},{"id":391232995,"url":"https://api.github.com/repos/godotengine/godot/labels/topic:assetlib","name":"topic:assetlib","color":"ffdd44","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2018-05-26T13:28:41Z","updated_at":"2018-05-29T15:52:18Z","closed_at":null,"author_association":"MEMBER","body":"After discussing with @bojidar-bg I think we reached some general idea on how the add-on system could be improved. Currently, the add-on system has many limitations:\r\n\r\n* Requieres unique and absolute paths\r\n* Makes it difficult to test self-contained\r\n* Causes problems with duplicated information in files such as project.godot, README.md, .gitignore,etc.\r\n\r\nMost of the feedback for the current system centers on that it should be great if it could be possible to:\r\n\r\n* Just write the add-on as a godot project\r\n* Do not include the root directory\r\n* Be able to install it anywhere in the project and likewise remove it\r\n* Be able to simply check out an addon using git to a sub-directory of an existing project and keep it up to date this way\r\n\r\nSo, we've been discussing this for a while and reached the following proposal, which I believe allows to implement this in the simplest way.\r\n\r\nWriting an add-on will work as follows. It will not be an add-on in itself, but a sub-project:\r\n\r\n1. Create a new project, this will be the add-on.\r\n2. Make the add-on as if it was a project in itself.\r\n4. Resources (And this includes scripts) will have a new function named get_project_path(). If you are writing a script in C#/GDNative you can query for the base path. When running the project as sub-project,  it will be res://. When running in the game it will be the path to the subproject. \r\n5. For GDScript this process can be transparent, so nothing needs to be done, scripts will just work. Just use res:// normally with extends, load and preload.\r\n6. In GDScript, in the case your scripts needs to access a resource from outside the subproject path, then just use ResourceLoader.load() manually.\r\n\r\nUnde the hood, sub-projects can go anywhere within the main project and it will work the folowing way:\r\n\r\n1. From the editor, sub-projects will probably be scanned automatically, but you will have to toggle them on/off yourself similar to now. This ensures that all sub-projects go to a list.\r\n2. This list is passed to ResourceLoader. Resourceloader can easily detect when a resource being loaded is sub-project. This information will be passed to each loader, and loaders will be able to remap res:// of it's sub-resources to the full path. Most likely, only resource loader/save binary/text need this addition, the other loaders don't support subresources anyway so they are fine as-is.\r\n3. Settings added in project.godot of a subproject will be editable in ProjectSettings for the project. If the setting is edited, though, it will be re-owned to the main project and the setting in the sub-project will no longer be used (in other words, main project.godot always has priority over sub ones, this makes sense as you may want to modify a sub-project setting, change input mappings definied in a sub-project, etc.). \r\n4. Some settings will adapt fine to this (such as input), but others we need to change how they are saved, so they use individual properties. This is mainly the case of translations and translation remaps, which go into a single array now and will need to be converted to individual properties.\r\n5. Settings that contain paths, will be converted automatically by brute force when loading a sub-project.godot. If a strings begins with \"res://\" it will be assumed to be a path and will be converted.\r\n\r\nSo this is pretty much it. This approach is the simplest we could come up with, should require little work from the codebase, and should make much, much simpler the process of creating addons (which are simply sub-projects now). Feedback welcome!\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/392829250","html_url":"https://github.com/godotengine/godot/issues/19178#issuecomment-392829250","issue_url":"https://api.github.com/repos/godotengine/godot/issues/19178","id":392829250,"user":{"login":"MarianoGnu","id":1776044,"avatar_url":"https://avatars2.githubusercontent.com/u/1776044?v=4","gravatar_id":"","url":"https://api.github.com/users/MarianoGnu","html_url":"https://github.com/MarianoGnu","followers_url":"https://api.github.com/users/MarianoGnu/followers","following_url":"https://api.github.com/users/MarianoGnu/following{/other_user}","gists_url":"https://api.github.com/users/MarianoGnu/gists{/gist_id}","starred_url":"https://api.github.com/users/MarianoGnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarianoGnu/subscriptions","organizations_url":"https://api.github.com/users/MarianoGnu/orgs","repos_url":"https://api.github.com/users/MarianoGnu/repos","events_url":"https://api.github.com/users/MarianoGnu/events{/privacy}","received_events_url":"https://api.github.com/users/MarianoGnu/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T15:52:18Z","updated_at":"2018-05-29T15:52:18Z","author_association":"CONTRIBUTOR","body":"I was thinking, whou could some properties be shared beatween main project and Addon? for example when you make the Addon project (asuming it could be used elsewhere) you dont know the final game resolution will be, so making a GUI that fits the final resolution could be difficult, or maybe your addon project expects to have defined specific inputs, when the scriptso n the addon is executed it read's the addon's input map or the main project's? in the first case then you would need something like SubProjectSettings.get(\"subProjectName\",\"key\") for global properties, configurations and presets"}}
{"actor":{"display_login":"MarianoGnu"}}