Descriptive Problem Summary:
Resource files in subprojects overwrite resource files in the main project.
Click here to download a reproducible test case (BYOND project).
Expected Results:
Each project you include is "standalone" unless you explicitly override things. Technically this qualifies as overriding a file, but this is undocumented/confusing.
Actual Results:
Instead of using hooks to override an icon I can completely overwrite the file of another project by specifying my own. Something can be said for this, but I'd prefer to use hooks.
Does the problem occur:
Every time? Or how often?
Every time.
In other games?
Yes.
In other user accounts?
Yes.
On other computers?
Yes.
When does the problem NOT occur?
The problem does not occur if files have a different relative path in your project vs. the project you're including.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
AFAIK it's been a bug/feature for a long time.
Workarounds:
Put your files in a separate folder to avoid naming conflicts.
ID:2017307
Jan 12 2016, 11:24 pm
|
|||||||||||||
| |||||||||||||
Jan 12 2016, 11:34 pm
|
|
I'm not sure I entirely follow.
|
If you download the example there are 2 projects. "testcase.dme" and "main.dme".
Both specify an icon in the same location (relative to their .dme files). When you compile "main.dme" and run the project the object /obj/apple is red which is good. When you compile "testcase.dme" and run the project the object /obj/apple is green. This is because the icon file relative to "testcase.dme" overrides the one from "main.dme". |
Are you compiling with FILE_DIR enabled or disabled? If it's enabled, this would be semi-intentional with how FILE_DIR works, if not, that would be weird indeed.
|
alternative title: #Including a separate dme with resource files of the same name and relative path conflict rather than coexist.
Should clear up confusion. Basically nullquery has a ss13 branch that is a fork of ours, they have it such that they have /tg/station's project as a separate folder inside their project, and they include our dme in their project, allowing them to override our stuff in their project without breaking their ability to pull down our changes. if you do
#include "main/main.dme"
and in your project exists icon/items.dmi and in main's project exists main/icon/items.dmi, byond treats them as the same file, because to main, it sees main/icon/items.dmi as icon/items.dmi, and sees that as the same as your icon/items.dmi Ideally this shouldn't happen. |
This could also affect libraries that have resource files.
Different file path, but byond would treat it as the same file path. |
In response to Nadrew
|
|
Nadrew wrote:
Are you compiling with FILE_DIR enabled or disabled? If it's enabled, this would be semi-intentional with how FILE_DIR works, if not, that would be weird indeed. It's disabled. |