<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Follower_tutorial_%28alternative%29</id>
		<title>Follower tutorial (alternative) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Follower_tutorial_%28alternative%29"/>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Follower_tutorial_(alternative)&amp;action=history"/>
		<updated>2026-08-06T07:09:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Follower_tutorial_(alternative)&amp;diff=19340&amp;oldid=prev</id>
		<title>Sunjammer: Fixing link</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Follower_tutorial_(alternative)&amp;diff=19340&amp;oldid=prev"/>
				<updated>2014-10-26T19:50:52Z</updated>
		
		<summary type="html">&lt;p&gt;Fixing link&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:50, 26 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Alternative approach ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Alternative approach ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First create&amp;#160; the setup as described above in [[basic follower tutorial]], except for the&amp;#160; scripts and plot tables. In addition, create the GDA extensions for a&amp;#160; level-up table and the M2DA which points to those tables, as described in [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Advanced follower &lt;/del&gt;tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First create&amp;#160; the setup as described above in [[basic follower tutorial]], except for the&amp;#160; scripts and plot tables. In addition, create the GDA extensions for a&amp;#160; level-up table and the M2DA which points to those tables, as described in [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Follower &lt;/ins&gt;tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then ...&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Follower_tutorial_(alternative)&amp;diff=19338&amp;oldid=prev</id>
		<title>Sunjammer: Created from Follower tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Follower_tutorial_(alternative)&amp;diff=19338&amp;oldid=prev"/>
				<updated>2014-10-26T19:28:17Z</updated>
		
		<summary type="html">&lt;p&gt;Created from &lt;a href=&quot;/wiki/Follower_tutorial&quot; title=&quot;Follower tutorial&quot;&gt;Follower tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The  following describes how to adapt the existing machinery for the  recruitment and tracking of your own party members.&lt;br /&gt;
