PDA

View Full Version : Is this possible...



Tenian
August 11th, 2008, 13:21
In DnD 4E (and maybe other stuff) the combat portion of an adventure is broken up into what as known as an encounter. This has some text elements (setup, features of the area, etc) and a list of npcs (monsters, traps).

You can easily fit the encounter into a story node (which is probably why story nodes are class "encounter").

What I'd like to do is take a story node and be able to drop it onto the combat tracker. This would greatly speed up GM setup time, especially if you distribute adventure modules.
The process of taking the NPCs from the story node and placing them onto the combattracker is three fold:

1) detect the drop on the combattacker, and determine if it is a story node type.

2) locate the npc data within the story node

3) add the npc data to the combattracker

1 and 3 are no problem. A drop handler already exists and I made simple modifications to it that allow for the drop of a story node. Since the current combattracker already handles a drop of an NPC, there is already a function built that handles this (addNPC).

The sticky point is locating the NPCs within encounter (2). A sample node looks like this:

<id-00007>
<name type="string">Area 1. Sludge Pit</name>
<text type="formattedtext">
<p><b>Encounter Level 1 (500 XP) </b></p>
<h>Setup </h>
<linklist>
<link class="imagewindow" recordname="image.id-00005">Sludge Pit - DM </link>
<link class="imagewindow" recordname="image.id-00006">Sludge Pit - Player </link>
</linklist>
<p>This area serves blahblahblah </p>
<p>This encounter includes the following creatures. </p>
<linklist>
<link class="npc" recordname="npc.id-00005"><b>2 kobold slingers </b>(S) </link>
<link class="npc" recordname="npc.id-00004"><b>3 kobold skirmishers </b>(K) </link>
</linklist>
<p><b>As the adventurers enter this chamber, read: </b></p>
<frame>blahblahblah</frame>
<h>Features of the Area </h>
<p><b>Pit: </b>blahblahblah</p>
<p>blahblahblah </p>
<p><b>Portcullis: </b>blahblahblah </p>
<h>Tactics </h>
<p>blahblahblah</p>
<p>blahblahblah</p>
<p>blahblahblah</p>
</text>
</id-00007>

I think, because the data I am interested in is stored within formattedtext, I'm screwed.

I can get to the text node...is it possible to get within this node and find the NPCs or is that not available within the lua?

If it's not I can only think of 2 alternatives.....

1) Modify the story such that dropping an NPC on it creates a node I can access (npclist for example). The problem is how do I maintain this if they decide to delete the shortcut from the story node? Also how do I make sure this gets exported?

2) Create a new class (npcencounter) and everything needed to maintain that class. Would it be possible to export that? This has some advantages of allowing me to have reusable encounters and add in some encounter building features (total the XP, group the NPCs by "type", etc). The downside is the GM has to go in and set this up in addition to the story node.

Foen
August 11th, 2008, 13:43
Initial impressions on this one:

The list of NPCs is embedded in the formatted text field, which cannot (currently) be parsed, so your observation is correct :)

I'd suggest going with your second approach: creating a new class for displaying story entries. This is a bit more work, as you need to implement the reference window class to display it, and build a link into the export process (not something I'm familiar with, but I notice that there is an export definition in the standard ruleset).

I don't think the GM should have too much extra work, if the windowclass is user-friendly, and GMs may welcome having the structure in place to record encounters properly and consistently.

I'll take a peek at the export stuff (I'm curious about it too) and see what can be achieved.

Cheers

Stuart

Foen
August 11th, 2008, 13:45
It strikes me that you might not want to drag the whole story node onto the tracker, but have shortcuts to tracker setup/saved tracker info. That way, a room or encounter can have more than one lot of tracker info.

Just a thought.

Stuart

Tenian
August 11th, 2008, 14:00
In the published adventures I've seen, one encounter is a distinct set of monsters. The term "encounter" actually has a formal meaning in the system (there are powers that recycle on an encounter basis, etc).

I guess I'll start building as a new class. Pity the story entry doesn't maintain the links outside of formattedtext...that would have made this a much easier task.

On to the next question then....How do I create a new button/icon on the right hand menu? :)

Foen
August 11th, 2008, 14:15
Take a look at the gmshortcuts class in desktop_classes.xml. Each icon is 91x86 pixels and they are spaced vertaically 90 pixels appart. There is room for one extra icon in the standard layout, before you bump into the token box.

Cheers

Stuart

Wargamer777
August 11th, 2008, 14:54
I must say, the community really appreciates this work being put into the program by Tenian, Foen and others. This mod will be a huge benefit to DMs everyone in getting encounters setup quickly, and to cut down on "down" time in the game.

I only wish I could help contribute, but I have no programming skills AT ALL. :p

Tenian
August 11th, 2008, 15:01
On the ruleset side, most of the work, by far, has been done by JPG. The whole ruleset mod is based off his 3.5 ruleset. JMnITup has added a lot of code as well.

I'm just a hack who adds in little features and changes around displays, with Foen's eternal patience. None of my work would be possible without the stuff much more talented coders built.

Now if we talk about the reference modules...well that's a different story :)

Tenian
August 11th, 2008, 18:23
It took the better part of my lunch hour but I puzzled through adding a button to the desktop and then making it pull up a frame for adding encounters.

I don't have the classes built for the actual encounters yet but at least I made progress.

Moon Wizard
August 11th, 2008, 23:07
This could potentially dove-tail into the combat tracker save/load rework I've been contemplating.

Basically, I want to add the ability to save/load encounters into the module, so the encounters can be preset.

Why not implement in the story node where they probably belong anyway?

There are lots of details around how this should be done, especially with PCs in the combat tracker, how to save, etc. Joshuha had some ideas, but I haven't heard from him for a few weeks.

Cheers,
JPG

Tenian
August 11th, 2008, 23:48
I would love to tie it into the story node (you mean the encounter class?) The problem is the only child of the encounter class is text. Which is of type formattedtext.

If you know some way to get the links out of this I'd love to know it.

I tried searching for various terms to find any relevant articles and I didn't come up with any. Do you remember any topics, or have any links?

joshuha
August 12th, 2008, 02:20
This could potentially dove-tail into the combat tracker save/load rework I've been contemplating.

Basically, I want to add the ability to save/load encounters into the module, so the encounters can be preset.

Why not implement in the story node where they probably belong anyway?

There are lots of details around how this should be done, especially with PCs in the combat tracker, how to save, etc. Joshuha had some ideas, but I haven't heard from him for a few weeks.

Cheers,
JPG

I am still getting situated in my new place and do not have internet until Wednesday (on my blackberry now) but I would like to get with you guys to discuss how to roll the combat tracker into the database. Once you do this you get saveable combats that can be linked inside story entries with no extra worked needed. This would allow you to preload story entries with links to NPCs, links to maps, and links to a pre-prepared combat entry.

Tenian
August 12th, 2008, 02:36
That sounds perfect. Just let me know what you need and I'll do what I can. If there's any prep work I can do before you get internet just shoot me a message.