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.
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.