Difference between revisions of "Add A New Class Tutorial"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(Adding a new class in DA)
 
m (Adding languages bar)
 
(107 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[b]================================================================================
+
== Introduction ==
WARNING:            WARNING:              WARNING:              WARNING:                WARNING:
+
Creating a new class in Dragon Age is a fairly complicated process, compounded by the fact that currently there are bugs in the 2DA handling which we must work around till they are fixed by Bioware.
================================================================================[/b]
+
  
THIS CAN BREAK YOUR GAME / TOOLSET IF YOU ARE NOT VERY CAREFUL.
+
Before going in and editing the files, make sure you know at least the following details for your class
YOU ARE GOING TO HAVE TO OVERWRITE SEVERAL CORE GAME FILES.
+
* Class Name
YOU HAVE BEEN WARNED.
+
* Will it be a magic- or a stamina-based character?
 +
* Will the new class reuse existing abilities/spells or new ones?
 +
* What backgrounds will be available for this new class?
  
(Currently, created separate M2DA's DO NOT WORK, despite the file says to use them)
+
For the purpose of the basic tutorial, we will create a new class called Shaman that will be a copy of the Mage and will be available for the Noble origins.
YOU CAN TRY AND USE THEM AND ADD THEM TO THE 2DA_BASE.XLS UNDER THE M2DA
+
  
IN THIS EXAMPLE WE WILL ADD A SHAMAN
+
== Create the module ==
 +
Fire up the toolset and create a new module. Let's call it New_Class for this tutorial. Since we want to test this class in the single player campaign, make sure that '''Single Player''' is selected in the Extended Module drop-down under Module Properties and the Module Hierarchy includes '''Single Player''' as well.
  
PLEASE FOLLOW THIS TUTORIAL EXACTLY, NO JUMPING AROUND OR ALTERING
+
Go to Tools -> String Editor and create the following strings:
 +
(for the purposes of this tutorial, I am using stringIDs starting at 15000000. Use whatever stringID is generated in your module)
 +
{| rules="all" style="border: 1pt solid black"
 +
|-
 +
|'''String ID'''  ||'''Text'''  ||'''Description'''
 +
|-
 +
|15000000 || Shaman || Class Name (Singular)
 +
|-
 +
|15000001 || Shamans || Class Name (Plural)
 +
|-
 +
|15000002 || Shaman is a new class || Class Description
 +
|-
 +
|15000003 || Shaman || Class Tooltip
 +
|-
 +
|15000004 || JohnD || Default first name for male character (dwarf)
 +
|-
 +
|15000005 || JaneD || Default first name for female character (dwarf)
 +
|-
 +
|15000006 || JohnH || Default first name for male character (human)
 +
|-
 +
|15000007 || JaneH || Default first name for female character (human)
 +
|}
  
[b]================================================================================
+
{{TutorialRef|String editor}}
WARNING:            WARNING:              WARNING:              WARNING:                WARNING:
+
================================================================================[/b]
+
  
[b]===================
+
== Editing 2das ==
NEW CLASS STARTER KIT
+
NOTE: '''DO NOT''' edit the .xls files present under <Dragon Age install>\tools\source\2DA directly and generate the GDA. Bioware has given us the power of M2DA precisely for this purpose.
===================[/b]
+
  
[b]This kit has all the .xls spreadsheets you need to add a new class.
+
* Create a new empty workbook or copy or rename one of the workbooks from the 2DA folder and delete the existing worksheets. Lets call this New_Class.xls
 +
* Copy the following worksheets into the the new workbook. Rename all worksheets!!
 +
  CLA_base.xls\CLA_data                ->  New_Class.xls\CLA_data_nc
 +
  2da_base.xls\M2DA_base                ->  New_Class.xls\M2DA_base_nc
 +
  background.xls\Backgrounds            ->  New_Class.xls\Backgrounds_nc
 +
  background.xls\background_defaults    ->  New_Class.xls\background_defaults_nc
 +
  background.xls\chargen_preload        ->  New_Class.xls\chargen_preload_nc
 +
  ALWizard_default.xls\ALWizard_default ->  New_Class.xls\ALShaman_default
 +
  Achievements.xls\Achievements        ->  New_Class.xls\Achievements_nc
 +
* Save the workbook New_Class.xls
 +
<br/>
 +
==== Edit CLA_data_nc ====
 +
In the New_Class.xls workbook, navigate to the CLA_data_nc worksheet.
 +
NOTE: The procedure below has to be done because this 2DA is read sequentially and
 +
adding a class at the end (ID:26 using standard resources) does not generate a unique
 +
background ID. This section will be modified when Bioware fixes these bugs.
 +
Copy line #4 (Wizard Class with ID:2) and paste it below the Rogue class, moving the subsequent lines one down. Te
 +
The important columns to change are:
 +
* '''Label''': Shaman
 +
* '''NameStrref''': 15000000 (''String ID referencing the class name'')
 +
* '''PluralStrref''': 15000001 (''String ID referencing the class in plural'')
 +
* '''DescStrref''': 15000002 (''String ID referencing the class description'')
 +
* '''TooltipStrref''': 15000003 (''String ID referencing the class description'')
 +
* '''Icon''': classico_spirithealer (''You can create a new icon and put that icon's name in here too. For this tutorial, we are reusing the Spirithealer specialization icon'')
 +
* '''Constant''': CLASS_Shaman
 +
* '''StartingAbility1''': ID of the ability assigned during chargen. We will keep this the same as Mage for now (4023).
 +
* '''CharGenLabel''': Shaman
  
These have been pre-programmed to follow the tutorial I wrote so you can see how it is done.  It also contains the converter and the GDA as well.
+
{{TutorialRef||CLA base.xls}}
  
You still need to edit the scripts in the toolkit and add the UTC model.[/b]
+
==== Edit M2DA_base_nc ====
 +
In the New_Class.xls workbook, navigate to the M2DA_base_nc worksheet.<br/>
 +
Remove all lines except the first 2 lines.<br/>
 +
Add the following:
 +
{| rules="all" cellpadding="2"  style="border: 1pt solid black"
 +
|-
 +
|ID above 1000000  ||ALShaman_default  ||ALShaman_default
 +
|-
 +
|}
  
YOU STILL NEED TO ADD THESE GDA TO YOUR MODULE
+
<br/>
  
look in name/mydocuments/bioware/dragonage/addins/modulename
+
==== Edit backgrounds_nc ====
 +
In the New_Class.xls workbook, navigate to the backgrounds_nc worksheet.<br/>
 +
Insert a new column after the Mage column and name it Shaman. Since we want to use this class for the Noble Origins, put a '''1''' against the Noble row. Refer the image below.
 +
[[File:Backgrounds.jpg]]
 +
<br/>The current design of the backgrounds tab makes it difficult to assign different classes to different races for the Mage and Noble origins. Independent modules can override this backgrounds worksheet completely though they would still have to work within the current GUI limitation of 6 backgrounds.
 +
<br/><br/>
 +
==== Edit background_defaults_nc ====
 +
In the New_Class.xls workbook, navigate to the background_defaults_nc worksheet.<br/>
 +
The ID column in this worksheet is populated according to the following formula:
 +
(1000 * Race ID) + (100 * Class ID) + Background ID
  
Put these GDA files in: name/mydocuments/bioware/dragonage/addins/modulename/core/override directory
+
Currently, this formula has also been reported to Bioware since this allows for 99 backgrounds
 +
and requires the Class ID to be in multiples of 100 to yield unique results.
 +
In this tutorial,
 +
* Dwarf Noble Shaman = (1000 * 1) + (100 * 4) + 5 = 1405
 +
* Human Noble Shaman = (1000 * 3) + (100 * 4) + 5 = 3405
  
[b]http://www.damods.com/forums/index.php?action=downloads;sa=view;down=131[/b]
+
Change the DefaultNameMale and DefaultNameFemale stringID references to the strings created earlier. The result should look like the image below. We will create the default_shaman.utc and the Ability referenced by the ID 5000000 later in the tutorial.
 +
[[File:Background_defaults_nc.jpg]]
 +
<br/><br/>
 +
==== Edit chargen_preload_nc ====
  
[b]===================
+
In the New_Class.xls workbook, navigate to the chargen_preload_nc worksheet.<br/>
NEW CLASS STARTER KIT
+
This sheet lists the character templates to load before the chargen so that the model corresponding to the race/class/origin is shown.
===================[/b]
+
<br/>
 +
Copy the ID and Template for the new character templates from the background_defaults_nc worksheet.
 +
{| rules="all" style="border: 1pt solid black"
 +
|-
 +
|'''ID'''  ||'''Template'''
 +
|-
 +
|1405|| default_shaman.utc
 +
|-
 +
|3405 || default_shaman.utc
 +
|}
 +
<br/>
  
------------------------------------
+
== Generate the .GDA file ==
Step 1:  You will need to edit the following 2DA's.
+
------------------------------------
+
  
2da_base.xls
+
Open a command prompt and navigate to the <Dragon Age install directory>\tools\ResourceBuild\Processors
abi_base.xls
+
Execute the following command: '''excelprocessor.exe New_Class.xls -outdir="<My Documents path>\Bioware\Dragon Age\AddIns\New_Class\module\override"'''
ALclassname_default.xls  (ex  ALshaman_default.xls) Copy from ALWizard_default.xls
+
<br/>
background.xls
+
cla_base.xls
+
guitypes.xls
+
  
------------------------------------
+
== Editing the scripts==  
Step 2: Editing the 2das
+
You now need to edit some scripts.
------------------------------------
+
=== Edit the 2da_constants_h file ===
 
+
find the 2da_constants_h file under Core scripts
------------------------------------
+
open up 2da_base.xls
+
------------------------------------
+
Add the following to the end of M2DA_base TAB
+
 
+
ID above 100000  ALShaman_default  ALShaman_default
+
 
+
Now SAVE your file
+
 
+
 
+
------------------------------------
+
Open up guitypes.xls
+
------------------------------------
+
At bottom of list paste this:
+
 
+
ID Label StringId Ability ProgressBar CombatTraining SpecialGraphic TintColor Orphanage Flags BlendTree
+
500 Class: Shaman 8000000 5000 0 0 1 0x9B0F00 0 0 ****
+
 
+
Now SAVE your file
+
 
+
 
+
------------------------------------
+
Open up CLA_base.xls
+
------------------------------------
+
Paste this AFTER line 3: (Move all down 1)
+
 
+
4 Shaman 8000000 8000001 **** 8000002 8000003 classico_spirithealer CLASS_Shaman 2 95 1 100 5 2 2 2 2 2 0 0 0 55 50 1 5 1 3 0.3 4035 **** 1 Shaman ****
+
 
+
Now SAVE your file
+
 
+
 
+
------------------------------------
+
Open up background.xls
+
------------------------------------
+
On backgrounds tab:  You need to insert a section between mage and skill 1, see screenshot
+
 
+
[img width=750 height=135]http://www.damods.com/images/tuts/background.jpg[/img]
+
 
+
On background_defaults there are several section you need to note here regarding the screenshot:
+
 
+
[img width=750 height=274]http://www.damods.com/images/tuts/bgdef.jpg[/img]
+
 
+
How the ID's work, 1 = dwarf, 4 = shaman, 5 = noble, the rest of the pattern is easy.
+
 
+
On lines 12,15,17,19 you need to add these in. What I recommend is just coping these lines
+
 
+
10 ==> 12
+
13 ==> 15
+
16 ==> 17
+
18 ==> 19
+
 
+
The template string is the deault_shaman.utc you will need to create in the toolset later on for these to have a base model
+
The Ability is the starting ability tied to this class, in my case it just references a different one then what you will have
+
 
+
On chargen_preload there are several section you need to note here regarding the screenshot:
+
 
+
[img width=281 height=374]http://www.damods.com/images/tuts/chardef.jpg[/img]
+
 
+
These ID's must match what is on the background_defaults otherwise the game WILL crash.
+
 
+
Now SAVE your file
+
 
+
 
+
------------------------------------
+
open up abi_base.xls
+
------------------------------------
+
 
+
in the ABI_Base tab add the following to the bottom of the list
+
 
+
There are several columns that very are important
+
 
+
abilitytype - define what type of ability. melee, spell, skill etc..---> links with abilitytype.xls
+
 
+
prereqability - defines what is needed to have this ability.  To add a new class these need to be changed on existing classes.
+
 
+
guitypes - referenced what class this links too ---> links with guitypes.xls
+
 
+
 
+
 
+
AFTER LINE 119 ==> 4034 HIDDEN_DOG insert a new row and put in the following
+
 
+
5000 HIDDEN_SHAMAN 0 0 380405 330716 hidden 2 0 0 0 0 0 0 0 1 0 0 12 0 0 0 0 3 1.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 7 0 2 33 0 0 0 0
+
 
+
 
+
 
+
Add the bottom paste these
+
 
+
 
+
300000 HEROIC_OFFENSE2 380003 379523 367458 379231 spl_ico_heroic_offense 2 1 0 0 0 20 0 5000 0 0 0 500 3 0 3 1 4 spell_singletarget.ncs 5 90215 244 247 0 0 2 0 0 0 0 0 0 90109 128 1 7 0 2 33 0 0 0 0
+
 
+
300001 HEROIC_AURA2 380000 379520 367458 379214 spl_ico_heroic_aura 2 1 0 0 0 30 0 300000 0 4 15 500 3 0 3 1 4 spell_singletarget.ncs 5 90213 244 247 0 0 0 0 0 0 0 0 0 90110 128 1 7 0 2 33 0 0 0 0
+
 
+
300002 HEROIC_DEFENSE2 380001 379521 367458 379256 spl_ico_heroic_defense 2 1 0 0 0 40 0 300001 0 4 20 500 3 0 3 1 4 spell_singletarget.ncs 10 90214 244 247 0 0 2 0 0 0 0 0 0 90111 128 1 7 0 2 33 0 0 0 0
+
 
+
300003 HASTE2 380005 379525 398957 379229 spl_ico_agility 2 0 0 0 0 0 60 300002 0 4 30 500 1 1 18 1 2 spell_modal.ncs 30 90216 244 247 0 0 2 0 0 0 0 0 0 90112 192 1 7 0 2 33 0 0 0 10
+
 
+
-------------------------------------------------
+
 
+
NOW HERE IS THE TRICKY PART, MAKE SURE YOU DO THIS RIGHT OR KISS YOUR MODULE GOODBYE
+
 
+
HIGHLIGHT LINE 3 ALL THE WAY DOWN TO 558 (BOTTOM OF THE WORKSHEET)
+
 
+
NOW GOTO DATA --> SORT BY COLUMN S (guitypes)  Now they should all be sorted by guitype
+
 
+
Now we need to seperate the mage spells from our new shaman spells.
+
 
+
For guitype spells 1-4, you need to look at the prereqability section for these spells, for those that have 0, replace with 4023
+
This will make these appear only on the mage from now on. (Which means we need to make seperate skills for our new class)
+
Ok this will now prevent duplicate of skills
+
 
+
HIGHLIGHT LINE 3 ALL THE WAY DOWN TO 558 (BOTTOM OF THE WORKSHEET)
+
 
+
NOW GOTO DATA --> SORT BY COLUMN A (ID)  Now we are back to normal
+
 
+
-------------------------------------------------
+
Now goto passive_abilities
+
 
+
Paste the following at the bottom of the list
+
 
+
9000 HIDDEN_SHAMAN 1 2 4 2 6 1 str +2,mag +2,con +1
+
 
+
Now SAVE your file :)
+
 
+
 
+
------------------------------------
+
open up ALShaman_default.xls
+
------------------------------------
+
 
+
Should look like this
+
 
+
[img width=750 height=394]http://www.damods.com/images/tuts/alshaman.jpg[/img]
+
 
+
===================================================================================
+
COVERTING THE FILES FROM 2DA TO GDA
+
===================================================================================
+
 
+
Create a directory called 2DA on C:, inside that dir create one called override.
+
 
+
In your C:\2da put the following:
+
 
+
2da_base.xls
+
abi_base.xls
+
background.xls
+
cla_base.xls
+
guitypes.xls
+
ALShaman_default.xls
+
 
+
Also: ExcelProcessor.exe from the tool converter in your toolset section.
+
 
+
Next you need to make a batch file to run to convert these.
+
Simply open notepad, copy and paste below and save as convert.bat
+
 
+
C:\2DA\ExcelProcessor.exe 2DA_base.xls -outdir=C:\2DA\override\
+
C:\2DA\ExcelProcessor.exe background.xls -outdir=C:\2DA\override\
+
C:\2DA\ExcelProcessor.exe CLA_base.xls -outdir=C:\2DA\override\
+
C:\2DA\ExcelProcessor.exe ALShaman_Default.xls -outdir=C:\2DA\override\
+
C:\2DA\ExcelProcessor.exe guitypes.xls -outdir=C:\2DA\override\
+
C:\2DA\ExcelProcessor.exe ABI_base.xls -outdir=C:\2DA\override\
+
 
+
NOTE: YOU MAY NEED TO "RUN AS ADMINISTRATOR" CONVERT.BAT IN VISTA / W7
+
 
+
VOILA YOU NOW HAVE YOUR GDA FILES FOR THE MODULE
+
 
+
 
+
===================================================================================
+
NOW WE BEGIN EDITING INSIDE THE TOOLSET
+
===================================================================================
+
 
+
Create a new module, similiar to the picture below
+
 
+
[color=maroon][b]MAKE SURE YOUR STRING SETS GO FROM IN BETWEEN 8,000,000 - 8,300,000
+
IF IT GOES ABOVE THAT RANGE THE STRINGS WILL NOT WORK.
+
BIOWARE HAS ALREADY POSTED ABOUT THIS SQL PROBLEM[/b][/color]
+
 
+
[img width=431 height=812]http://www.damods.com/images/tuts/module1.jpg[/img]
+
 
+
After making it go back to the module screen and select heirarchy and make sure single player is checked
+
 
+
[img width=295 height=365]http://www.damods.com/images/tuts/hier.jpg[/img]
+
 
+
Now that your module is created we need to add the appropriate GDA to the override section.
+
 
+
look in name/mydocuments/bioware/dragonage/addins/modulename
+
 
+
Put these GDA files in: name/mydocuments/bioware/dragonage/addins/modulename/core/override directory
+
 
+
------------------------------------
+
EDITING THE 2DA_CONSTANTS_H FILE ==> under _Core scripts
+
------------------------------------
+
  
 
right click on 2DA_CONSTANTS_H, select CHECK OUT
 
right click on 2DA_CONSTANTS_H, select CHECK OUT
Line 249: Line 134:
 
Go down to the following sections and edit it like below:
 
Go down to the following sections and edit it like below:
  
[img width=490 height=160]http://www.damods.com/images/tuts/constant.jpg[/img]
+
<dascript>
 
+
const int ABILITY_TALENT_HIDDEN_DUELIST = 4030;
[img width=388 height=354]http://www.damods.com/images/tuts/constant2.jpg[/img]
+
const int ABILITY_TALENT_HIDDEN_RANGER = 4029;
 
+
const int ABILITY_TALENT_HIDDEN_REAVER = 4019;
Afterwards on top select SAVE then CHECK IN
+
const int ABILITY_TALENT_HIDDEN_ROGUE = 4020;
 
+
const int ABILITY_TALENT_HIDDEN_SHALE = 4033;
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
+
const int ABILITY_TALENT_HIDDEN_TEMPLAR = 4021;
 
+
const int ABILITY_TALENT_HIDDEN_WARRIOR = 4022;
 
+
const int ABILITY_TALENT_HIDDEN_SHAMAN = 5000;
---------------------------------------------------------------------------
+
const int ABILITY_TALENT_HURLOCK_PROPERTIES = 90080;
EDITING THE gen00pt_class_race_gend FILE ==> under _Global ==> plot scripts
+
const int ABILITY_TALENT_INDOMITABLE = 28;
---------------------------------------------------------------------------
+
</dascript>
  
right click on gen00pt_class_race_gend, select CHECK OUT
+
and
  
Go down and you'll see the following and edit it like below:
+
<dascript>
 +
//Class Constants
 +
const int CLASS_WARRIOR = 1;
 +
const int CLASS_WIZARD = 2;
 +
const int CLASS_ROGUE = 3;
 +
const int CLASS_SHAMAN = 4;
 +
const int CLASS_SHAPESHIFTER = 30;
 +
const int CLASS_SPIRITHEALER = 31;
 +
const int CLASS_CHAMPION = 32;
 +
const int CLASS_TEMPLAR = 33;
 +
const int CLASS_BERSERKER = 34;
 +
const int CLASS_REAVER = 35;
 +
const int CLASS_ARCANE_WARRIOR = 36;
 +
const int CLASS_ASSASSIN = 37;
 +
const int CLASS_BLOOD_MAGE = 38;
 +
const int CLASS_BARD = 39;
 +
const int CLASS_RANGER = 40;
 +
const int CLASS_DUELIST = 41;
 +
const int CLASS_SHALE = 17;
 +
const int CLASS_DOG = 18;
 +
const int CLASS_MONSTER_ANIMAL = 19;
 +
</dascript>
  
[img width=618 height=338]http://www.damods.com/images/tuts/plot.jpg[/img]
+
Please note that the constants for the specializations have been changed; this will require editing of the Achievements gda via an M2DA to correct the displayed data when unlocking specializations. You may also have to recompile one or more of the plot scripts, but I have not been able to test this personally.
  
 
Afterwards on top select SAVE then CHECK IN
 
Afterwards on top select SAVE then CHECK IN
Line 272: Line 178:
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
  
 
+
=== Edit the sys_chargen_h file ===
----------------------------------------------------------
+
Find the sys_chargen_h file under _Systems ==> _Includes
EDITING THE sys_chargen_h ==> under _Systems ==> _Includes
+
----------------------------------------------------------
+
  
 
right click on sys_chargen_h, select CHECK OUT
 
right click on sys_chargen_h, select CHECK OUT
Line 281: Line 185:
 
Go down to the starting skills section and edit it like below:
 
Go down to the starting skills section and edit it like below:
  
[img width=448 height=329]http://www.damods.com/images/tuts/syschar1.jpg[/img]
+
<dascript>
 +
    // -------------------------------------------------------------------------
 +
    // Starting Skills
 +
    // -------------------------------------------------------------------------
 +
    if (nClass == CLASS_WARRIOR)
 +
    {
 +
        _AddAbility(oChar, 100100);
 +
    }
 +
    else if (nClass == CLASS_ROGUE)
 +
    {
 +
        _AddAbility(oChar, ABILITY_SKILL_POISON_1);
 +
    }
 +
    else if (nClass == CLASS_WIZARD)
 +
    {
 +
        _AddAbility(oChar, ABILITY_SKILL_HERBALISM_1);
 +
    }
 +
    else if (nClass == CLASS_SHAMAN)
 +
    {
 +
        _AddAbility(oChar, ABILITY_SKILL_HERBALISM_1);
 +
    }
 +
}
 +
</dascript>
  
 
Next goto starting ability
 
Next goto starting ability
  
[img width=556 height=409]http://www.damods.com/images/tuts/syschar2.jpg[/img]
+
<dascript>
 
+
        // ---------------------------------------------------------------------
 
+
        // Load the starting ability for the background
Next goto  "// Undo Class and Race selection"
+
        // ---------------------------------------------------------------------
 
+
        int nAbility = GetM2DAInt(TABLE_STARTING_EQUIPMENT,"Ability", nIdx);
[img width=750 height=395]http://www.damods.com/images/tuts/syschar5.jpg[/img]
+
        _AddAbility(oCreature, nAbility);
 
+
    }
 
+
    else
Next goto "// enabling proper tactics presets"
+
    {
 
+
        string sTemplate = "default_player.utc";
[img width=750 height=314]http://www.damods.com/images/tuts/syschar6.jpg[/img]
+
        switch (nClass)
 +
        {
 +
            case CLASS_WARRIOR: sTemplate = "default_warrior.utc";
 +
                break;
 +
            case CLASS_ROGUE:  sTemplate = "default_rogue.utc";
 +
                break;
 +
            case CLASS_WIZARD:  sTemplate = "default_wizard.utc";
 +
                break;
 +
            case CLASS_SHAMAN: sTemplate = "default_shaman.utc";
 +
                break;
 +
        }
 +
        LoadItemsFromTemplate(oCreature, sTemplate, TRUE);
 +
    }
 +
}
 +
</dascript>
  
 
Afterwards on top select SAVE then CHECK IN
 
Afterwards on top select SAVE then CHECK IN
  
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 +
=== Edit the sys_chargen file ===
 +
Find the sys_chargen ==> under _Systems
  
 +
right click on sys_chargen, select Duplicate; name the file something like wd_sys_chargen.
  
----------------------------------------------------------
+
Change this line:
EDITING THE sys_rewards_h ==> under _Systems ==> _Includes
+
----------------------------------------------------------
+
  
right click on sys_rewards_h, select CHECK OUT
+
<dascript>
 +
const int MAX_CLASS_INDEX = 4; // Last index of available base classes in cla_base.
 +
</dascript>
 +
This value does not have to be limited to the minimum number of base classes in the file; it simply has to be higher than the default value of 3.
  
Go down to the following section and edit it like below:
+
Go down to the following section and either comment it out as I show it, or delete it; if it is left in place without being commented out, it will cause your class to provide double the attribute points at character creation or level up.
  
[img width=416 height=253]http://www.damods.com/images/tuts/rewards.jpg[/img]
+
<dascript>
 +
        // ---------------------------------------------------------------------
 +
        // This fires whenever the player presses + or - on an attribute to spend
 +
        // points on the attribute screen of character generation
 +
        //
 +
        // int(0) - Constant PROPERTY_* integer
 +
        // int(1) - # of points spent
 +
        // ---------------------------------------------------------------------
 +
        /*case EVENT_TYPE_CHARGEN_ASSIGN_ATTRIBUTES:
 +
        {
 +
            int nAttribute = GetEventInteger(ev,0);
 +
            int nPoints    = GetEventInteger(ev,1);
  
Afterwards on top select SAVE then CHECK IN
+
            // -----------------------------------------------------------------
 +
            // Subtract from available points to spend
 +
            // -----------------------------------------------------------------
 +
            Chargen_ModifyCreaturePropertyBase(oChar, PROPERTY_SIMPLE_ATTRIBUTE_POINTS, IntToFloat(nPoints*-1));
  
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 
  
 +
            // -----------------------------------------------------------------
 +
            // Spend it.
 +
            // -----------------------------------------------------------------
 +
            Chargen_SpendAttributePoints(oChar,nAttribute,nPoints,FALSE);
 +
            break;
 +
        }*/
 +
</dascript>
  
----------------------------------------------------------
+
Go down to the special handling section and edit it like below:
EDITING THE sys_chargen ==> under _Systems
+
----------------------------------------------------------
+
  
right click on sys_chargen, select CHECK OUT
+
<dascript>
 +
// special handling for aluvian
 +
                if (nQuickStart == 0 )
 +
                {
 +
                    Log_Trace(LOG_CHANNEL_CHARACTER,"sys_chargen","Setting default values for player character");
 +
                    int nRandClass = abs((GetLowResTimer()%3)+1);
 +
                    if(nRandClass == CLASS_ROGUE || nRandClass == CLASS_WARRIOR || nRandClass == CLASS_SHAMAN)
 +
                    {
 +
                        _RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_NOBLE );
 +
                        WR_SetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_HUMAN_NOBLE, TRUE);
 +
                    }
 +
                    else // mage
 +
                    {
 +
                        _RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_MAGI );
 +
                        WR_SetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_CIRCLE, TRUE);
 +
                    }
 +
                    Chargen_SetNumTactics(oChar);
 +
                    SetCanLevelUp(oChar,Chargen_HasPointsToSpend(oChar));
  
Change this line:
+
                    SendEventModuleChargenDone("", "");
 +
                }
 +
</dascript>
  
const int MAX_CLASS_INDEX = 4; // Last index of available base classes in cla_base.
+
next go down to the tactics sections and add the following:
 +
<dascript>
 +
                // associate some tactics preset table
 +
                int nPresetTable;
 +
                if(GetCreatureCoreClass(oChar) == CLASS_WARRIOR)
 +
                    nPresetTable = 1; // tank
 +
                else if(GetCreatureCoreClass(oChar) == CLASS_ROGUE)
 +
                    nPresetTable = 2; // damage dealer
 +
                else if(GetCreatureCoreClass(oChar) == CLASS_SHAMAN)
 +
                    nPresetTable = 1; // damage dealer
 +
                else // mage
 +
                    nPresetTable = 5; // nuker
 +
</dascript>
  
Go down to the special handling section and edit it like below:
+
Afterwards on top select SAVE then CHECK IN
  
[img width=750 height=288]http://www.damods.com/images/tuts/syschar3.jpg[/img]
+
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
  
next go down to the tactics sections and add the following:
+
=== Create the module script ===
 +
Create a new script and give it a descriptive name like "loadscript". This script will intercept the Chargen events and redirect them to the custom version of the sys_chargen script you just created. It can also be used to intercept other events if you want to alter other things or add items to a newly created character's inventory. This is a good example of how to use it to add custom items and redirect the chargen to the custom script.
  
[img width=542 height=247]http://www.damods.com/images/tuts/syschar4.jpg[/img]
+
<dascript>
 +
#include "utility_h"
 +
#include "wrappers_h"
 +
#include "events_h"
 +
void main()
 +
{
 +
  event ev  = GetCurrentEvent();
 +
    int nEvent = GetEventType(ev);
 +
    Log_Events("", ev);
 +
    switch (nEvent)
 +
    {
 +
        ////////////////////////////////////////////////////////////////////////
 +
        // Sent by: The engine
 +
        // When: The module loads from a save game, or for the first time. This event can fire more than
 +
        //      once for a single module or game instance.
 +
        ////////////////////////////////////////////////////////////////////////
 +
        case EVENT_TYPE_MODULE_LOAD:
 +
        {
 +
          //Nothing is needed here, unless you are doing other things with your module.
 +
        }
 +
        default:
 +
        {
 +
            // -----------------------------------------------------------------
 +
            // Handle character generation events sent by the engine.
 +
            // -----------------------------------------------------------------
 +
            if ((nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) || nEvent == EVENT_TYPE_PLAYERLEVELUP )
 +
            {
 +
                HandleEvent(ev, R"ld_sys_chargen.ncs");
 +
            }
 +
            else
 +
            {
 +
                Log_Trace(LOG_CHANNEL_EVENTS, GetCurrentScriptName(), Log_GetEventNameById(nEvent) + " (" + ToString(nEvent) + ") *** Unhandled event ***");
 +
            }
 +
            break;
 +
        }
 +
    }
 +
}
 +
</dascript>
  
 
Afterwards on top select SAVE then CHECK IN
 
Afterwards on top select SAVE then CHECK IN
  
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
 +
{{TutorialRef|Script}}
  
 
+
== Creating the UTC template file==
 
+
------------------------------------
+
Creating the UTC TEMPLATE FILE
+
------------------------------------
+
 
+
 
Back in the toolset we need to do the following:
 
Back in the toolset we need to do the following:
  
 
Click on the "creature tab" (red head icon)
 
Click on the "creature tab" (red head icon)
  
Right click on default_mage ==> duplicate
+
Right click on default_player ==> duplicate
 
Do like the following:
 
Do like the following:
  
[img width=377 height=215]http://www.damods.com/images/tuts/dfs1.jpg[/img]
+
[[Image:Class tut dfs1.jpg]]
  
 
Now we need to edit the values and give them some armor and weapons, like so:
 
Now we need to edit the values and give them some armor and weapons, like so:
Line 359: Line 385:
 
Name: Default Male Shaman
 
Name: Default Male Shaman
  
[img width=750 height=570]http://www.damods.com/images/tuts/dfs2.jpg[/img]
+
[[Image:Class tut dfs2.jpg]]
  
Now at the top and click SAVE ==> CHECK IN
+
Now, you need to make one for each race and origin that you wish for the class to be available to (this is how Bioware does it, if you look carefully at the various entries in the backgrounds.xls worksheets); name each one with the following abbreviations for race or origin: hm_noble, hm_mage, dw_comm, dw_noble, elf_city, elf_mage, or elf_dalish (gender is handled automatically by the game, based on race). Making different versions of the template allows each version to have different armor and weapons available to them, which helps them blend into the base game (if you are using it in a module that extends Single Player). Be sure to use the proper names in each location in the backgrounds.xls worksheets or the template will not be displayed when you select the background in the game.
  
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"
+
Now at the top and click SAVE ==> CHECK IN for each template.
 
+
 
+
===================================================================================
+
Using the string editor
+
===================================================================================
+
 
+
Start the String editor and right click and insert.
+
 
+
You will be setting up like this
+
 
+
Table = module talk base
+
Owner = module name
+
TYPE = GUI
+
 
+
8000000 - Shaman
+
8000001 - Shamans
+
8000002 - Shamans commune with spirits to get thier other worldly powers.
+
8000004 - Shaman
+
8000005 - Shaman Male Name
+
8000006 - Shaman Female Name
+
  
When all is said close string editor
+
Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES" for each template.
 +
{{TutorialRef|Designer Resources#Creating new resources|Creature|Exporting a module}}
  
  
===================================================================================
 
Putting it all together
 
===================================================================================
 
  
 +
== Putting it all together ==
 
Up on top ON THE EXPORT TAB  
 
Up on top ON THE EXPORT TAB  
  
Line 401: Line 406:
  
 
"EXPORT TALK TABLE"
 
"EXPORT TALK TABLE"
 
+
{{TutorialRef|Exporting a module}}
 
+
== Cleaning up ==
===================================================================================
+
CLEANING UP
+
===================================================================================
+
 
+
 
DON'T SKIP THIS PART
 
DON'T SKIP THIS PART
  
goto name/mydocuments/bioware/dragonage/packages/core/override/toolset
+
Delete all files in the name/mydocuments/bioware/dragonage/packages/core/override/toolset; these are not needed.
 
+
== Trying it out ==
COPY THE FOLLOWING FILES OVER TO YOUR
+
 
+
name/mydocuments/bioware/dragonage/addins/modulename/core/override/toolset
+
 
+
2da_constant_h.nss
+
gen00pt_class_race_gend.nss
+
sys_chargen_h.nss
+
sys_rewards_h.nss
+
sys_chargen.nss
+
sys_chargen.ncs
+
 
+
Delete the rest in the name/mydocuments/bioware/dragonage/packages/core/override/toolset
+
 
+
 
+
===================================================================================
+
Trying it out
+
===================================================================================
+
 
+
 
Start up your game (It may take a min) and start a new game.
 
Start up your game (It may take a min) and start a new game.
  
Line 440: Line 423:
  
 
Make sure you did not miss ANY ";" or "{ }" as a single one of these missed can destroy the game.
 
Make sure you did not miss ANY ";" or "{ }" as a single one of these missed can destroy the game.
 
+
== Troubleshooting ==
===================================================================================
+
TOUBLESHOOTING
+
===================================================================================
+
 
+
 
MY SPELLS ARE NOT SHOWING UP IN THE CREATION SCREEN, HELP!!
 
MY SPELLS ARE NOT SHOWING UP IN THE CREATION SCREEN, HELP!!
  
======> You may not have sort your ability file back to ID.  It has to be sorted by ID in order to show up.
+
* You may not have sort your ability file back to ID.  It has to be sorted by ID in order to show up.
======> You may not have assigned the new abilities to your new class "5000" in the prereqability column
+
* You may not have assigned the new abilities to your new class "5000" in the prereqability column
  
 +
MY MODEL IS NOT SHOWING UP WHEN I GOTO MALE ==> HUMAN ==> SHAMAN ==> MAGI
  
MY MODEL IS NOT SHOWING UP WHEN I GOTO MALE ==> HUMAN ==> SHAMAN ==> MAGI
+
* It is very likely you did not EXPORT your default_shaman.utc model
 +
* Double check the background file to make sure you are using default_shaman.utc for the template
 +
* Try rebooting your computer.
  
======> It is very likely you did not EXPORT your default_shaman.utc model
+
{{Languages}}
======> Double check the background file to make sure you are using default_shaman.utc for the template
+
[[Category:Character generation]]
======> Ty rebooting your computer.
+
[[Category:Tutorials]]

Latest revision as of 12:52, 11 June 2011

Introduction

Creating a new class in Dragon Age is a fairly complicated process, compounded by the fact that currently there are bugs in the 2DA handling which we must work around till they are fixed by Bioware.

Before going in and editing the files, make sure you know at least the following details for your class

  • Class Name
  • Will it be a magic- or a stamina-based character?
  • Will the new class reuse existing abilities/spells or new ones?
  • What backgrounds will be available for this new class?

For the purpose of the basic tutorial, we will create a new class called Shaman that will be a copy of the Mage and will be available for the Noble origins.

Create the module

Fire up the toolset and create a new module. Let's call it New_Class for this tutorial. Since we want to test this class in the single player campaign, make sure that Single Player is selected in the Extended Module drop-down under Module Properties and the Module Hierarchy includes Single Player as well.

Go to Tools -> String Editor and create the following strings: (for the purposes of this tutorial, I am using stringIDs starting at 15000000. Use whatever stringID is generated in your module)

String ID Text Description
15000000 Shaman Class Name (Singular)
15000001 Shamans Class Name (Plural)
15000002 Shaman is a new class Class Description
15000003 Shaman Class Tooltip
15000004 JohnD Default first name for male character (dwarf)
15000005 JaneD Default first name for female character (dwarf)
15000006 JohnH Default first name for male character (human)
15000007 JaneH Default first name for female character (human)
Arrowblue.png - String editor

Editing 2das

NOTE: DO NOT edit the .xls files present under <Dragon Age install>\tools\source\2DA directly and generate the GDA. Bioware has given us the power of M2DA precisely for this purpose.

  • Create a new empty workbook or copy or rename one of the workbooks from the 2DA folder and delete the existing worksheets. Lets call this New_Class.xls
  • Copy the following worksheets into the the new workbook. Rename all worksheets!!
 CLA_base.xls\CLA_data                 ->   New_Class.xls\CLA_data_nc
 2da_base.xls\M2DA_base                ->   New_Class.xls\M2DA_base_nc
 background.xls\Backgrounds            ->   New_Class.xls\Backgrounds_nc
 background.xls\background_defaults    ->   New_Class.xls\background_defaults_nc
 background.xls\chargen_preload        ->   New_Class.xls\chargen_preload_nc
 ALWizard_default.xls\ALWizard_default ->   New_Class.xls\ALShaman_default
 Achievements.xls\Achievements         ->   New_Class.xls\Achievements_nc
  • Save the workbook New_Class.xls


Edit CLA_data_nc

In the New_Class.xls workbook, navigate to the CLA_data_nc worksheet.

NOTE: The procedure below has to be done because this 2DA is read sequentially and 
adding a class at the end (ID:26 using standard resources) does not generate a unique 
background ID. This section will be modified when Bioware fixes these bugs.

Copy line #4 (Wizard Class with ID:2) and paste it below the Rogue class, moving the subsequent lines one down. Te The important columns to change are:

  • Label: Shaman
  • NameStrref: 15000000 (String ID referencing the class name)
  • PluralStrref: 15000001 (String ID referencing the class in plural)
  • DescStrref: 15000002 (String ID referencing the class description)
  • TooltipStrref: 15000003 (String ID referencing the class description)
  • Icon: classico_spirithealer (You can create a new icon and put that icon's name in here too. For this tutorial, we are reusing the Spirithealer specialization icon)
  • Constant: CLASS_Shaman
  • StartingAbility1: ID of the ability assigned during chargen. We will keep this the same as Mage for now (4023).
  • CharGenLabel: Shaman
Arrowblue.png
- CLA base.xls

Edit M2DA_base_nc

In the New_Class.xls workbook, navigate to the M2DA_base_nc worksheet.
Remove all lines except the first 2 lines.
Add the following:

ID above 1000000 ALShaman_default ALShaman_default


Edit backgrounds_nc

In the New_Class.xls workbook, navigate to the backgrounds_nc worksheet.
Insert a new column after the Mage column and name it Shaman. Since we want to use this class for the Noble Origins, put a 1 against the Noble row. Refer the image below. Backgrounds.jpg
The current design of the backgrounds tab makes it difficult to assign different classes to different races for the Mage and Noble origins. Independent modules can override this backgrounds worksheet completely though they would still have to work within the current GUI limitation of 6 backgrounds.

Edit background_defaults_nc

In the New_Class.xls workbook, navigate to the background_defaults_nc worksheet.
The ID column in this worksheet is populated according to the following formula:

(1000 * Race ID) + (100 * Class ID) + Background ID
Currently, this formula has also been reported to Bioware since this allows for 99 backgrounds 
and requires the Class ID to be in multiples of 100 to yield unique results.

In this tutorial,

  • Dwarf Noble Shaman = (1000 * 1) + (100 * 4) + 5 = 1405
  • Human Noble Shaman = (1000 * 3) + (100 * 4) + 5 = 3405

Change the DefaultNameMale and DefaultNameFemale stringID references to the strings created earlier. The result should look like the image below. We will create the default_shaman.utc and the Ability referenced by the ID 5000000 later in the tutorial. Background defaults nc.jpg

Edit chargen_preload_nc

In the New_Class.xls workbook, navigate to the chargen_preload_nc worksheet.
This sheet lists the character templates to load before the chargen so that the model corresponding to the race/class/origin is shown.
Copy the ID and Template for the new character templates from the background_defaults_nc worksheet.

ID Template
1405 default_shaman.utc
3405 default_shaman.utc


Generate the .GDA file

Open a command prompt and navigate to the <Dragon Age install directory>\tools\ResourceBuild\Processors Execute the following command: excelprocessor.exe New_Class.xls -outdir="<My Documents path>\Bioware\Dragon Age\AddIns\New_Class\module\override"

Editing the scripts

You now need to edit some scripts.

Edit the 2da_constants_h file

find the 2da_constants_h file under Core scripts

right click on 2DA_CONSTANTS_H, select CHECK OUT

Go down to the following sections and edit it like below:

const int ABILITY_TALENT_HIDDEN_DUELIST = 4030;
const int ABILITY_TALENT_HIDDEN_RANGER = 4029;
const int ABILITY_TALENT_HIDDEN_REAVER = 4019;
const int ABILITY_TALENT_HIDDEN_ROGUE = 4020;
const int ABILITY_TALENT_HIDDEN_SHALE = 4033;
const int ABILITY_TALENT_HIDDEN_TEMPLAR = 4021;
const int ABILITY_TALENT_HIDDEN_WARRIOR = 4022;
const int ABILITY_TALENT_HIDDEN_SHAMAN = 5000;
const int ABILITY_TALENT_HURLOCK_PROPERTIES = 90080;
const int ABILITY_TALENT_INDOMITABLE = 28;

and

//Class Constants
const int CLASS_WARRIOR = 1;
const int CLASS_WIZARD = 2;
const int CLASS_ROGUE = 3;
const int CLASS_SHAMAN = 4;
const int CLASS_SHAPESHIFTER = 30;
const int CLASS_SPIRITHEALER = 31;
const int CLASS_CHAMPION = 32;
const int CLASS_TEMPLAR = 33;
const int CLASS_BERSERKER = 34;
const int CLASS_REAVER = 35;
const int CLASS_ARCANE_WARRIOR = 36;
const int CLASS_ASSASSIN = 37;
const int CLASS_BLOOD_MAGE = 38;
const int CLASS_BARD = 39;
const int CLASS_RANGER = 40;
const int CLASS_DUELIST = 41;
const int CLASS_SHALE = 17;
const int CLASS_DOG = 18;
const int CLASS_MONSTER_ANIMAL = 19;

Please note that the constants for the specializations have been changed; this will require editing of the Achievements gda via an M2DA to correct the displayed data when unlocking specializations. You may also have to recompile one or more of the plot scripts, but I have not been able to test this personally.

Afterwards on top select SAVE then CHECK IN

Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"

Edit the sys_chargen_h file

Find the sys_chargen_h file under _Systems ==> _Includes

right click on sys_chargen_h, select CHECK OUT

Go down to the starting skills section and edit it like below:

    // -------------------------------------------------------------------------
    // Starting Skills
    // -------------------------------------------------------------------------
    if (nClass == CLASS_WARRIOR)
    {
        _AddAbility(oChar, 100100);
    }
    else if (nClass == CLASS_ROGUE)
    {
        _AddAbility(oChar, ABILITY_SKILL_POISON_1);
    }
    else if (nClass == CLASS_WIZARD)
    {
        _AddAbility(oChar, ABILITY_SKILL_HERBALISM_1);
    }
    else if (nClass == CLASS_SHAMAN)
    {
        _AddAbility(oChar, ABILITY_SKILL_HERBALISM_1);
    }
}

Next goto starting ability

        // ---------------------------------------------------------------------
        // Load the starting ability for the background
        // ---------------------------------------------------------------------
        int nAbility = GetM2DAInt(TABLE_STARTING_EQUIPMENT,"Ability", nIdx);
        _AddAbility(oCreature, nAbility);
    }
    else
    {
        string sTemplate = "default_player.utc";
        switch (nClass)
        {
            case CLASS_WARRIOR: sTemplate = "default_warrior.utc";
                break;
            case CLASS_ROGUE:   sTemplate = "default_rogue.utc";
                break;
            case CLASS_WIZARD:  sTemplate = "default_wizard.utc";
                break;
            case CLASS_SHAMAN:  sTemplate = "default_shaman.utc";
                break;
        }
        LoadItemsFromTemplate(oCreature, sTemplate, TRUE);
    }
}

Afterwards on top select SAVE then CHECK IN

Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"

Edit the sys_chargen file

Find the sys_chargen ==> under _Systems

right click on sys_chargen, select Duplicate; name the file something like wd_sys_chargen.

Change this line:

const int MAX_CLASS_INDEX = 4; // Last index of available base classes in cla_base.

This value does not have to be limited to the minimum number of base classes in the file; it simply has to be higher than the default value of 3.

Go down to the following section and either comment it out as I show it, or delete it; if it is left in place without being commented out, it will cause your class to provide double the attribute points at character creation or level up.

        // ---------------------------------------------------------------------
        // This fires whenever the player presses + or - on an attribute to spend
        // points on the attribute screen of character generation
        //
        // int(0) - Constant PROPERTY_* integer
        // int(1) - # of points spent
        // ---------------------------------------------------------------------
        /*case EVENT_TYPE_CHARGEN_ASSIGN_ATTRIBUTES:
        {
            int nAttribute = GetEventInteger(ev,0);
            int nPoints    = GetEventInteger(ev,1);
 
            // -----------------------------------------------------------------
            // Subtract from available points to spend
            // -----------------------------------------------------------------
            Chargen_ModifyCreaturePropertyBase(oChar, PROPERTY_SIMPLE_ATTRIBUTE_POINTS, IntToFloat(nPoints*-1));
 
 
            // -----------------------------------------------------------------
            // Spend it.
            // -----------------------------------------------------------------
            Chargen_SpendAttributePoints(oChar,nAttribute,nPoints,FALSE);
            break;
        }*/

Go down to the special handling section and edit it like below:

// special handling for aluvian
                if (nQuickStart == 0 )
                {
                    Log_Trace(LOG_CHANNEL_CHARACTER,"sys_chargen","Setting default values for player character");
                    int nRandClass = abs((GetLowResTimer()%3)+1);
                    if(nRandClass == CLASS_ROGUE || nRandClass == CLASS_WARRIOR || nRandClass == CLASS_SHAMAN)
                    {
                        _RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_NOBLE );
                        WR_SetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_HUMAN_NOBLE, TRUE);
                    }
                    else // mage
                    {
                        _RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_MAGI );
                        WR_SetPlotFlag(PLT_GEN00PT_BACKGROUNDS, GEN_BACK_CIRCLE, TRUE);
                    }
                    Chargen_SetNumTactics(oChar);
                    SetCanLevelUp(oChar,Chargen_HasPointsToSpend(oChar));
 
                    SendEventModuleChargenDone("", "");
                }

next go down to the tactics sections and add the following:

                // associate some tactics preset table
                int nPresetTable;
                if(GetCreatureCoreClass(oChar) == CLASS_WARRIOR)
                    nPresetTable = 1; // tank
                else if(GetCreatureCoreClass(oChar) == CLASS_ROGUE)
                    nPresetTable = 2; // damage dealer
                else if(GetCreatureCoreClass(oChar) == CLASS_SHAMAN)
                    nPresetTable = 1; // damage dealer
                else // mage
                    nPresetTable = 5; // nuker

Afterwards on top select SAVE then CHECK IN

Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"

Create the module script

Create a new script and give it a descriptive name like "loadscript". This script will intercept the Chargen events and redirect them to the custom version of the sys_chargen script you just created. It can also be used to intercept other events if you want to alter other things or add items to a newly created character's inventory. This is a good example of how to use it to add custom items and redirect the chargen to the custom script.

#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
   event ev   = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    Log_Events("", ev);
    switch (nEvent)
    {
        ////////////////////////////////////////////////////////////////////////
        // Sent by: The engine
        // When: The module loads from a save game, or for the first time. This event can fire more than
        //       once for a single module or game instance.
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_MODULE_LOAD:
        {
           //Nothing is needed here, unless you are doing other things with your module.
        }
        default:
        {
            // -----------------------------------------------------------------
            // Handle character generation events sent by the engine.
            // -----------------------------------------------------------------
            if ((nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) || nEvent == EVENT_TYPE_PLAYERLEVELUP )
            {
                HandleEvent(ev, R"ld_sys_chargen.ncs");
            }
            else
            {
                Log_Trace(LOG_CHANNEL_EVENTS, GetCurrentScriptName(), Log_GetEventNameById(nEvent) + " (" + ToString(nEvent) + ") *** Unhandled event ***");
            }
            break;
        }
    }
}

Afterwards on top select SAVE then CHECK IN

Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES"

Arrowblue.png - Script

Creating the UTC template file

Back in the toolset we need to do the following:

Click on the "creature tab" (red head icon)

Right click on default_player ==> duplicate Do like the following:

Class tut dfs1.jpg

Now we need to edit the values and give them some armor and weapons, like so:

Class: Shaman (from dropdown) Name: Default Male Shaman

Class tut dfs2.jpg

Now, you need to make one for each race and origin that you wish for the class to be available to (this is how Bioware does it, if you look carefully at the various entries in the backgrounds.xls worksheets); name each one with the following abbreviations for race or origin: hm_noble, hm_mage, dw_comm, dw_noble, elf_city, elf_mage, or elf_dalish (gender is handled automatically by the game, based on race). Making different versions of the template allows each version to have different armor and weapons available to them, which helps them blend into the base game (if you are using it in a module that extends Single Player). Be sure to use the proper names in each location in the backgrounds.xls worksheets or the template will not be displayed when you select the background in the game.

Now at the top and click SAVE ==> CHECK IN for each template.

Now at the top and click "EXPORT WITHOUT DEPENDENT RESOURCES" for each template.

Arrowblue.png - Designer Resources#Creating new resources
- Creature
- Exporting a module


Putting it all together

Up on top ON THE EXPORT TAB

"EXPORT WITHOUT DEPENDENT RESOURCES"

"GENERATE MODULE XML"

"GENERATE MANIFEST XML"

"EXPORT TALK TABLE"

Arrowblue.png - Exporting a module

Cleaning up

DON'T SKIP THIS PART

Delete all files in the name/mydocuments/bioware/dragonage/packages/core/override/toolset; these are not needed.

Trying it out

Start up your game (It may take a min) and start a new game.

  • WARNING* IF ANYTHING HAS GONE WRONG HERE YOUR GAME WILL BE SEVERELY DAMAGED

Select MALE ==> HUMAN ==> SHAMAN ==> MAGI

YOU SHOULD SEE YOUR NEW CHARACTER

IF SOMETHING HAPPENED QUIT AND DOUBLE CHECK YOUR STEPS

Make sure you did not miss ANY ";" or "{ }" as a single one of these missed can destroy the game.

Troubleshooting

MY SPELLS ARE NOT SHOWING UP IN THE CREATION SCREEN, HELP!!

  • You may not have sort your ability file back to ID. It has to be sorted by ID in order to show up.
  • You may not have assigned the new abilities to your new class "5000" in the prereqability column

MY MODEL IS NOT SHOWING UP WHEN I GOTO MALE ==> HUMAN ==> SHAMAN ==> MAGI

  • It is very likely you did not EXPORT your default_shaman.utc model
  • Double check the background file to make sure you are using default_shaman.utc for the template
  • Try rebooting your computer.


Language: English  • 中文