PDA

View Full Version : Cross Asset Includes



andi06
July 3rd, 2015, 10:43 AM
We used to be able to include scripts from ANY other asset, so I parked one temporarily in a mesh-library (kind mesh) and spent some time trying to work out why CM wouldn't load the included scripts in the client assets.

So it looks like there are now restrictions on what kinds of asset can act as the host for cross-asset-inclusion (or perhaps the script must actually be used by the host asset?). Would you mind sharing what these conditions are.

WindWalkr
July 3rd, 2015, 07:56 PM
There are no such restrictions.

chris

WindWalkr
July 3rd, 2015, 07:57 PM
If you're having trouble getting a particular configuration to work, send in a sample asset set and I'll let you know why.

chris

andi06
July 12th, 2015, 02:51 PM
I think that the problem I've been having here occurs in the following circumstances:

1. The host asset contains a single file which includes more than one class.
2. The child asset is including the multi-class host.gs file and is attempting to sub-class an item which is not the first item declared.

In other words the host file (host.gs) contains:



include "Trackside.gs"

class class1 isclass Trackside {
...
};

class class2 isclass Trackside {
...
};


If the client file does this:


include "host.gs"

class client isclass class1 {
...
};

then all is well, but if the client file does this:


include "host.gs"

class client isclass class2 {
...
};

then it seems to fail, I hope that makes sense.

Should I be able to do what I'm trying to do here?

WindWalkr
July 12th, 2015, 07:38 PM
This should work, and I can't see how the order in the file would affect anything.

chris