PDA

View Full Version : Character sheet extension



VenomousFiligree
January 20th, 2010, 12:44
I'm having my first attempt at extensions. If I want to tweak an existing character sheet, ie change some text, do I just copy all the characters sheet files into the extension, then change the required text, or is there another way?

Valarian
January 20th, 2010, 13:36
Have a look at the existing Traveller or Corporation extensions on the wiki for a whole character sheet extension over the Foundation.

Putting another tab on the sheet probably could be done using an extension, but I think changing an existing tab would have to be done by copying the existing sheet and then making the modifications in the extension. It would probably be simpler to override the whole, rather than trying to get the extension to override part of the character sheet.

Foen
January 20th, 2010, 21:04
Like Valarian says, each tab on a character sheet is typically defined using its own window class. To change the tab contents using an extension is a matter of redefining that single window class (not the whole character sheet) so you could tweak the words quite easily.

Adding a new tab would require the top-level character sheet file to be changed, so that the new tab is included, but not the rest.

Issues start to arise if you change fields on one of the sheets that are referenced elsewhere (say deleting HP on charsheet_main, when they are still used in a minisheet and in the combat tracker), or changing the type of a field (say from number to string). The latter is most problematic and can cause FG to crash if two different parts of the ruleset treat the same field as different types.

Foen

VenomousFiligree
January 20th, 2010, 21:52
I don't actually want to create anything new, just change what is already there. I'm managing this at the moment by copying the entire character sheet files into the extension, then changing text and values where necessary.

However could I then distribute this "tweaked" character sheet if the original came from a commercial ruleset (the sheet would need the original ruleset to work)?

Foen
January 20th, 2010, 22:19
It would depend on the ruleset/licence. In general (and certainly in respect of former Digital Adventures stuff) the ruleset IP is proprietary and cannot be used as the basis for something you then redistribute. I think this means you could create a new extension from scratch that was compatible with such a ruleset, but not take commercial ruleset code and distribute a modified version.

Best check with Doug, if it is a former DA product, as it is now SmiteWorks' IP.

Stuart

VenomousFiligree
January 20th, 2010, 23:47
Thanks for all the advise, next questions :)

How would I override chat_chat.lua from an extension and how would I add license/copyright style text to be shown in the chat window on start up?

Foen
January 21st, 2010, 06:21
chat_chat.lua is referenced from the "chat" windowclass in desktop_classes.xml file. You'd need to redefine the chat windowclass and include your own copy of chat_chat.lua in your extension.

You can add a copyright message either in chat_chat.lua or in chatmanager.lua: I use the latter, but if you are going to override the former anyway, it makes sense for you to do it there. Amend the chat_chat.lua onInit function as follows:


local copyrightmessage = {
[1] = "My Roleplaying System, (c) 2010 MurghBpurn Inc.",
[2] = "My Roleplaying System (tm) is a trademark of MurghBpurn, Inc."
};

function onInit()
ChatManager.registerControl(self);
-- display the ruleset message
for i,txt in ipairs(copyrightmessage) do
addMessage({text = txt, font = "systemfont"});
end
if User.isHost() then
Module.onActivationRequested = moduleActivationRequested;
end
Module.onUnloadedReference = moduleUnloadedReference;
end


You can put the 'local copyrightmessage=...' declaration at the top of the file if you want, to make it easier to find and change.

Hope that helps

Foen

Oberoten
January 21st, 2010, 21:57
I played around for a while with a dockable charactersheet where I'd be able to add pages as extensions. It didn't really work as well as I had hoped with my limited skills.

- Obe