PDA

View Full Version : scripting help plz



Christopher Matherne
June 18th, 2009, 00:15
function addCategories()
local w = NodeManager.createSafeWindow(self);
w.setExportName("encounter");
w.setExportClass("encounter");
w.label.setValue("Story");


plz tell me waht the word encounter represents in the 2 lines above:confused:

Christopher Matherne
June 18th, 2009, 00:41
I guess one is for database and the other for windowclass, or both for window class or both for database.

The goal i have is to create a new export entry to export the data created from a windowclass i made called corerules using the database encounter into a mod. so far, trial and error, changed encouner to corerules in all possibilities, and fail, guess it is due to the same database being used for encounter windowclass and the corerules windowclass. if this is the case, how can i create a new database to use with my new windowclass?:confused:

plz help

Moon Wizard
June 19th, 2009, 21:08
I haven't worked on the export code much, but I believe ExportName is the databasenode where the data is stored that you want to export, and ExportClass is the windowclass used to show the data when you click a link in the new module.

You should make sure that the data you are trying to export is in the correct format. The data should be organized into categories and then list items, just like the current entries for "encounter", "npc", "image", etc.

Here's an example I pulled from one of my campaign db.xml files.


<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.3" release="14">
...
<npc>
<category name="" mergeid="" baseicon="0" decalicon="0">
<id-00001>
....
</id-0001>
</category>
</npc>
...
</root>


If your data is set up in the right way, then adding an export entry is as simple as adding a new set of lines in the addCategories function:

Here's all that I did to add Battles to the export list:


w = NodeManager.createSafeWindow(self);
w.setExportName("battle");
w.setExportClass("battle");
w.label.setValue("Encounters");


All in all, these are not simple ruleset changes that you are working on. I would expect anyone messing this deep in the ruleset to have some background in programming and XML. Your expectations should be that you will need to spend a fair amount of time figuring out how the code is working and reviewing the databases created, and that's if you already have the programming background.

Cheers,
JPG