&lt;br /&gt;
== Alternative approach ==&lt;br /&gt;
&lt;br /&gt;
First create  the setup as described above in [[basic follower tutorial]], except for the  scripts and plot tables. In addition, create the GDA extensions for a  level-up table and the M2DA which points to those tables, as described in [[Advanced follower tutorial]].&lt;br /&gt;
&lt;br /&gt;
Then ...&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Create a party plot table ===&lt;br /&gt;
&lt;br /&gt;
Have  a look at the gen00pt_party plot table and create a similar table for  your own followers. Don't bother with the Defined Flags for the moment,  just the Main Flags will do, ie recruited, in-camp and in-party  for each follower. (Critical Note: Do not duplicate the plot table,  create one from scratch. This is the case for ALL plot tables because of  a show-stopping bug which means a new GUID is not assigned on Duplicate of a plot.)&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Create a party script ===&lt;br /&gt;
&lt;br /&gt;
Duplicate  the gen00pt_party script and rename for your module (conventionally  plot tables and their plot scripts have the same name). Delete (or  comment out) the Defined Flags section at the end and any lines dealing  with logging and tutorials. Change names to those of your party members.  If you are using gifting, approval or forced inclusion you may wish to  retain those sections of code, but additional machinery will be needed  for these facilities to work. For approval you can specify a starting  level of approval here for each follower if you want it to be other than  zero (as per the existing section dealing with Dog). Note that the  custom hire function at the head of the script allows you to specify  whether or not to invoke the party picker on recruitment. You may not  want to do so for the first couple of followers (but see below). You  should already have defined all required constants in a separate file  for your module, eg &amp;lt;module prefix&amp;gt;_constants_h.  If not, do so now and include it, as well as your plot table, at the  head of the script. Delete includes that only refer to the main  campaign. (If this is all Greek to you, spend a couple of hours  examining the set-up  of the Demo, which is packaged with the toolset, and go through the  introductory tutorials referenced on the main page of this wiki).&lt;br /&gt;
&lt;br /&gt;
Looking at the new party script, notice that the follower-in-camp  function is not defined. This is because for some arcane reason it is  defined in party_h, and unhappily references the main campaign's plot  table. So we will have to create a new function to replace it, change  the other function's flag reference (for the sake of neatness), and  change the call in the main body of the script. (You may decide later  for other reasons to replicate and customise party_h, but that won't  interfere with re-creating this function here.)&lt;br /&gt;
&lt;br /&gt;
Our two functions at the head of the script should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;void SetFollowerInParty(object oFollower, string sPlot, int nCampFlag)&lt;br /&gt;
{&lt;br /&gt;
    WR_SetPlotFlag(sPlot, nCampFlag, FALSE);&lt;br /&gt;
    WR_SetObjectActive(oFollower, TRUE);&lt;br /&gt;
    WR_SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE, TRUE);&lt;br /&gt;
    command cJump = CommandJumpToObject(GetPartyLeader());&lt;br /&gt;
    WR_AddCommand(oFollower, cJump);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void SetFollowerInCamp(object oFollower, string sPlot, int nPartyFlag)&lt;br /&gt;
{&lt;br /&gt;
    WR_SetPlotFlag(sPlot, nPartyFlag, FALSE);&lt;br /&gt;
    WR_SetObjectActive(oFollower, FALSE);&lt;br /&gt;
    WR_SetFollowerState(oFollower, FOLLOWER_STATE_AVAILABLE, FALSE);&lt;br /&gt;
}&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the line in the in-camp sections for each follower should now be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;SetFollowerInCamp(o&amp;lt;follower&amp;gt;, strPlot, &amp;lt;follower&amp;gt;_IN_PARTY);&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Create package GDAs and reference them in you 2DA_base extension ===&lt;br /&gt;
&lt;br /&gt;
Look  at the packages_base GDA and create an extension GDA with one line for  each follower based on a main campaign follower that is most like your  own follower, eg a sword-shield  warrior can be a copy of Alistair, a battle mage a copy of Morrigan,  etc. You can look at the Excel version of this GDA to more easily see  what the fields mean. It is here that you can specify what if any  specialisation will be assigned on hire and the level at which this spec  point becomes available. (The IDs for each spec are in the 4000-range of ABI_base.)&lt;br /&gt;
&lt;br /&gt;
Most importantly, it is here also that you define the ID of both your level-up table and the AIP table you are about to create.&lt;br /&gt;
&lt;br /&gt;
Now create aip_follower_&amp;lt;follower name&amp;gt;  gda tables, again based on a existing tables most like your own  followers. No changes should be required to the copies you create.&lt;br /&gt;
&lt;br /&gt;
In the m2da_base_&amp;lt;your module&amp;gt;  extension you have already created, add lines for your AIP tables with a  package ID referencing the IDs you assigned in your packages extension  table.&lt;br /&gt;
&lt;br /&gt;
Carefully check that all IDs in your GDAs are correct and cross-reference properly, and save the GDAs to your override directory.&lt;br /&gt;
&lt;br /&gt;
Desirable but not obligatory (except for non-humanoid characters), is an extension to the Portraits gda. Finally the Equipment Layout gda will need an extension for non-humanoids, who use a different equipment mask.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Module script addition ===&lt;br /&gt;
&lt;br /&gt;
Modify  your own module script to point to the new plot table and your own  followers. To see an example of the required code for the two new  sections look at the relevant section of module_core, which are for  EVENT_TYPE_PARTYMEMBER_ADDED and EVENT_TYPE_PARTYMEMBER_DROPPED.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
The  recruit flag is set in a conversation (usually, but it could be a  script) and that event is then processed by the plot script, which among  other things sets both the in-camp and in-party flags, and fires up the party picker by default. If the player then selects the follower in the picker, the in-camp  flag is unset (or vice versa if the follower is not selected to join).  Subsequently, if the character is selected (or unselected) in the  picker, the event is picked up by the module script, which sets the  relevant plot flag as true, and that plot event is then sent to the plot  scipt which sets the other flag as false. &lt;br /&gt;
&lt;br /&gt;
(Note that if the  party picker is turned off for a particular follower's recruit event,  that follower will be placed in the active party regardless of the  number of members, so ONLY do this for a follower who cannot be  recruited when there are already 3 possible followers.)&lt;br /&gt;
&lt;br /&gt;
On  recruitment, player_core rebuilds the character according to the  specifications laid out in the GDAs, so no further scripting is  required.&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
&lt;br /&gt;
To  recruit a party member, set the recruit flag from your plot table in  the relevant dialogue. Adding or subtracting followers from the active  party is automatically tracked via this machinery, and the plot flags  can be interrogated in all your scripts and conversations if you need to  know who is currently in the party and who is in camp.&lt;br /&gt;
&lt;br /&gt;
Defined  flags can be added as you need them to the script and plot table but  there is no point having flags that you will not use, so as with all  Defined Flags this is an as-you-go decision, but quite easy to do.&lt;br /&gt;
&lt;br /&gt;
Hiring  and firing of temporary party members at the start of a campaign (such  as Ser Jory, or Jowan, or Soris, etc) can be handled by UT_HireFollower,  and the party picker is not invoked (nor is the Party Camp an available  destination).&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If  you haven't done so already, create a simple debugging area for your  module where you can dump the player, all followers and a couple of  conversation dummies, and set up a dialogue in which you can invoke all  required flags and conditions and see if they actually work as expected.  (This setup can be used to test many other components as well.) Global  machinery such as this can be painful to set up and get right (unless  you are of an exceptionally methodical cast of mind), but it is  worthwhile to ensure they are absolutely bullet-proof before you develop the specifics of your module.&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
This is an &amp;quot;out-of-the-box&amp;quot;  solution, and once set up is quite robust. Therefore if you want  variants not catered for here, it is a good idea to try to avoid modifying what you already have working.&lt;br /&gt;
&lt;br /&gt;
For example, if you want a follower (example tag: dairren) to be recruited without a set specialisation and one level higher than the PC could do the following:&lt;br /&gt;
&lt;br /&gt;
* Go to your packages m2da and set the spec field to 0. &lt;br /&gt;
* In the character's  plot table (you should have at least one for each follower) create a flag which we will call PREPARE_DAIRREN. &lt;br /&gt;
* In the table's plot scipt insert the following very simple event handler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;case PREPARE_DAIRREN:&lt;br /&gt;
{&lt;br /&gt;
    // awards the spec point; field from the properties gda&lt;br /&gt;
    SetCreatureProperty(oDairren, 38, 1.00);&lt;br /&gt;
&lt;br /&gt;
    // calculate the XP to award&lt;br /&gt;
    int nLevel = GetLevel(oHero); &lt;br /&gt;
    int nPoints = RW_GetXPNeededForLevel(nLevel + 1) - RW_GetXPNeededForLevel(nLevel);&lt;br /&gt;
&lt;br /&gt;
    // award the XP&lt;br /&gt;
    RewardXP(oDairren, nPoints, FALSE, TRUE); &lt;br /&gt;
&lt;br /&gt;
    break;&lt;br /&gt;
}&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The  flag can be set in the same conversation as the recruit flag, so long  as it comes afterwards. This way you not only maintain the integrity of your core machinery, but keep exceptions/variations for particular characters where they belong -- with that character's plot tables and scripts.&lt;br /&gt;
&lt;br /&gt;
[[Category:Follower tutorials]]&lt;/div&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	</feed>