Page 1 of 1
NWN2 palletes
Posted: Mon Oct 02, 2006 9:22 pm
by Ronan
Does anyone know how these work, exactly? If not, can someone try to find out? We really need to be able to edit all the base (ie, global pallete) objects to add our event handlers, and distribute them via hakpack or something. We can have module or campaign objects of course, but those don't stop builders or DMs from accidentally creating instances of global resources (which, without the proper event handlers, could break the ACR or other things). Its really important we have ACR scripts everywhere we can from day 1, if we want to let ALFA be as flexible as possible throughout NWN2's lifespan.
Thanks.
Posted: Mon Oct 02, 2006 10:26 pm
by ç i p h é r
Where the blueprint appears in the palette should be recorded in the file data. Here are all the original file formats published by Bioware:
http://nwn.bioware.com/developers/
Let's look at the spec for item blueprints (UTI format). There appears to be a palette ID field that dictates what palette the blueprint appears under (page 6). I haven't fiddled with the toolset enough yet to figure out how to make global blueprints from the GUI (the option appears to be there but is greyed out), so if nothing else, perhaps we could go through and edit the files themselves to change the palette IDs of our global blueprints; A pain, but better than nothing? I'm not sure if we can add new global palettes though if what's there is not sufficient. Something to dig around for and discover.
While it looks like the current data formats have been preserved, new formats have also been introduced, so I hope OE publishes those for us as well. Obviously, these files are all being stored in .zip archives. So I guess it turns out they did use zip after all.
Edit: Here is the relevant text:
"ID of the node that the Item Blueprint appears under in the Item palette."
That actually sounds more like an index to a palette hash/array/list. I wonder if what is "global" then is merely all the UTI files stored in the "data" folder in the "templates" zip file? Simple theory to test, but if we need to update client data files, it'll probably be a show stopper. It might even break game patches if we tamper with these.
Posted: Tue Oct 03, 2006 3:49 am
by ç i p h é r
Ok after a little poking around, there's an option (View -> Options) in the General tab under Advanced that says "AllowEditingGlobalBlueprints". It defaults to false. Changing it to true allows us to edit as well as add global blueprints.
That should do the trick I think.
Posted: Tue Oct 03, 2006 8:16 pm
by Ronan
Yup, I found that as well. Unfortunately, those blueprints are litterally global, and don't seem to be stored in the module (temo0). Changing them seems to changes them in NWN2's blueprints data (a zip file the /data directory, iirc).
Think we could hak or override that zip? Haks seem to be able to contain nearly any sort of file... But I've never tried overriding a .bif (or .zip in this case). Overrides I guess might be required, but that would break compatibility with other modules, so I'd rather avoid that if possible.
Another option is using the campaign palette. I'd imagine our use of it is what OE had in mind when they made it. We'd have to tell builders and DMs just not to use the global palette, and hope they never do. Not really ideal

Posted: Tue Oct 03, 2006 8:26 pm
by ç i p h é r
Or just distribute a global ALFA data file containing the blueprints. Since they can be modified, it'd be hard to believe that changing this would break upgradability. I think it's therefore a free for all.
Posted: Tue Oct 03, 2006 10:58 pm
by Ronan
Well, I tried overriding templates.zip, without success. I also tried putting a creature in a hak with the same resref and resource name as a global creature, and it didn't show up. I then tried putting a new resource (without a conflicting resref)
NWN2 seems to allow an object with in the module palette to have the same resref and resource name as an object in the global palette. And yet CreateObject() offers no distinction between them.
Code: Select all
// Create an object of the specified type at lLocation.
// - nObjectType: OBJECT_TYPE_ITEM, OBJECT_TYPE_CREATURE, OBJECT_TYPE_PLACEABLE,
// OBJECT_TYPE_STORE, OBJECT_TYPE_WAYPOINT
// - sTemplate
// - lLocation
// - bUseAppearAnimation
// - sNewTag - if this string is not empty, it will replace the default tag from the template
object CreateObject(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE, string sNewTag="");
So... I'm confused. When you copy a global blueprint, it generates a new (presumably unique) resource name, ie c_mindflayer becomes c_mindflayer0. The resref in the creature's properties doesn't change. The resref listed in the blueprints list DOES change, to the new resource name. So I'm assuming that the resref field is not used, and resource name is the proper thing to look at. The resource name also matches the name of blueprint's file. But... you can simply change the resource name c_mindflayer0 back to c_mindflayer, and no sort of error message is displayed.
EDIT: Looks like the toolset allows the resource name and resref to be set independantly of the file name. I'd imagine this is a bug. c_mindflayer0.utc stays c_mindflayer0.utc if you change the resource name back to mindflayer. Then when you reload the mod, its resource name reverts to mindflayer0. But, I can't figure out where these global changes are going. templates.zip doesn't seem to be altered when you change the global blueprints.