PDA

View Full Version : Adding Personalities to Foundation



Invain63
May 4th, 2009, 02:51
OK, I will admit I am a bit of neophyte at xml programming. That said, I am playing around with extensions. My first two forays were simple and successful (an extension to replace the desktop graphic and another to add the character sheet from the Generic ruleset to Foundation), so I was tempted to hunt bigger game - an extension to add a generic Personalities feature to the foundation ruleset.

To my general consternation, I can't even get the icon to show up on the desktop! Perhaps I bit off more than I can chew.

I am now going through the entire Generic ruleset trying to dope out all the parts of the NPC function. I would love a hint or two so I can start off in the right direction. Has anyone gone through the standard ruleset (D20 and its children) and cataloged what the files (and the functions they contain) do? The help sections in Library have been enlightening, but they are focused on the foundational building blocks rather than their implementation in the standard ruleset.

It is too bad (for me) that the ruleset tutorials out there haven't progressed far enough to cover Personalities.

Thanks in advance,

-Kevin McD

Foen
May 4th, 2009, 05:58
Personalities are found in adventure_npcs.xml in the d20 ruleset (and many custom rulesets). The three main elements are:

npc windowclass - defines how the npc character sheet looks
npclist windowclass - defines how the personalities 'book' looks when you open it on the desktop
npcsmall windowclass - defines how each entry in the personalities book appears

In addition, there is code in scripts/desktop.lua which adds each 'book' to the dock on the right of the screen (registerDockShortcut). You don't need to edit that, and probably shouldn't if you are doing this as an extension, but you should define a script module in the base section of your extension.xml file which performs that task.

You should also have a think about the combat tracker - I'm not familiar enough with the Foundation ruleset to know how it works, but you'd need to develop some means of dragging your npc to the tracker.

Hope that helps

Stuart

Invain63
May 4th, 2009, 15:12
In addition, there is code in scripts/desktop.lua which adds each 'book' to the dock on the right of the screen (registerDockShortcut).

Hah! I knew about all the XML file windowclasses, but not the registerDockShortcult script. Many thanks. :)


You should also have a think about the combat tracker - I'm not familiar enough with the Foundation ruleset to know how it works, but you'd need to develop some means of dragging your npc to the tracker.

Yep, that is all part of the plan. I just needed to get the thing to show up on the desktop before I start messing around with the functional details.


Hope that helps

Definately! Thanks again Stuart.

-Kevin McD

Sigurd
May 4th, 2009, 18:21
I'd absolutely love to be able to drag campaign personalities to an independent extension. It would be marvelous to collect them and perhaps move them between campaigns.


Sigurd

Invain63
May 6th, 2009, 23:06
Just as an FYI, I now have a Personalities extension that allows me to drag NPCs to the combat tracker. The functionality is more than a bit buggy due to the fact that it is currently a square peg (the Generic ruleset's Personalities) being forced into a round hole (the Foundation ruleset). I think it is functional enough for me to use - I can avoid the bugs since my needs are very limited - but I am going to continue polishing it.

That said, the game system I am using is Moon Design's HeroQuest (a playtest version of the game's second edition, which is due out on July 1st) so the final version probably won't be of much use to anyone else.

Thanks again for the help! I am sure I will have many more questions. Right now I am in the design (on paper) phase and won't be coding until I know how I ultimately want it to work.

-Kevin McD