http://www.datoolset.net/mw/api.php?action=feedcontributions&user=Sunjammer&feedformat=atomDragon Age Toolset Wiki - User contributions [en]2024-03-29T06:03:00ZUser contributionsMediaWiki 1.25.6http://www.datoolset.net/mw/index.php?title=Main_Page&diff=19986Main Page2022-02-01T17:01:01Z<p>Sunjammer: Updated links, formated text, removed v1.00 info</p>
<hr />
<div>__NOTOC__<br />
<big>'''Welcome to the Dragon Age Toolset documentation wiki!'''</big><br />
<br />
The Dragon Age Toolset puts the power of the game developer in the palm of your hands. The Dragon Age Toolset will allow you to produce your own content including dungeons crawls, full-length campaigns, add-ons and cut-scenes you can share with friends and the BioWare community. <br />
<br />
You can [http://lvlt.bioware.cdn.ea.com/bioware/u/f/eagames/bioware/dragonage/toolset/DragonAgeToolset1.01Setup.exe click here] to download Dragon Age Toolset v1.01 from the Bioware CDN.<br />
<br />
For assistance with installing or running the game, or for issues regarding BioWare-published content, see the [https://dragonagekeep.com/ Dragon Age Keep].<br />
<br />
{| width="100%"<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%" |<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Getting Started]] <div style="float:right; font-size:x-small;">([[Getting Started|link]])</div></h2><br />
<br />
<div style="margin:0; background: #f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; float:right; font-size:x-small;"><br />
* [[Creating an account]]<br />
* [[Installing the toolset]]<br />
* [[Installation troubleshooting]]<br />
* [[Overview of the toolset]]<br />
</div><br />
<br />
The toolset can be very daunting to dive into at first. This section covers topics useful to new users - how to get the toolset set up, how to navigate its interfaces, and where to look to get started on common tasks.<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%" |<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Tutorials]] <div style="float:right; font-size:x-small;">([[Tutorials|link]])</div></h2><br />
<br />
This section contains a list of step-by-step tutorials for a wide variety of editors and tasks you might need to do. Note that these tutorials will also be linked to from the sections that cover their respective subject matter; this is just to collect them all into one place for ease of reference.<br />
<br />
|-<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Design]] <div style="float:right; font-size:x-small;">([[Design|link]])</div></h2><br />
<br />
Once you have the pieces you need for an adventure - level layouts, creatures, abilities, and so forth - there's still the step of putting it all together into a playable game. This involves placing resources into areas, hooking up plots, and all sorts of other miscellaneous tasks. <br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%; " valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Art]] <div style="float:right; font-size:x-small;">([[Art|link]])</div></h2><br />
<br />
This section covers such things as how to import new models into the game, how to design level layouts, and how to create unique head morphs for NPCs. You can download the art sources for the main campaign from [http://social.bioware.com/project/1331/#files the Single player and core resource source files] project.<br />
<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Cinematography]] <div style="float:right; font-size:x-small;">([[Cinematography|link]])</div></h2><br />
<br />
Dragon Age is a heavily cinematics-oriented game. Every line in every conversation has the potential to be written as a full-blown cutscene, though in most cases a simpler treatment is perfectly adequate. Cutscenes can also be created independent of any conversation, to be triggered by script at appropriate moments.<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Sound and music]] <div style="float:right; font-size:x-small;">([[Sound and music|link]])</div> </h2><br />
<br />
Sounds are used in Dragon Age in a variety of ways. Voice over, background music, the sounds of combat and spells, ambient noises placed throughout areas or triggered by scripts and player actions, are all covered in this section.<br />
<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Script]] <div style="float:right; font-size:x-small;">([[Script|link]])</div></h2><br />
<br />
Scripting is used whenever the designers need control over the game's behaviour. The syntax for DA scripts is very similar to the C programming language. Scripting is commonly used to:<br />
* Trigger plot events <br />
* Create or modify abilities - skills, talents, and spells <br />
* Handle creature and party member AI<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[3rd party extensions]] <div style="float:right; font-size:x-small;">([[3rd party extensions|link]])</div></h2><br />
<br />
The toolset released by BioWare doesn't cover every possible task that might be needed by the end user. This section covers third-party tools that don't easily fall under other subject areas covered by the toolset.<br />
<br />
|}<br />
<br />
* Also see [[technical information]] for a list of documents about the more in-depth technical workings of the toolset and of Dragon Age: Origins.<br />
<br />
== Editing this wiki ==<br />
<br />
The documentation for the toolset is still being worked on so some of the material here may be incomplete or somewhat out-of-date. If you wish to contribute (either by adding your own material or by highlighting holes) you are most welcome to jump right in and edit. If you see something that needs improvement but you're not sure how (or you just don't have the time) you can mark it by adding "<nowiki>{{undocumented}}</nowiki>" at the trouble spot.<br />
*The '''[http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide]''' has information on how to edit this wiki. This wiki is powered by the MediaWiki engine.<br />
*[[GeSHi highlighting]] is installed, including "nwscript" and "dascript" tags.<br />
<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Placeables_with_codex_entries_tutorial_(draft)&diff=19950User:Sunjammer/Placeables with codex entries tutorial (draft)2020-04-27T16:37:20Z<p>Sunjammer: Created</p>
<hr />
<div><br />
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])<br />
** Set the plot type to one with a "Codex - " prefix<br />
** Add a single Main Flag: remember the number (usually 0 as it is the only flag)<br />
* Create a placeable and place it in an area<br />
* Open the [[Placeable#Variables|placeable's variables]]<br />
* Set PLC_CODEX_PLOT to the name of the plot resource<br />
* Set PLC_CODEX_FLAG to the number of the plot flag<br />
<br />
When the Player examines the placeable it triggers EVENT_TYPE_USE event<br />
<br />
The default behaviour (routed through the [[placeable_core script]]) is perfectly adequate.<br />
<br />
When the Player clicks on the placeable the following script runs:<br />
<br />
<dascript><br />
void Placeable_ShowCodexEntry(object oPlc)<br />
{<br />
string sCodexPlot = GetLocalString(oPlc, PLC_CODEX_PLOT);<br />
int nCodexFlag = GetLocalInt(oPlc, PLC_CODEX_FLAG);<br />
<br />
if (sCodexPlot != "" && nCodexFlag >= 0)<br />
{<br />
string sSummary = GetPlotSummary(sCodexPlot, nCodexFlag);<br />
<br />
// :<br />
<br />
if (!WR_GetPlotFlag(sCodexPlot, nCodexFlag))<br />
{<br />
WR_SetPlotFlag(sCodexPlot, nCodexFlag, TRUE, TRUE);<br />
RewardXPParty(XP_CODEX, XP_TYPE_CODEX, OBJECT_INVALID, GetHero());<br />
}<br />
UI_DisplayCodexMessage(oPlc, sSummary);<br />
SetObjectInteractive(oPlc, FALSE);<br />
}<br />
}<br />
</dascript></div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&diff=19949User:Sunjammer/Items with codex entries tutorial (draft)2020-04-27T16:37:09Z<p>Sunjammer: Editing</p>
<hr />
<div>This tutorial illustrates how to create [[items with codex entries tutorial|items with codex entries]] for both a new standalone module or an extension to the [[Single Player Campaign]]. Additionally it will show you how to destroy, or avoid destroying, the item once the codex entry has been created.<br />
<br />
== Goal ==<br />
<br />
The goal of this tutorial is to create two items that with codex entries. The first, a book, will be automatically removed from the Player's inventory and destroyed. The second, a longsword, will remain in the Player's inventory so they can use it.<br />
<br />
<br />
This tutorial assumes, you are familiar with creating a standalone module or an extension to the Single Player Campaign and is only focused on the steps and explaining the considerations surrounding creating items with codex entries.<br />
<br />
This process shares some similarities with, but is more complex than, creating placeables with codex entries.<br />
<br />
<br />
== Steps ==<br />
<br />
<br />
The the initial steps are the same regardless of whether you are creating a standalone module or an extension to the Single Player Campaign.<br />
<br />
<br />
<br />
* Create the book item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])<br />
* Create the longsword item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
*[[Item#Variables|item's variables]]<br />
<br />
== Scripting ==<br />
<br />
== Standalone module ==<br />
<br />
If your module is still using [[module_core]] as it's module script then open the module's properties and create a new module script:<br />
* Select the '''File > Manage Modules''' menu option<br />
* In the '''Manage Modules''' window, select your module (if not already selected)<br />
* Click the '''Properties...''' button<br />
* In the '''Object Inspector''' window, select the '''Script''' property<br />
* Click the '''Browse''' ([[File:Ellipsis.png]]) button<br />
* In the Resource Open/Save window, click the New button<br />
* [[File:Create_new_resource.png]]<br />
* Enter the <br />
<br />
<br />
and assign a new script, for example, xx_codex_module. <br />
<br />
Open the new script in the [[Script editor window|Script Editor]] and double click on the <br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Raise the "event handled" flag to prevent the default script running for<br />
// this item and event.<br />
nEventHandled = TRUE;<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
Since we are using the standard module script template we don't have to<br />
<br />
<br />
<dascript><br />
if(!nEventHandled)<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);<br />
}<br />
</dascript><br />
<br />
- why we can't fall through <br />
<br />
module_core:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
<br />
// [ignoring some code here]<br />
<br />
int nCodexItem = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if (nCodexItem > -1 && IsFollower(oAcquirer))<br />
{<br />
<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "Got a codex item: " + GetTag(oItem));<br />
WR_SetPlotFlag(GetTag(oItem), nCodexItem, TRUE, TRUE);<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
// [ignoring some code here]<br />
<br />
break;<br />
}<br />
</dascript><br />
<br />
<br />
<br />
== Single Player Campaign ==<br />
<br />
Normally for a module extending the Single Player Campaign we don't need<br />
<br />
=== Considerations ===<br />
<br />
sp_module:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED);<br />
bEventHandled = TRUE;<br />
break;<br />
}<br />
</dascript><br />
<br />
sp_module_item_acq:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
:<br />
<br />
else if(sItemTag == "gen_im_acc_rng_bld")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BLOOD_RING, COD_ITM_BLOOD_RING, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_wep_rng_lbw_sun")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BOW_GOLDEN_SUN, COD_ITM_BOW_GOLDEN_SUN, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_acc_amu_am6")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_LIFE_DRINKER, COD_ITM_LIFE_DRINKER, TRUE, TRUE);<br />
}<br />
<br />
:<br />
<br />
}<br />
</dascript><br />
<br />
There's no catch all. There's no fall through. So if we're extending the Single Player Campaign we're on our own!<br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_book" || sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Do we want the item to persist? If not then we can delete it here.<br />
if(sItem == "xx_codex_itm_book") <br />
{<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
== See also ==<br />
<br />
* TODO<br />
<br />
[[Category:Items]]<br />
[[Category:Tutorials]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer&diff=19948User:Sunjammer2020-04-27T16:04:44Z<p>Sunjammer: Added link</p>
<hr />
<div>Community Code Monkey<br />
<br />
== Work in progress ==<br />
<br />
* [[/90210|90210]]<br />
* [[/Abrigand's Arena of Agony|Abrigand's Arena of Agony]]<br />
* [[/Item_upgrades_(draft)|Item upgrades (draft)]]<br />
* [[/Items_with_codex_entries_tutorial_(draft)|Items with codex entries tutorial (draft)]]<br />
* [[/Move resources (draft)|Move resources (draft)]]<br />
* [[/Operator (draft)|Operator (draft)]]<br />
* [[/Placeables with codex entries tutorial (draft)|Placeables with codex entries tutorial (draft)]]<br />
* [[/Plot_flags_(draft)|Plot flags (draft)]]<br />
* [[/Struct keyword (draft)|Struct keyword (draft)]]<br />
<br />
== Tests ==<br />
<br />
* [[/Wiki extensions test]]<br />
* [[/Main Page]]<br />
<br />
== To Do List ==<br />
{{ToDoList|Sunjammer}}<br />
<br />
* [[:Category:Keywords|Keywords]] & [[Keyword]]<br />
* [[:Category:Directives|Directives]] & [[Directive]]<br />
* [[:Category:Operators|Operators]] & [[Operator]]<br />
* [[:Category:Core scripts|Core scripts]]<br />
* [[:Category:Broken functions|Broken functions]]<br />
* [[Itemproperty keyword]]<br />
<br />
<br />
* [[Special:WantedCategories|Wanted categories]]<br />
* [[Special:WantedPages|Wanted pages]]<br />
<br />
<br />
<DynamicPageList><br />
category = Category:2da files from ABI base.xls<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
* confirm common root for M2DA_base m2da files<br />
* update links in all 2da files<br />
* make formatting consistent<br />
* remove negative assertions<br />
<br />
<DynamicPageList><br />
category = Include files<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = 2da types<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = Maintenance<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
* New Tutorial Navigation icons</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19947Compiler error message2020-04-27T00:27:24Z<p>Sunjammer: Added error</p>
<hr />
<div>{{Infobox script}}<br />
<br />
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying to understand compiler error message:<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
== Errors == <br />
The following is a list of compiler error messages that have been encountered and what caused them. It is important to be aware that the listed cause(s) may not be the ''only'' cause(s) for a particular error and therefore should be viewed as examples rather than definitions.<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [example].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
;Duplicate function implementation (<function>)<br />
: Two functions with the same name exist.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [example].<br />
<br />
=== <span id="F">F</span> ===<br />
;Function definition missing parameter list<br />
:The brackets were omitted when defining a function.<br />
<!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled directly (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<br />
;Invalid declaration type<br />
:The brackets were omitted when declaring a function.<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
;Multiple case constant statements within switch<br />
:Two or more <code>case</code> statements are using the same value. This could be due to the same symbolic constant or literal value being used multiple times, or a literal and a constant with the same value being used.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [example].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
;No semicolon after structure<br />
# The statement terminator (;) is missing from the end of a structure definition.<br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[struct keyword|struct]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<br />
;Void expression where non void required<br />
: Assigned a member of a [[vector]] which was itself a member of a [[struct keyword|struct]] to a variable.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --><br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&diff=19946User:Sunjammer/Items with codex entries tutorial (draft)2020-04-27T00:19:59Z<p>Sunjammer: </p>
<hr />
<div>This tutorial illustrates how to create [[items with codex entries tutorial|items with codex entries]] for both a new standalone module or an extension to the [[Single Player Campaign]]. Additionally it will show you how to destroy, or avoid destroying, the item once the codex entry has been created.<br />
<br />
== Background ==<br />
<br />
This tutorial assumes, you are familiar with creating a standalone module or an extension to the Single Player Campaign and is only focused on the steps and explaining the considerations surrounding creating items with codex entries.<br />
<br />
This process shares some similarities with, but is more complex than, creating placeables with codex entries.<br />
<br />
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])<br />
** Set the plot type to one with a "Codex - " prefix<br />
** Add a single Main Flag: remember the number (usually 0 as it is the only flag)<br />
* Create a placeable and place it in an area<br />
* Open the [[Placeable#Variables|placeable's variables]]<br />
* Set PLC_CODEX_PLOT to the name of the plot resource<br />
* Set PLC_CODEX_FLAG to the number of the plot flag<br />
<br />
When the Player clicks on the placeable the following script runs:<br />
<br />
<dascript><br />
void Placeable_ShowCodexEntry(object oPlc)<br />
{<br />
string sCodexPlot = GetLocalString(oPlc, PLC_CODEX_PLOT);<br />
int nCodexFlag = GetLocalInt(oPlc, PLC_CODEX_FLAG);<br />
<br />
if (sCodexPlot != "" && nCodexFlag >= 0)<br />
{<br />
string sSummary = GetPlotSummary(sCodexPlot, nCodexFlag);<br />
<br />
// :<br />
<br />
if (!WR_GetPlotFlag(sCodexPlot, nCodexFlag))<br />
{<br />
WR_SetPlotFlag(sCodexPlot, nCodexFlag, TRUE, TRUE);<br />
RewardXPParty(XP_CODEX, XP_TYPE_CODEX, OBJECT_INVALID, GetHero());<br />
}<br />
UI_DisplayCodexMessage(oPlc, sSummary);<br />
SetObjectInteractive(oPlc, FALSE);<br />
}<br />
}<br />
</dascript><br />
<br />
<br />
== Goal ==<br />
<br />
The goal of this tutorial is to create two items that with codex entries. The first, a book, will be automatically removed from the Player's inventory and destroyed. The second, a longsword, will remain in the Player's inventory so they can use it.<br />
<br />
== Set up ==<br />
<br />
The the initial steps are the same regardless of whether you are creating a standalone module or an extension to the Single Player Campaign.<br />
<br />
* Create the book item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
* Create a plot<br />
* Create the longsword item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
*[[Item#Variables|item's variables]]<br />
<br />
<br />
== Standalone module ==<br />
<br />
=== Considerations ===<br />
<br />
<dascript><br />
if(!nEventHandled)<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);<br />
}<br />
</dascript><br />
<br />
- why we can't fall through <br />
<br />
module_core:<br />
<br />
<dascript><br />
<br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
<br />
:<br />
<br />
int nCodexItem = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if (nCodexItem > -1 && IsFollower(oAcquirer))<br />
{<br />
<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "Got a codex item: " + GetTag(oItem));<br />
WR_SetPlotFlag(GetTag(oItem), nCodexItem, TRUE, TRUE);<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
:<br />
<br />
break;<br />
}<br />
<br />
<br />
<br />
</dascript><br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Raise the "event handled" flag to prevent the default script running for<br />
// this item and event.<br />
nEventHandled = TRUE;<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
<br />
== Single Player Campaign ==<br />
<br />
Normally for a module extending the Single Player Campaign we don't need<br />
<br />
=== Considerations ===<br />
<br />
sp_module:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED);<br />
bEventHandled = TRUE;<br />
break;<br />
}<br />
</dascript><br />
<br />
sp_module_item_acq:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
:<br />
<br />
else if(sItemTag == "gen_im_acc_rng_bld")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BLOOD_RING, COD_ITM_BLOOD_RING, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_wep_rng_lbw_sun")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BOW_GOLDEN_SUN, COD_ITM_BOW_GOLDEN_SUN, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_acc_amu_am6")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_LIFE_DRINKER, COD_ITM_LIFE_DRINKER, TRUE, TRUE);<br />
}<br />
<br />
:<br />
<br />
}<br />
</dascript><br />
<br />
There's no catch all. There's no fall through. So if we're extending the Single Player Campaign we're on our own!<br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_book" || sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Do we want the item to persist? If not then we can delete it here.<br />
if(sItem == "xx_codex_itm_book") <br />
{<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
== See also ==<br />
<br />
* TODO<br />
<br />
[[Category:Items]]<br />
[[Category:Tutorials]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&diff=19945User:Sunjammer/Items with codex entries tutorial (draft)2020-04-27T00:17:33Z<p>Sunjammer: Added Categories</p>
<hr />
<div>This tutorial illustrates how to create [[items with codex entries tutorial|items with codex entries]] for both a new standalone module or an extension to the [[Single Player Campaign]]. Additionally it will show you how to destroy, or avoid destroying, the item once the codex entry has been created.<br />
<br />
== Background ==<br />
<br />
This tutorial assumes, you are familiar with creating a standalone module or an extension to the Single Player Campaign and is only focused on the steps and explaining the considerations surrounding creating items with codex entries.<br />
<br />
This process shares some similarities with, but is more complex than, creating placeables with codex entries.<br />
<br />
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])<br />
** Set the plot type to one with a "Codex - " prefix<br />
** Add a single Main Flag: remember the number (usually 0 as it is the only flag)<br />
* Create a placeable and place it in an area<br />
* Open the [[Placeable#Variables|placeable's variables]]<br />
* Set PLC_CODEX_PLOT to the name of the plot resource<br />
* Set PLC_CODEX_FLAG to the number of the plot flag<br />
<br />
When the Player clicks on the placeable the following script runs:<br />
<br />
<dascript><br />
void Placeable_ShowCodexEntry(object oPlc)<br />
{<br />
string sCodexPlot = GetLocalString(oPlc, PLC_CODEX_PLOT);<br />
int nCodexFlag = GetLocalInt(oPlc, PLC_CODEX_FLAG);<br />
<br />
if (sCodexPlot != "" && nCodexFlag >= 0)<br />
{<br />
string sSummary = GetPlotSummary(sCodexPlot, nCodexFlag);<br />
<br />
// :<br />
<br />
if (!WR_GetPlotFlag(sCodexPlot, nCodexFlag))<br />
{<br />
WR_SetPlotFlag(sCodexPlot, nCodexFlag, TRUE, TRUE);<br />
RewardXPParty(XP_CODEX, XP_TYPE_CODEX, OBJECT_INVALID, GetHero());<br />
}<br />
UI_DisplayCodexMessage(oPlc, sSummary);<br />
SetObjectInteractive(oPlc, FALSE);<br />
}<br />
}<br />
</dascript><br />
<br />
<br />
== Goal ==<br />
<br />
The goal of this tutorial is to create two items that with codex entries. The first, a book, will be automatically removed from the Player's inventory and destroyed. The second, a longsword, will remain in the Player's inventory so they can use it.<br />
<br />
== Set up ==<br />
<br />
The the initial steps are the same regardless of whether you are creating a standalone module or an extension to the Single Player Campaign.<br />
<br />
* Create the book item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
* Create a plot<br />
* Create the longsword item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
*[[Item#Variables|item's variables]]<br />
<br />
<br />
== Standalone module ==<br />
<br />
=== Considerations ===<br />
<br />
<dascript><br />
if(!nEventHandled)<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);<br />
}<br />
</dascript><br />
<br />
- why we can't fall through <br />
<br />
module_core:<br />
<br />
<dascript><br />
<br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
<br />
:<br />
<br />
int nCodexItem = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if (nCodexItem > -1 && IsFollower(oAcquirer))<br />
{<br />
<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "Got a codex item: " + GetTag(oItem));<br />
WR_SetPlotFlag(GetTag(oItem), nCodexItem, TRUE, TRUE);<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
:<br />
<br />
break;<br />
}<br />
<br />
<br />
<br />
</dascript><br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Raise the "event handled" flag to prevent the default script running for<br />
// this item and event.<br />
nEventHandled = TRUE;<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
<br />
== Single Player Campaign ==<br />
<br />
Normally for a module extending the Single Player Campaign we don't need<br />
<br />
=== Considerations ===<br />
<br />
sp_module:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED);<br />
bEventHandled = TRUE;<br />
break;<br />
}<br />
</dascript><br />
<br />
sp_module_item_acq:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
:<br />
<br />
else if(sItemTag == "gen_im_acc_rng_bld")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BLOOD_RING, COD_ITM_BLOOD_RING, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_wep_rng_lbw_sun")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BOW_GOLDEN_SUN, COD_ITM_BOW_GOLDEN_SUN, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_acc_amu_am6")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_LIFE_DRINKER, COD_ITM_LIFE_DRINKER, TRUE, TRUE);<br />
}<br />
<br />
:<br />
<br />
}<br />
</dascript><br />
<br />
There's no catch all. There's no fall through. So if we're extending the Single Player Campaign we're on our own!<br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Debug.<br />
PrintToLog("------> MODULE CAMPAIGN ITEM ACQUIRED: " + sItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_book" || sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Do we want the item to persist? If not then we can delete it here.<br />
if(sItem == "xx_codex_itm_book") <br />
{<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
== See also ==<br />
<br />
* TODO<br />
<br />
[[Category:Items]]<br />
[[Category:Tutorials]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&diff=19944User:Sunjammer/Items with codex entries tutorial (draft)2020-04-27T00:13:35Z<p>Sunjammer: Created</p>
<hr />
<div>This tutorial illustrates how to create [[items with codex entries tutorial|items with codex entries]] for both a new standalone module or an extension to the [[Single Player Campaign]]. Additionally it will show you how to destroy, or avoid destroying, the item once the codex entry has been created.<br />
<br />
== Background ==<br />
<br />
This tutorial assumes, you are familiar with creating a standalone module or an extension to the Single Player Campaign and is only focused on the steps and explaining the considerations surrounding creating items with codex entries.<br />
<br />
This process shares some similarities with, but is more complex than, creating placeables with codex entries.<br />
<br />
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])<br />
** Set the plot type to one with a "Codex - " prefix<br />
** Add a single Main Flag: remember the number (usually 0 as it is the only flag)<br />
* Create a placeable and place it in an area<br />
* Open the [[Placeable#Variables|placeable's variables]]<br />
* Set PLC_CODEX_PLOT to the name of the plot resource<br />
* Set PLC_CODEX_FLAG to the number of the plot flag<br />
<br />
When the Player clicks on the placeable the following script runs:<br />
<br />
<dascript><br />
void Placeable_ShowCodexEntry(object oPlc)<br />
{<br />
string sCodexPlot = GetLocalString(oPlc, PLC_CODEX_PLOT);<br />
int nCodexFlag = GetLocalInt(oPlc, PLC_CODEX_FLAG);<br />
<br />
if (sCodexPlot != "" && nCodexFlag >= 0)<br />
{<br />
string sSummary = GetPlotSummary(sCodexPlot, nCodexFlag);<br />
<br />
// :<br />
<br />
if (!WR_GetPlotFlag(sCodexPlot, nCodexFlag))<br />
{<br />
WR_SetPlotFlag(sCodexPlot, nCodexFlag, TRUE, TRUE);<br />
RewardXPParty(XP_CODEX, XP_TYPE_CODEX, OBJECT_INVALID, GetHero());<br />
}<br />
UI_DisplayCodexMessage(oPlc, sSummary);<br />
SetObjectInteractive(oPlc, FALSE);<br />
}<br />
}<br />
</dascript><br />
<br />
<br />
== Goal ==<br />
<br />
The goal of this tutorial is to create two items that with codex entries. The first, a book, will be automatically removed from the Player's inventory and destroyed. The second, a longsword, will remain in the Player's inventory so they can use it.<br />
<br />
== Set up ==<br />
<br />
The the initial steps are the same regardless of whether you are creating a standalone module or an extension to the Single Player Campaign.<br />
<br />
* Create the book item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
* Create a plot<br />
* Create the longsword item and set it's tag to something unique, e.g. xx_codex_itm_book<br />
*[[Item#Variables|item's variables]]<br />
<br />
<br />
== Standalone module ==<br />
<br />
=== Considerations ===<br />
<br />
<dascript><br />
if(!nEventHandled)<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);<br />
}<br />
</dascript><br />
<br />
- why we can't fall through <br />
<br />
module_core:<br />
<br />
<dascript><br />
<br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
<br />
:<br />
<br />
int nCodexItem = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if (nCodexItem > -1 && IsFollower(oAcquirer))<br />
{<br />
<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "Got a codex item: " + GetTag(oItem));<br />
WR_SetPlotFlag(GetTag(oItem), nCodexItem, TRUE, TRUE);<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
:<br />
<br />
break;<br />
}<br />
<br />
<br />
<br />
</dascript><br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Raise the "event handled" flag to prevent the default script running for<br />
// this item and event.<br />
nEventHandled = TRUE;<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript><br />
<br />
<br />
== Single Player Campaign ==<br />
<br />
Normally for a module extending the Single Player Campaign we don't need<br />
<br />
=== Considerations ===<br />
<br />
sp_module:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED);<br />
bEventHandled = TRUE;<br />
break;<br />
}<br />
</dascript><br />
<br />
sp_module_item_acq:<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
:<br />
<br />
else if(sItemTag == "gen_im_acc_rng_bld")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BLOOD_RING, COD_ITM_BLOOD_RING, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_wep_rng_lbw_sun")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_BOW_GOLDEN_SUN, COD_ITM_BOW_GOLDEN_SUN, TRUE, TRUE);<br />
}<br />
else if(sItemTag == "gen_im_acc_amu_am6")<br />
{<br />
WR_SetPlotFlag(PLT_COD_ITM_LIFE_DRINKER, COD_ITM_LIFE_DRINKER, TRUE, TRUE);<br />
}<br />
<br />
:<br />
<br />
}<br />
</dascript><br />
<br />
There's no catch all. There's no fall through. So if we're extending the Single Player Campaign we're on our own!<br />
<br />
=== Solution ===<br />
<br />
<dascript><br />
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:<br />
{<br />
// Decompose event.<br />
object oAcquirer = GetEventCreator(ev);<br />
object oItem = GetEventObject(ev, 0);<br />
string sItem = GetTag(oItem);<br />
<br />
// Debug.<br />
PrintToLog("------> MODULE CAMPAIGN ITEM ACQUIRED: " + sItem);<br />
<br />
// Does the item have a codex flag? We can ignore any items with default value (-1) as<br />
// plot flags have values of 0 and above.<br />
int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);<br />
if(nFlag > -1)<br />
{<br />
// Was the item acquired by a party member? We ignore any items acquired by someone<br />
// other than a party member.<br />
if(IsFollower(oAcquirer))<br />
{<br />
// Is the item one of ours? Other items can satify the first two conditions but<br />
// will be handled by their author's code therefore we must ensure it is ours.<br />
if(sItem == "xx_codex_itm_book" || sItem == "xx_codex_itm_longsword")<br />
{<br />
// Trigger the standard codex tutorial (it only shows once).<br />
// NOTE: requires #include "plt_tut_codex_item" directive.<br />
WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);<br />
<br />
// Trigger the codex entry.<br />
// NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT<br />
// variable therefore we name the plot resource using the item's tag.<br />
WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);<br />
<br />
// Do we want the item to persist? If not then we can delete it here.<br />
if(sItem == "xx_codex_itm_book") <br />
{<br />
WR_DestroyObject(oItem);<br />
}<br />
<br />
}<br />
}<br />
}<br />
break;<br />
}<br />
</dascript></div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer&diff=19943User:Sunjammer2020-04-26T22:19:35Z<p>Sunjammer: Removed link, added link</p>
<hr />
<div>Community Code Monkey<br />
<br />
== Work in progress ==<br />
<br />
* [[/90210|90210]]<br />
* [[/Abrigand's Arena of Agony|Abrigand's Arena of Agony]]<br />
* [[/Item_upgrades_(draft)|Item upgrades (draft)]]<br />
* [[/Items_with_codex_entries_tutorial_(draft)|Items with codex entries tutorial (draft)]]<br />
* [[/Move resources (draft)|Move resources (draft)]]<br />
* [[/Operator (draft)|Operator (draft)]]<br />
* [[/Plot_flags_(draft)|Plot flags (draft)]]<br />
* [[/Struct keyword (draft)|Struct keyword (draft)]]<br />
<br />
== Tests ==<br />
<br />
* [[/Wiki extensions test]]<br />
* [[/Main Page]]<br />
<br />
== To Do List ==<br />
{{ToDoList|Sunjammer}}<br />
<br />
* [[:Category:Keywords|Keywords]] & [[Keyword]]<br />
* [[:Category:Directives|Directives]] & [[Directive]]<br />
* [[:Category:Operators|Operators]] & [[Operator]]<br />
* [[:Category:Core scripts|Core scripts]]<br />
* [[:Category:Broken functions|Broken functions]]<br />
* [[Itemproperty keyword]]<br />
<br />
<br />
* [[Special:WantedCategories|Wanted categories]]<br />
* [[Special:WantedPages|Wanted pages]]<br />
<br />
<br />
<DynamicPageList><br />
category = Category:2da files from ABI base.xls<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
* confirm common root for M2DA_base m2da files<br />
* update links in all 2da files<br />
* make formatting consistent<br />
* remove negative assertions<br />
<br />
<DynamicPageList><br />
category = Include files<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = 2da types<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = Maintenance<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
* New Tutorial Navigation icons</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=PRCSCR_Script_Templates&diff=19942PRCSCR Script Templates2020-04-26T20:37:17Z<p>Sunjammer: /* Activating a Waypoint on the Worldmap */ fixing script</p>
<hr />
<div>This page serves as a repository for ready to use M2DA's and Scripts to use in conjunction with [[PRCSCR]] M2DA's when adding custom content to the game. <br />
<br />
References:<br />
*See Main Article: ''[[PRCSCR]]''<br />
*See ''[[PRCSCR.xls]]'' for details about that M2DA, or ''[[2DA]]'' for an explanation of 2DA's as a whole<br />
*To create a Script, right click in the Resourcepalette and select "New/Script" , or see ''[[Designer Resources]]'' for such Resources as a whole.<br />
<br />
<!-- No Table of contents... but a neat custom one --><br />
__NOTOC__<br />
'''Contents:'''<br />
{| style="background-color:#eeeeee; border:2px #999999 solid; padding:4px; margin:4px" border="3"<br />
| width=300 |[[PRCSCR Script Templates#Adding a placeable into an existing Area|1. Adding a placeable into an existing Area]]<br />
| width=800 |This Script serves to add a placeable of your choice into an Area of choice. ''(non removable)''<br />
|-<br />
| [[PRCSCR Script Templates#Adding a NPC into an existing Area|2. Adding a NPC into an existing Area]]<br />
| This Script serves to any custom NPC or Creature to a Area of choice. ''(removable)''<br />
|-<br />
| [[PRCSCR Script Templates#Activating a Waypoint on the Worldmap|3. Activating a Waypoint on the Worldmap]]<br />
| This Script serves to activate a custom Waypoint (Map Pin) of choice ,when leaving Lothering or at any other time into the Game.<br />
|-<br />
| [[PRCSCR Script Templates#Adding an Item into the Players Inventory|4. Adding an Item into the Players Inventory]]<br />
| This Script serves to instantly add an Item into the Players Inventory.<br />
|-<br />
| [[PRCSCR Script Templates#Adding an Item to an existing Vendor or Container|5. Adding an Item to an existing Vendor or Container]]<br />
| This Script serves to add any Item into a existing Vendors Inventory, as long the Vendor exists.<br />
|-<br />
| 6. Adding a Working Door into an existing Area<br />
| This Script serves to add a custom Door into a existing Area, that the Player can enter into a custom Area.<br />
|-<br />
| 7. Adding a Quest to an existing Chanters Board<br />
| This Script serves to add a new Quest to a existing Chanters Board, at any chosen time into the Game.<br />
|-<br />
| 8. [[Playing custom Player Character]]<br />
| Allows you to play custom character. Also: start your module with cutscene and allows you to create character 10 lvl and set it's characteristics as you want.<br />
|}<br />
<br />
<br />
== Adding a placeable into an existing Area ==<br />
<br />
'''M2DA Setup:'''<br />
<br />
#AreaListName must not be "any". Chose a specific one.<br />
#Copy the GDA into your modules override folder.<br />
<br />
'''Script:''' (As taken from the Storage Chest mod a kind Bioware employee made :o)<br />
<br />
<dascript><br />
//const string TAL_STORAGE_CHEST_SPAWNED = "TAL_STORAGE_CHEST_SPAWNED";<br />
const string TAL_IP_STORAGE_CHEST = "tal_ip_storage_chest";<br />
const resource TAL_RESOURCE_IP_STORAGE_CHEST = R"tal_ip_storage_chest.utp";<br />
<br />
void main()<br />
{<br />
object oMainControlled = GetMainControlled();<br />
object oChest = UT_GetNearestObjectByTag(oMainControlled, TAL_IP_STORAGE_CHEST);<br />
<br />
<br />
//DisplayFloatyMessage(oMainControlled, "storage script working", FLOATY_MESSAGE, 16777215, 30.0);<br />
<br />
if (!IsObjectValid(oChest))<br />
{<br />
location lSpawn = Location(GetArea(oMainControlled), Vector(148.77, 117.68, -0.94), 0.0);<br />
CreateObject(OBJECT_TYPE_PLACEABLE, TAL_RESOURCE_IP_STORAGE_CHEST, lSpawn); <br />
<br />
//DisplayFloatyMessage(oMainControlled, "storage chest created", FLOATY_MESSAGE, 16777215, 30.0);<br />
}<br />
}<br />
</dascript><br />
<br />
#Replace "tal_ip_storage_chest" in the 2nd line with the "Tag" of your own placeable. (only small letters allowed)<br />
#Replace "tal_ip_storage_chest.utp" in 3rd line with the Resources Filename of your placable.<br />
#Exchange the (4) numbers after it sais "Vector" ,which should be the location of your placable. How to determine?<br />
#Create a temporary duplicate of the specific Area, and add the placeable until you see fit. (delete this Area afterwards, do not export)<br />
#Note down the numbers in the Object Inspector, and get the first 3 numbers of Position, and the 4rth Number from Rotation. (only 1 number, the first)<br />
#Rotation needs to be recalculated before entering it into the script. For positive angles do (180-angle). For negative angles do (-180-(-angle)).<br />
<br />
Export the script, the placeable ,and start the game. When you arrive at the specific Area in game, the Placeable will be there.<br />
<br />
'''Note:''' This method prevents removal of the placable. Check out a Plot driven method.<br />
<br />
== Adding a NPC into an existing Area ==<br />
<br />
'''M2DA Setup:'''<br />
<br />
#AreaListName must be "any". This Script is Plot driven.<br />
#Copy the GDA into your modules override folder.<br />
<br />
'''Script:'''<br />
<br />
<dascript><br />
// this is the name of a precreated plot file "joblos_quest" prefixed with the special "plt_"<br />
// "plt_" + quest name allows you to reference the flag names as constants.<br />
#include "plt_joblos_quest" <br />
#include "wrappers_h"<br />
<br />
void main()<br />
{<br />
//Check whether we've added Joblo already.<br />
if (WR_GetPlotFlag(PLT_JOBLOS_QUEST, JOBLO_ADDED_TO_TOWN) == FALSE)<br />
{<br />
object oTown = GetObjectByTag("lot100ar_lothering"); //An area's tag is the same as its resource name<br />
vector vJobloLocation = Vector(126.745f, 120.724f, 0.460568f); // See below for how to get these coordinates<br />
<br />
CreateObject(<br />
OBJECT_TYPE_CREATURE,<br />
R"joblo.utc",<br />
Location(oTown, vJobloLocation, 180.0f) //See below for how to get the value for orientation<br />
); //this semicolom was missing and caused errors <br />
<br />
WR_SetPlotFlag("joblos_quest", JOBLO_ADDED_TO_TOWN, TRUE);<br />
}<br />
}<br />
</dascript><br />
<br />
#Replace "joblos_quest" (3x) with the name of your Plot.<br />
#Replace "JOBLO_ADDED_TO_TOWN" (2x) with a custom Flag you create in your Plot.<br />
#Replace "lot100ar_lothering" with the Tag of an Area ,the NPC should spawn in.<br />
#Replace "joblo.utc" with the filename of your [[Creature]].<br />
#Exchange the (4) numbers ,which should be the location of your placable. How to determine?<br />
#Create a temporary duplicate of the specific Area, and add the NPC until you see fit. (delete this Area afterwards, do not export)<br />
#Note down the numbers in the Object Inspector, and get the first 3 numbers of Position, and the 4rth Number from Rotation. (only 1 number, the first)<br />
#Rotation needs to be recalculated before entering it into the script. For positive angles do (180-angle). For negative angles do (-180-(-angle)).<br />
<br />
Export the script, the creature ,and start the game. When you arrive at the specific Area in game, the [[Creature]] (Monsters or NPCs alike) will be there.<br />
<br />
== Activating a Waypoint on the Worldmap ==<br />
<br />
'''Requirements:''' Your module must extend Single Player. <br />
<br />
'''M2DA Setup:'''<br />
<br />
#AreaListName must be "any". Because Waypoint activation should be universal and it is Plot driven.<br />
#Copy the GDA into your modules override folder.<br />
<br />
'''Script:'''<br />
<dascript><br />
#include "plt_mnp000pt_main_events"<br />
#include "wrappers_h"<br />
<br />
const string WML_WOW_Custom = "eshmeswp";<br />
<br />
void main()<br />
{<br />
if(WR_GetPlotFlag( PLT_MNP000PT_MAIN_EVENTS, ARCHDEMON_EVENT_ONE) == TRUE )<br />
{<br />
WR_SetWorldMapLocationStatus(GetObjectByTag(WML_WOW_Custom), WM_LOCATION_ACTIVE);<br />
}<br />
}<br />
</dascript><br />
<br />
#Replace "eshmeswp" in the 1st line with the "Tag" of your Waypoint (Map Pin) which u created. That Map Pin can be greyed out or inactive or so. Map Pin information can be found at: [[Map]].<br />
<br />
Export the script, the Map ,and start the game. The Waypoint will now be activated once you leave Lothering, just like the other main Waypoints. This is to get in line with the Story. However to change the time of it happening..<br />
<br />
#Choose which [[Plot]] should activate the Waypoint. The above example uses the Archdemon quest, when your nightmare triggers for example.<br />
#Exchange "mnp000pt_main_events" in the 2nd and 6th line with the name of that other [[Plot]]. Leaving the "plt_" there.<br />
#Exchange "ARCHDEMON_EVENT_ONE" with a "Flag" of your choice from that Plot.<br />
<br />
This "should" work for any plot. Actually, waypoints dont need all this PRCSCR stuff and can be set "Active" in the first place. But the above example is to get in line with the Main Campaign, and potential gamebreaking Plot conflicts if able to leave Lothering too early.<br />
<br />
== Adding an Item into the Players Inventory ==<br />
<br />
'''Requirements:'''<br />
<br />
'''M2DA Setup:'''<br />
#AreaListName is "any".<br />
#Copy the GDA into your modules override folder.<br />
<br />
'''Script:'''<br />
<dascript><br />
//include utility_h for the UT_AddItemToInventory() function.<br />
#include "utility_h"<br />
//include the custom made plot file<br />
#include "plt_$plot_file_name$"<br />
<br />
void main()<br />
{<br />
// If plot flag is TRUE then item already given.<br />
// Otherwise add item to inventory.<br />
if ( WR_GetPlotFlag( PLT_$plot_file_name$, $check_flag_name$ ) == FALSE )<br />
{<br />
UT_AddItemToInventory(R"$item_file_name$.uti");<br />
//Set the plot flag to TRUE to indicate that the item was given.<br />
WR_SetPlotFlag( PLT_$plot_file_name$, $check_flag_name$, TRUE );<br />
}<br />
}<br />
</dascript><br />
# Replace everything between and including the $ signs with appropriate names (without the file extensions).<br />
<br />
== Adding an Item to an existing Vendor or Container ==<br />
<br />
'''Requirements:'''<br />
<br />
'''M2DA Setup:'''<br />
<br />
{| border="1"<br />
! Campaign !! Container !! ContainerTag !! AreaListName<br />
|-<br />
|Origins || Bodahn || store_camp_bodahn || cam100ar_camp_plains<br />
|-<br />
|Origins || daytime King's Camp quartermaster || pre100sr_quartermaster || pre01al_kings_camp<br />
|-<br />
|Awakening || Yuriah || store_vgk100cr_merchant || vgk210ar_throne_room<br />
|-<br />
|Awakening || Party Chest in Vigil's Keep || vgk210ip_party_chest || vgk210ar_throne_room<br />
|-<br />
|Leliana's Song || first Lem encounter || store_lel00cr_lem || lel100ar_market<br />
|}<br />
<br />
#Create a [[PRCSCR.xls|PRCSCR M2DA override]] using the desired AreaListName from the above table<br />
#Copy this new PRCSCR M2DA into your module's override folder (AddIns\{YourMod}\core\override)<br />
<br />
'''Script:'''<br />
<br />
<dascript><br />
#include "wrappers_h"<br />
#include "plt_$plot_file_name$" // include your custom plot<br />
<br />
void main()<br />
{<br />
if ( WR_GetPlotFlag( PLT_$plot_file_name$, $check_flag_name$ ) == TRUE ) return;<br />
<br />
object oContainer = GetObjectByTag("$ContainerTag$");<br />
<br />
if (IsObjectValid(oContainer))<br />
{<br />
CreateItemOnObject(R"$resource_name$.uti", oContainer, 1, "", TRUE); // repeat this for each item<br />
<br />
WR_SetPlotFlag( PLT_$plot_file_name$, $check_flag_name$, TRUE );<br />
}<br />
}<br />
</dascript><br />
<br />
#Replace "$plot_file_name$" and "$check_flag_name$" with the custom [[Plot#Scripting|plot and plot flags]] you create for your module.<br />
#Replace "$resource_name$" with the resource name of your custom item.<br />
#Replace "$ContainerTag$" with the desired container tag from the table in the M2DA setup section.<br />
#The very first time you go to the party camp in Origins (after leaving Lothering) and view the Archdemon cutscene, this script will NOT run when using "cam100ar_camp_plains" as the AreaListName. This is because the cutscene version of the camp is actually a different area. In this case you must exit and return to the "normal" (non-cutscene) party camp for the script to run for the first time.<br />
<br />
== Adding a Working Door into an existing Area ==<br />
<br />
'''Requirements:'''<br />
<br />
'''M2DA Setup:'''<br />
<br />
'''Script:''' {{undocumented}}<br />
<br />
== Adding a Quest to an existing Chanters Board ==<br />
<br />
'''Requirements:'''<br />
<br />
'''M2DA Setup:'''<br />
<br />
'''Script:''' {{undocumented}}<br />
<br />
[[category:tutorials]]<br />
[[Category:Scripts]]<br />
[[Category:Pages with example scripts]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19941Compiler error message2020-04-26T00:47:45Z<p>Sunjammer: Added error</p>
<hr />
<div>{{Infobox script}}<br />
<br />
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying to understand compiler error message:<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
== Errors == <br />
The following is a list of compiler error messages that have been encountered and what caused them. It is important to be aware that the listed cause(s) may not be the ''only'' cause(s) for a particular error and therefore should be viewed as examples rather than definitions.<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [example].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
;Duplicate function implementation (<function>)<br />
: Two functions with the same name exist.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [example].<br />
<br />
=== <span id="F">F</span> ===<br />
;Function definition missing parameter list<br />
:The brackets were omitted when defining a function.<br />
<!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled directly (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<br />
;Invalid declaration type<br />
:The brackets were omitted when declaring a function.<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [example].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
;No semicolon after structure<br />
# The statement terminator (;) is missing from the end of a structure definition.<br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[struct keyword|struct]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<br />
;Void expression where non void required<br />
: Assigned a member of a [[vector]] which was itself a member of a [[struct keyword|struct]] to a variable.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --><br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Export_error&diff=19940Export error2020-04-25T19:08:56Z<p>Sunjammer: Add information on unresolved DB reference</p>
<hr />
<div>When exporting a module or resource any [[export error]]s encountered will be displayed in the [[Log window panel|Log Window]].<br />
<br />
== Errors ==<br />
<br />
=== Could not get starting area resource information. ===<br />
<br />
This error can occur when '''Override campaign export settings''' option has been enabled in the '''Export Options''' window but the '''Starting Area''' property is set to an [[Bug: Unresolved DB reference to starting area|unresolved DB reference]] or to a resource that no longer exists, for example, because it has been deleted.<br />
<br />
To resolve this error select the '''Tools > Export Options''' menu option to open the '''Export Options''' window and perform one of the following:<br />
* Assign a valid area resource to the '''Starting Area''' property<br />
* Disable '''Override campaign export settings''' option<br />
* Click on the '''Restore Defaults''' button<br />
<br />
== See also ==<br />
* [[Compiler error message]] for errors encountered during script compilation.<br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Bug:_Unresolved_DB_reference_to_starting_area&diff=19939Bug: Unresolved DB reference to starting area2020-04-25T18:46:24Z<p>Sunjammer: Added link</p>
<hr />
<div>*'''Toolset verion:''' 1.0.1008.0<br />
*'''Game version:''' 1.02a <br />
*'''Status:''' Open<br />
<br />
== Description ==<br />
<!-- Describe the bug here including as many details as possible. What situations trigger it and what effects it causes are the most important. --><br />
I don't know how or when this happened, but in the module's "Starting Area", instead of my area's tag, I had a DB URL instead. E.g., bw-db://.\BWDATOOLSET/bw_dragonage_content?resrefid=21717. I've only seen this happen when inspecting other modules I haven't loaded yet.<br />
<br />
This is an issue because it prevented a new campaign.cif file from being generated (I was trying to figure out why my module script wasn't getting changed from module_core - this was why). During export you get the error: ''[[Export error|Could not get starting areas resource information]].'' and the warning ''Some resources failed their post processing. Please see below for more details.<br />
<br />
== Workarounds ==<br />
<!-- if you know of any ways to work around the bug describe them here. --><br />
<br />
Open your module properties, click the "Starting Area" and find your area again in the file-chooser dialog.<br />
<br />
[[Category:Toolset bugs]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Export_error&diff=19938Export error2020-04-25T17:53:46Z<p>Sunjammer: Correct title</p>
<hr />
<div>When exporting a module or resource any [[export error]]s encountered will be displayed in the [[Log window panel|Log Window]].<br />
<br />
== Errors ==<br />
<br />
=== Could not get starting area resource information. ===<br />
<br />
This error can occur when '''Override campaign export settings''' option has been enabled in the '''Export Options''' window but the '''Starting Area''' property is set to a resource that no longer exists, for example, because it has been deleted.<br />
<br />
To resolve this error select the '''Tools > Export Options''' menu option to open the '''Export Options''' window and perform one of the following:<br />
* Assign a valid area resource to the '''Starting Area''' property<br />
* Disable '''Override campaign export settings''' option<br />
* Click on the '''Restore Defaults''' button<br />
<br />
== See also ==<br />
* [[Compiler error message]] for errors encountered during script compilation.<br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Export_error&diff=19937Export error2020-04-25T17:52:58Z<p>Sunjammer: Created</p>
<hr />
<div>When exporting a module or resource any [[export error]]s encountered will be displayed in the [[Log window panel|Log Window]].<br />
<br />
== Error messages ==<br />
<br />
=== Could not get starting area resource information. ===<br />
<br />
This error can occur when '''Override campaign export settings''' option has been enabled in the '''Export Options''' window but the '''Starting Area''' property is set to a resource that no longer exists, for example, because it has been deleted.<br />
<br />
To resolve this error select the '''Tools > Export Options''' menu option to open the '''Export Options''' window and perform one of the following:<br />
* Assign a valid area resource to the '''Starting Area''' property<br />
* Disable '''Override campaign export settings''' option<br />
* Click on the '''Restore Defaults''' button<br />
<br />
== See also ==<br />
* [[Compiler error message]] for errors encountered during script compilation.<br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Script_error&diff=19936Script error2020-04-25T16:31:31Z<p>Sunjammer: Added "See also" section, reformatted table</p>
<hr />
<div>{{Infobox script}}<br />
<br />
Currently this document covers errors when executing a script at run-time.<br />
<br />
== Errors ==<br />
There are two general types of errors that can happen:<br />
<br />
* Execution Errors (File missing, etc.)<br />
* Stack Errors (Overflows, Underflows, Division by 0, etc.)<br />
<br />
=== Execution Errors ===<br />
<br />
General execution errors often involve the script not being present in the game or other general problems preventing the vm from processing the script correctly.<br />
<br />
==== Failure to Run ====<br />
<br />
*'''Message: ''' "''<recursion level> Script failed to run: (filename)''"<br />
*'''Reason: ''' Often the script does not actually exist. <br />
*'''Solution: ''' <br />
<br />
==== Failure to Read ====<br />
<br />
*'''Message: ''' "''Error: Failed to read script file''"<br />
*'''Reason: ''' This is a generic message that shows up for all non specific errors. It's kind of misleading as the file might be read fine from disk but otherwise fail to execute.<br />
*'''Solution: '''<br />
<br />
==== Failure to Load ====<br />
<br />
*'''Message: ''' "''Error: Script couldn't load''"<br />
*'''Reason: ''' This is a generic message that shows up for all problems where the game could not be read.<br />
*'''Solution: ''' Make sure the script file was properly exported to the game by manually checking if it resides in the toolset export directory for the module.<br />
<br />
=== Stack Errors / Unknown Error ===<br />
<br />
When the stack gets corrupted, the game will produce one of the errors listed below. A good first step for any stack related problems is to check the ExecuteCommand channel for warnings/error messages near recently implemented scripting commands.<br />
<br />
==== Stack Overflow ====<br />
<br />
*'''Message: ''' "''Stack Overflow in script: (filename)''"<br />
*'''Reason: ''' The stack got corrupted by pushing too many parameters from the engine.<br />
*'''Solution: ''' The declaration for the command in script.ldf and its implementation in the virtual machine may not match; check if you've got incompatible versions of script.ldf and the executable file. Update script.ldf locally (by copying into /packages/core/override and restarting the toolset) and reexport all scripts.<br />
<br />
==== Stack Underflow ====<br />
<br />
*'''Message: ''' "''Stack Underflow in script: (filename)''"<br />
*'''Reason: ''' The stack got corrupted by not popping of all values of a command from the stack.<br />
*'''Solution: ''' The same as for a stack overflow.<br />
<br />
==== Stack Error ====<br />
<br />
*'''Message: ''' "''Stack Error (code) in script: (filename) ''" <br />
*'''Reason: ''' See common error codes listed below. <br />
<br />
{|class="wikitable"<br />
|-<br />
! Code || Reason || Solution<br />
|-<br />
| TOO_MANY_INSTRUCTIONS (632)<br />
| The VM has terminated the offending script after executing the maximum number of instructions (131072). This is ALWAYS an error made by the scripter, most likely triggered by an infinite loop. <br />
| Any script that manages to run even closely to the maximum number of allowed instructions is either broken or badly designed and needs to be rewritten with a more efficient design.<br />
|-<br />
| TOO_MANY_RECURSION_LEVELS (633)<br />
| The VM has terminated the offending script after hitting the maximum recursion level (8). This is always an error made by the scripter, often caused by layered HandleEvent calls <br />
| Ensure the current event is handled earlier in the code and not propagated through a long chain of HandleEvents.<br />
|-<br />
| CANNOT_READ_FILE (634)<br />
| Script could not be read, probably because it didn't exist.<br />
| Export scripts from toolset<br />
|-<br />
| STACK_OVERFLOW (638)<br />
| The VM has terminated the offending script after the stack was corrupted.<br />
| See Stack Overflow above.<br />
|-<br />
| STACK_UNDERFLOW (639)<br />
| The VM has terminated the offending script after the stack was corrupted.<br />
| See Stack Underflow above.<br />
|-<br />
| INVALID_COMMMAND (642)<br />
| The VM encountered a call to a command not known to the executable. [[Script.ldf]] was probably updated with a command that is not known to the current executable.<br />
| Get an up to date executable. <br />
|-<br />
| DIVISION_BY_ZERO (644)<br />
| A script has triggered a division by zero, either directly or inside a command not accepting a 0 parameter (e.g. Random)<br />
| Ensure that the script is properly shielded against parameters becoming 0 (e.g. when read from a 2da). Find the location of the problem by checking the appropriate log channels (FW_SCRIPT and FW_SCRIPT_COMMANDS)<br />
|}<br />
<br />
==== Defines ==== <br />
<br />
<dascript><br />
#define STRREF_VIRTUALMACHINE_ERROR_TOO_MANY_INSTRUCTIONS 632<br />
#define STRREF_VIRTUALMACHINE_ERROR_TOO_MANY_LEVELS_OF_RECURSION 633<br />
#define STRREF_VIRTUALMACHINE_ERROR_FILE_NOT_OPENED 634<br />
#define STRREF_VIRTUALMACHINE_ERROR_FILE_NOT_COMPILED_SUCCESSFULLY 635<br />
#define STRREF_VIRTUALMACHINE_ERROR_INVALID_AUX_CODE 636<br />
#define STRREF_VIRTUALMACHINE_ERROR_NULL_VIRTUAL_MACHINE_NODE 637<br />
#define STRREF_VIRTUALMACHINE_ERROR_STACK_OVERFLOW 638<br />
#define STRREF_VIRTUALMACHINE_ERROR_STACK_UNDERFLOW 639<br />
#define STRREF_VIRTUALMACHINE_ERROR_INVALID_OP_CODE 640<br />
#define STRREF_VIRTUALMACHINE_ERROR_INVALID_EXTRA_DATA_ON_OP_CODE 641<br />
#define STRREF_VIRTUALMACHINE_ERROR_INVALID_COMMAND 642<br />
#define STRREF_VIRTUALMACHINE_ERROR_FAKE_SHORTCUT_LOGICAL_OPERATION 643<br />
#define STRREF_VIRTUALMACHINE_ERROR_DIVIDE_BY_ZERO 644<br />
#define STRREF_VIRTUALMACHINE_ERROR_FAKE_ABORT_SCRIPT 645<br />
#define STRREF_VIRTUALMACHINE_ERROR_IP_OUT_OF_CODE_SEGMENT 646<br />
#define STRREF_VIRTUALMACHINE_ERROR_COMMAND_IMPLEMENTER_NOT_SET 647<br />
#define STRREF_VIRTUALMACHINE_ERROR_UNKNOWN_TYPE_ON_RUN_TIME_STACK 648<br />
#define STRREF_VIRTUALMACHINE_ERROR_ARRAY_ACCESS_OUT_OF_BOUNDS 649<br />
</dascript><br />
<br />
== See also ==<br />
* [[Compiler error message]] for errors encountered during script compilation.<br />
<br />
{{Languages|Script error}}<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19935Compiler error message2020-04-25T16:19:52Z<p>Sunjammer: Sunjammer moved page User:Sunjammer/Compiler error message to Compiler error message without leaving a redirect</p>
<hr />
<div>{{Infobox script}}<br />
<br />
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying to understand compiler error message:<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
== Errors == <br />
The following is a list of compiler error messages that have been encountered and what caused them. It is important to be aware that the listed cause(s) may not be the ''only'' cause(s) for a particular error and therefore should be viewed as examples rather than definitions.<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [example].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [example].<br />
<br />
=== <span id="F">F</span> ===<br />
;Function definition missing parameter list<br />
:The brackets were omitted when defining a function.<br />
<!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled directly (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<br />
;Invalid declaration type<br />
:The brackets were omitted when declaring a function.<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [example].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
;No semicolon after structure<br />
# The statement terminator (;) is missing from the end of a structure definition.<br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[struct keyword|struct]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<br />
;Void expression where non void required<br />
: Assigned a member of a [[vector]] which was itself a member of a [[struct keyword|struct]] to a variable.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --><br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19934Compiler error message2020-04-25T16:19:16Z<p>Sunjammer: Added infobox and categories</p>
<hr />
<div>{{Infobox script}}<br />
<br />
When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying to understand compiler error message:<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
== Errors == <br />
The following is a list of compiler error messages that have been encountered and what caused them. It is important to be aware that the listed cause(s) may not be the ''only'' cause(s) for a particular error and therefore should be viewed as examples rather than definitions.<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [example].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [example].<br />
<br />
=== <span id="F">F</span> ===<br />
;Function definition missing parameter list<br />
:The brackets were omitted when defining a function.<br />
<!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled directly (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<br />
;Invalid declaration type<br />
:The brackets were omitted when declaring a function.<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [example].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
;No semicolon after structure<br />
# The statement terminator (;) is missing from the end of a structure definition.<br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[struct keyword|struct]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<br />
;Void expression where non void required<br />
: Assigned a member of a [[vector]] which was itself a member of a [[struct keyword|struct]] to a variable.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --><br />
<br />
[[Category:Scripts]]<br />
[[Category:Error messages]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Noob_to_pro&diff=19933Noob to pro2020-04-25T10:06:35Z<p>Sunjammer: Removed dead links</p>
<hr />
<div>== Dragon Age Toolset: Noob to Pro ==<br />
<br />
=== How I learned to stop worrying and love the Dragon Age Toolset ===<br />
<br />
The goal of this tutorial is to take a new user of the Dragon Age toolset who is completely unfamiliar with the resources in the tool, and enable him or her to make a new, standalone campaign from scratch. Because of the modular design of the toolset, it can be tough to navigate the different aspects that go into making a module: scripting, building levels, even getting a basic module up and running. In addition, it's difficult to find a centralized location to simply find out what to do and where to do it. If you have no idea what you're doing, this is for you.<br />
<br />
Here's an overview of what we'll be going through together on this wiki:<br />
<br />
* [[Making a new, playable module]] - What to do when you first open your toolset<br />
* [[Building levels]] - Maybe I do not want to be in Orzammar<br />
* [[Character Generation]] - Different ways to make a usable character who may or may not be named Jaden<br />
* [[Maps and Areas]] - How to go from level to level<br />
* [[Creatures]] - Making your module a little less lonely<br />
* [[Cutscenes]] - How to create cinematic events<br />
* [[Conversations]] - Interacting with NPCs<br />
* [[Combat]] - Getting into fights<br />
* [[Packaging]] - How to share your module with your ''actual'' friends (if they have Dragon Age on PC)<br />
<br />
----<br />
<br />
There are a lot of resources on the Toolset, but unfortunately they're scattered around a bit. However, here are some tools that may or may not be helpful to both noobz and proz:<br />
<br />
[[Backgrounds_tutorial|More than just a background tutorial, an introduction to character generation]]<br />
<br />
[[Model list|A list of models, for building levels]]<br />
<br />
[http://www.dragonagenexus.com/| DA Nexus, a site dedicated to Dragon Age mods]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Operator_(draft)&diff=19932User:Sunjammer/Operator (draft)2020-04-13T22:29:22Z<p>Sunjammer: Created</p>
<hr />
<div>An [[operator]] is symbol that performs a prescribed operation on one or more operands.<br />
<br />
The [[dascript]] compiler recognizes the following operators:<br />
<br />
{|class="wikitable" <br />
! Operator !! Symbol<br />
|-<br />
| colspan="2" | String operators<br />
|-<br />
| [[Concatenation operator|Concatenation]] || +<br />
|-<br />
| colspan="2" | Arithmetic operators<br />
|-<br />
| [[Arithmetic negation operator|Arithmetic negation]] || -<br />
|-<br />
| [[Increment operator|Increment]] || ++<br />
|-<br />
| [[Decrement operator|Decrement ]] || --<br />
|-<br />
| [[Addition operator|Addition]] || +<br />
|-<br />
| [[Subtraction operator|Subtraction]] || -<br />
|-<br />
| [[Multiplication operator|Multiplication]] || *<br />
|-<br />
| [[Division operator|Division]] || /<br />
|-<br />
| [[Modulo operator|Modulo]] || %<br />
|-<br />
| colspan="2" | Bitwise operators<br />
|-<br />
| [[Bitwise complement operator|Bitwise complement]] || ~<br />
|-<br />
| [[Bitwise AND operator|Bitwise AND]] || &<br />
|-<br />
| [[Bitwise OR operator|Bitwise OR]] || <nowiki>|</nowiki><br />
|-<br />
| [[Bitwise XOR operator|Bitwise XOR]] || ^<br />
|-<br />
| [[Bitwise left shift operator|Bitwise left shift]] || <<<br />
|-<br />
| [[Bitwise arithmetic right shift operator|Bitwise arithmetic right shift]] || >><br />
|-<br />
| [[Bitwise logical right shift operator|Bitwise logical right shift]] || >>><br />
|-<br />
| colspan="2" | Logical operators<br />
|-<br />
| [[Logical negation operator|Logical negation]] || !<br />
|-<br />
| [[Conditional AND operator|Conditional AND]] || &&<br />
|-<br />
| [[Conditional OR operator|Conditional OR]] || <nowiki>||</nowiki><br />
|-<br />
| colspan="2" | Relational operators<br />
|-<br />
| [[Equality operator|Equality]] || ==<br />
|-<br />
| [[Inequality operator|Inequality]] || !=<br />
|-<br />
| [[Less than operator|Less than]] || <<br />
|-<br />
| [[Greater than operator|Greater than]] || ><br />
|-<br />
| [[Less than or equal to operator|Less than or equal to]] || <=<br />
|-<br />
| [[Greater than or equal to operator|Greater than or equal to]] || >=<br />
|-<br />
| colspan="2" | Assignment operators<br />
|-<br />
| [[Assignment operator|Assignment]] || =<br />
|-<br />
| [[Addition assignment operator|Addition assignment]] || +=<br />
|-<br />
| [[Subtraction assignment operator|Subtraction assignment]] || -=<br />
|-<br />
| [[Multiplication assignment operator|Multiplication assignment]] || *=<br />
|-<br />
| [[Division assignment operator|Division assignment]] || \=<br />
|-<br />
| [[Modulo assignment operator|Modulo assignment]] || %=<br />
|-<br />
| [[Bitwise AND assignment operator|Bitwise AND assignment]] || &=<br />
|-<br />
| [[Bitwise OR assignment operator|Bitwise OR assignment]] || <nowiki>|=</nowiki><br />
|-<br />
| [[Bitwise XOR assignment operator|Bitwise XOR assignment]] || ^=<br />
|-<br />
| [[Concatenation assignment operator|Concatenation assignment]] || +=<br />
|-<br />
| [[Bitwise left shift assignment operator|Bitwise left shift assignment]] || <<=<br />
|-<br />
| [[Bitwise arithmetic right shift assignment operator|Bitwise arithmetic right shift assignment]] || >>=<br />
|-<br />
| [[Bitwise logical right shift assignment operator|Bitwise logical right shift assignment]] || >>>=<br />
|-<br />
| colspan="2" | Member access operators<br />
|-<br />
| [[Dot operator|Dot]] || .<br />
|-<br />
|colspan="2" | Conditional operators<br />
|-<br />
| [[Conditional operator|Conditional]] || ?:<br />
|}<br />
<br />
== Remarks ==<br />
<br />
Operators may be categorised based on the number of operands:<br />
<br />
* Unary - one operand<br />
* Binary - two operands<br />
* Ternary - three operands<br />
<br />
Operator precedence:<br />
<br />
* TODO<br />
<br />
Operator associativity:<br />
<br />
* Left-associative operators are evaluated in order from left to right. Except for the assignment operators all binary operators are left-associative. For example, a + b - c is evaluated as (a + b) - c.<br />
* Right-associative operators are evaluated in order from right to left. The assignment operators, and the conditional operator are right-associative. For example, x = y = z is evaluated as x = (y = z).<br />
<br />
== See also ==<br />
<br />
* [[:Category:Operators|Operators]]<br />
<br />
[[Category:Scripting]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer&diff=19931User:Sunjammer2020-04-13T21:52:06Z<p>Sunjammer: Added link</p>
<hr />
<div>Community Code Monkey<br />
<br />
== Work in progress ==<br />
<br />
* [[/90210|90210]]<br />
* [[/Abrigand's Arena of Agony|Abrigand's Arena of Agony]]<br />
* [[/Compiler error message|Compiler error message (draft)]] (see also [[Script error]])<br />
* [[/Item_upgrades_(draft)|Item upgrades (draft)]]<br />
* [[/Move resources (draft)|Move resources (draft)]]<br />
* [[/Operator (draft)|Operator (draft)]]<br />
* [[/Plot_flags_(draft)|Plot flags (draft)]]<br />
* [[/Struct keyword (draft)|Struct keyword (draft)]]<br />
<br />
== Tests ==<br />
<br />
* [[/Wiki extensions test]]<br />
* [[/Main Page]]<br />
<br />
== To Do List ==<br />
{{ToDoList|Sunjammer}}<br />
<br />
* [[:Category:Keywords|Keywords]] & [[Keyword]]<br />
* [[:Category:Directives|Directives]] & [[Directive]]<br />
* [[:Category:Operators|Operators]] & [[Operator]]<br />
* [[:Category:Core scripts|Core scripts]]<br />
* [[:Category:Broken functions|Broken functions]]<br />
* [[Itemproperty keyword]]<br />
<br />
<br />
* [[Special:WantedCategories|Wanted categories]]<br />
* [[Special:WantedPages|Wanted pages]]<br />
<br />
<br />
<DynamicPageList><br />
category = Category:2da files from ABI base.xls<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
* confirm common root for M2DA_base m2da files<br />
* update links in all 2da files<br />
* make formatting consistent<br />
* remove negative assertions<br />
<br />
<DynamicPageList><br />
category = Include files<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = 2da types<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = Maintenance<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
* New Tutorial Navigation icons</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Boolean_constants&diff=19930Boolean constants2020-04-13T17:30:46Z<p>Sunjammer: Remove unnecessary whitespace</p>
<hr />
<div>{{Constant table start<br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table row<br />
|name=FALSE<br />
|type=int<br />
|value=0<br />
|description= <br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table row<br />
|name=TRUE<br />
|type=int<br />
|value=1<br />
|description= <br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table end}}<br />
<br />
== Remarks ==<br />
<!-- This section contains additional comments, observations and known issues. --><br />
In [[dascript]] there is no Boolean type. Instead [[int|integer]] values are used to represent the Boolean states: zero represents the '''false''' state and any non-zero integer represents the '''true''' state. For convenience the [[boolean constants]] have been defined in [[script.ldf]] to represent the '''true''' and '''false''' states.<br />
<br />
These constants are used in the following ways in '''script.ldf''', the [[Core Game Resources]] and the [[Single Player Campaign]]:<br />
<dascript><br />
// Assigning a value to a integer variable.<br />
int bStillLooking = TRUE;<br />
<br />
// Setting the a value of an integer argument in a function call.<br />
SetItemDroppable(oItem, TRUE);<br />
<br />
// Setting the default value of an integer argument in a function's declaration or definition.<br />
void AddAbility(object oObject, int nAbility, int bSendNotification = FALSE);<br />
<br />
// Setting a return value from an integer function.<br />
return TRUE;<br />
</dascript><br />
<br />
The constants are also referenced in the comments describing a function's return values, for example, as seen is [[IsObjectValid]], to indicate that the function is constrained to return 0 or 1. This is probably reliable for engine functions (i.e. those in '''script.ldf''') which are presumably converting from a native C++ '''bool''' type but should be treated with scepticism for scripted functions.<br />
<br />
Finally the constants are also used in boolean expressions, for example, in an '''if''' statement:<br />
<br />
<dascript><br />
if(<expression> == TRUE)<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
Typically this will be seen in connection with the various '''Is*''' and '''Has*''' functions, for example, as seen with the use of '''IsObjectValid''' in the '''item_singletarget''' script:<br />
<br />
<dascript><br />
// make sure there is a location, just in case<br />
if(IsObjectValid(stEvent.oTarget) == TRUE)<br />
{<br />
stEvent.lTarget = GetLocation(stEvent.oTarget);<br />
}<br />
</dascript><br />
<br />
While not technically wrong - provided the function returns 0 or 1 as it does here - the comparison with the boolean constant is redundant and is not considered best practice. The above example should have been simplified to:<br />
<br />
<dascript><br />
// make sure there is a location, just in case<br />
if(IsObjectValid(stEvent.oTarget))<br />
{<br />
stEvent.lTarget = GetLocation(stEvent.oTarget);<br />
}<br />
</dascript><br />
<br />
The rationale for avoiding comparisons with the boolean constants, specifically with the '''TRUE''' constant, is because the '''TRUE''' constant is only one of many values that can represent the '''true''' state and therefore can introduce ambiguity or unintended behaviour (i.e. a bug). <br />
<br />
An example of this might be where an include file contains the following function:<br />
<br />
<dascript><br />
int HasSuperValuableGems(object oCreature)<br />
{<br />
return CountItemsByTag(oCreature, "SuperValuableGem");<br />
}<br />
</dascript><br />
<br />
And the action script or plot script contains the following:<br />
<br />
<dascript><br />
// The PC needs a "super valuable gem" in order to bribe the noble!<br />
if(HasSuperValuableGems(oHero) == TRUE)<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
The logic may appear correct however because the function is not constrained to return a boolean constant but is being compared against one the result will be that the PC can only bribe the noble when they have EXACTLY one gem which is probably not the intended behaviour. Removing the comparison against the '''TRUE''' constant would resolve this (although it could also be argued that the function should also be renamed to better indicate its behaviour).<br />
<br />
Note that while comparisons against the '''FALSE''' constant do not suffer from the same ambiguity (as both it and the '''false''' state only ever equate to zero) they are nonetheless redundant and should be simplified using the [[logical negation operator]]:<br />
<br />
<dascript><br />
// Replace this:<br />
if(IsObjectValid(oTarget) == FALSE)<br />
{<br />
...<br />
}<br />
<br />
// With this:<br />
if(!IsObjectValid(oTarget))<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
In conclusion it is best to only use the boolean constants for the following purposes:<br />
# Assigning a value to a integer variable.<br />
# Setting the a value of an integer argument in a function call.<br />
# Setting the default value of an integer argument in a function's declaration or definition.<br />
# Setting a return value from an integer function.<br />
<br />
== See also ==<br />
<!-- This section contains links to articles, functions or constant groups. --><br />
*[[bool (2da type)]] for boolean values in [[2DA]]s<br />
<br />
[[Category:Constants]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Boolean_constants&diff=19929Boolean constants2020-04-13T17:28:24Z<p>Sunjammer: Rewritten</p>
<hr />
<div>{{Constant table start<br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table row<br />
|name=FALSE<br />
|type=int<br />
|value=0<br />
|description= <br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table row<br />
|name=TRUE<br />
|type=int<br />
|value=1<br />
|description= <br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
{{Constant table end}}<br />
<br />
== Remarks ==<br />
<!-- This section contains additional comments, observations and known issues. --><br />
In [[dascript]] there is no Boolean type. Instead [[int|integer]] values are used to represent the Boolean states: zero represents the '''false''' state and any non-zero integer represents the '''true''' state. For convenience the [[boolean constants]] have been defined in [[script.ldf]] to represent the '''true''' and '''false''' states.<br />
<br />
These constants are used in the following ways in '''script.ldf''', the [[Core Game Resources]] and the [[Single Player Campaign]]:<br />
<dascript><br />
// Assigning a value to a integer variable.<br />
int bStillLooking = TRUE;<br />
<br />
// Setting the a value of an integer argument in a function call.<br />
SetItemDroppable(oItem, TRUE);<br />
<br />
// Setting the default value of an integer argument in a function's declaration or definition.<br />
void AddAbility(object oObject, int nAbility, int bSendNotification = FALSE);<br />
<br />
// Setting a return value from an integer function.<br />
return TRUE;<br />
</dascript><br />
<br />
The constants are also referenced in the comments describing a function's return values, for example, as seen is [[IsObjectValid]], to indicate that the function is constrained to return 0 or 1. This is probably reliable for engine functions (i.e. those in '''script.ldf''') which are presumably converting from a native C++ '''bool''' type but should be treated with scepticism for scripted functions.<br />
<br />
Finally the constants are also used in boolean expressions, for example, in an '''if''' statement:<br />
<br />
<dascript><br />
if(<expression> == TRUE)<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
Typically this will be seen in connection with the various '''Is*''' and '''Has*''' functions, for example, as seen with the use of '''IsObjectValid''' in the '''item_singletarget''' script:<br />
<br />
<dascript><br />
// make sure there is a location, just in case<br />
if(IsObjectValid(stEvent.oTarget) == TRUE)<br />
{<br />
stEvent.lTarget = GetLocation(stEvent.oTarget);<br />
}<br />
</dascript><br />
<br />
While not technically wrong - provided the function returns 0 or 1 as it does here - the comparison with the boolean constant is redundant and is not considered best practice. The above example should have been simplified to:<br />
<br />
<dascript><br />
// make sure there is a location, just in case<br />
if(IsObjectValid(stEvent.oTarget))<br />
{<br />
stEvent.lTarget = GetLocation(stEvent.oTarget);<br />
}<br />
</dascript><br />
<br />
The rationale for avoiding comparisons with the boolean constants, specifically with the '''TRUE''' constant, is because the '''TRUE''' constant is only one of many values that can represent the '''true''' state and therefore can introduce ambiguity or unintended behaviour (i.e. a bug). <br />
<br />
An example of this might be where an include file contains the following function:<br />
<br />
<dascript><br />
int HasSuperValuableGems(object oCreature)<br />
{<br />
return CountItemsByTag(oCreature, "SuperValuableGem");<br />
}<br />
</dascript><br />
<br />
And the action script or plot script contains the following:<br />
<br />
<dascript><br />
// The PC needs a "super valuable gem" in order to bribe the noble!<br />
if(HasSuperValuableGems(oHero) == TRUE)<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
The logic may appear correct however because the function is not constrained to return a boolean constant but is being compared against one the result will be that the PC can only bribe the noble when they have EXACTLY one gem which is probably not the intended behaviour. Removing the comparison against the '''TRUE''' constant would resolve this (although it could also be argued that the function should also be renamed to better indicate its behaviour).<br />
<br />
Note that while comparisons against the '''FALSE''' constant do not suffer from the same ambiguity (as both it and the '''false''' state only ever equate to zero) they are nonetheless redundant and should be simplified using the [[logical negation operator]]:<br />
<br />
<dascript><br />
// Replace this:<br />
if(IsObjectValid(oTarget) == FALSE)<br />
{<br />
...<br />
}<br />
<br />
<br />
// With this:<br />
if(!IsObjectValid(oTarget))<br />
{<br />
...<br />
}<br />
</dascript><br />
<br />
In conclusion it is best to only use the boolean constants for the following purposes:<br />
# Assigning a value to a integer variable.<br />
# Setting the a value of an integer argument in a function call.<br />
# Setting the default value of an integer argument in a function's declaration or definition.<br />
# Setting a return value from an integer function.<br />
<br />
== See also ==<br />
<!-- This section contains links to articles, functions or constant groups. --><br />
*[[bool (2da type)]] for boolean values in [[2DA]]s<br />
<br />
[[Category:Constants]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer/Struct_keyword_(draft)&diff=19928User:Sunjammer/Struct keyword (draft)2020-04-13T13:59:10Z<p>Sunjammer: Fixed a link</p>
<hr />
<div>The [[struct keyword]] is used to construct a composite data type, or structure, consisting of a set related members/variables/values which can be accessed individually using the [[dot operator]].<br />
<br />
The [[vector keyword|vector]] data type is a predefined struct which consists of three [[float keyword|values]]: x, y and z. To access or modify the y value of a vector, v, we would use v.y for example v.y = 1.2.<br />
<br />
<dascript><br />
struct name<br />
{<br />
type identifier1;<br />
type identifier2,identifier3;<br />
type identifier4;<br />
};<br />
</dascript><br />
<br />
Things to note: braces, semi-colon after member declaration, semi-colon after struct declaration. <br />
<br />
== Remarks ==<br />
<br />
* you cannot nest structs<br />
<br />
* you can include the command, effect, event, float, int, location, object or string data types and they all appear to work<br />
* you can include the itemproperty data type however there is no point (it is not used by anything other than its Get/SetLocal functions)<br />
* you can include the vector data type or another struct but it will either fail to compile (can generate a "Void expression where non void required" error) or fail at runtime when you try to access it/its members<br />
* you cannot include the resource data type: it will not compile (generates a "Bad type specifier" error)<br />
* you cannot include an array (can generate an "Incorrect variable state left on stack" or "Void expression where non void required" error)<br />
* you cannot declare an array of structs<br />
<br />
<br />
* wrapping a vector in a dummy location<br />
* wrapping a resource in a dummy event<br />
* a pseudo-array could be created using an effect (limited to floats, ints, objects and/or strings)<br />
* a pseudo-array could be created using an event (limited to floats, ints, locations, objects, resources and/or strings)<br />
<br />
== Examples ==<br />
<br />
<br />
<dascript><br />
// user-defined type<br />
struct quaternion<br />
{<br />
float w, x, y, z;<br />
};<br />
<br />
// constructor<br />
struct quaternion Quaternion(float fW, float fX, float fY, float fZ)<br />
{<br />
struct quaternion q;<br />
<br />
q.w = fW;<br />
q.x = fX;<br />
q.y = fY;<br />
q.z = fZ;<br />
<br />
return q;<br />
}<br />
<br />
void main()<br />
{<br />
struct quaternion q = Quaternion(0.0, 0.0, 0.0, 0.0);<br />
}<br />
</dascript><br />
<br />
* Declaration<br />
* Definition<br />
* Assignment<br />
* Comparison<br />
* Member access<br />
* Passing into a function<br />
* Returning from a function<br />
<br />
== See Also ==<br />
<br />
* [[:Category:Structs]] for structs defined in the [[Core Game Resources]] and [[Single Player Campaign]].</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Int_keyword&diff=19927Int keyword2020-04-13T13:33:13Z<p>Sunjammer: Added links</p>
<hr />
<div>__NOTOC__<br />
The '''int''' type represents a signed 32-bit integer between -2,147,483,648 and 2,147,483,647. The default value is 0.<br />
<br />
== Literals ==<br />
<br />
An int [[Scripting terminology#literal|literal]] can be a decimal (base 10) or hexadecimal (base 16) number. A decimal integer literal consists of a string of decimal digits (0-9). A hexadecimal literal consists of "0x" or "0X" followed by a string of hexadecimal digits (0-9, a-f, A-F).<br />
<br />
== Conversion ==<br />
<br />
=== Explicit ===<br />
<br />
The following functions can be used to convert another data type to an int:<br />
<br />
* [[CharToInt]]<br />
* [[FloatToInt]]<br />
* [[HexStringToInt]]<br />
* [[StringToInt]]<br />
<br />
The following functions can be used to convert an int to another data type:<br />
<br />
* [[IntToChar]]<br />
* [[IntToFloat]]<br />
* [[IntToHexString]]<br />
* [[IntToString]]<br />
* [[ToString]]<br />
<br />
=== Implicit ===<br />
<br />
There is no implicit conversion to an int.<br />
<br />
== Persistence ==<br />
<br />
The following functions allow an int to exists outside of the scope of the current script by storing it on an object, effect or event:<br />
<br />
* [[SetLocalInt]]<br />
* [[SetEffectInteger]]<br />
* [[SetEventInteger]]<br />
<br />
The following functions allow an int which exist outside of the scope of the current script to be used in the current script by retrieving it from an object, effect or event:<br />
<br />
* [[GetLocalInt]]<br />
* [[GetEffectInteger]]<br />
* [[GetEventInteger]]<br />
<br />
== Special ==<br />
<br />
In [[dascript]] there is no Boolean type. Instead integer values are used to represent Boolean values: 0 represents the '''false''' state and anything else represents the '''true''' state. For convenience two [[boolean constants]] have been defined in [[script.ldf]] to represent the true and false states:<br />
<br />
<dascript><br />
int FALSE = 0;<br />
int TRUE = 1;<br />
</dascript><br />
<br />
Care should be taken when evaluating comparisons with TRUE as, for example, the number 2 will evaluate to '''true''' but 2 == TRUE would evaluate to '''false''' because the literal value of TRUE is not 2.<br />
<br />
== Examples ==<br />
<br />
<dascript><br />
void main()<br />
{<br />
// uninitialised: value = 0<br />
int nDefault;<br />
<br />
// initialised: value = 42<br />
int nSpecific = 42;<br />
<br />
// initialised with hexadecimal literal: value = 42<br />
int nHexadecimal = 0x002A;<br />
<br />
// initialised with boolean constant: value = 1<br />
int bBoolean = TRUE;<br />
}<br />
</dascript><br />
<br />
== See Also ==<br />
<br />
[[PrintInteger]]<br />
<br />
<br />
[[Category:Keywords]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19926Compiler error message2020-04-13T12:39:02Z<p>Sunjammer: Added some new messages</p>
<hr />
<div>When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying to understand compiler error message:<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
== Messages == <br />
The following is a list of compiler error messages that have been encountered and what caused them. It is important to be aware that these may not be the only cause for a particular error and therefore should be viewed as examples rather than definitions.<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [example].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [example].<br />
<br />
=== <span id="F">F</span> ===<br />
;Function definition missing parameter list<br />
:The brackets were omitted when defining a function.<br />
<!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled directly (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<br />
;Invalid declaration type<br />
:The brackets were omitted when declaring a function.<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [example].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
;No semicolon after structure<br />
# The statement terminator (;) is missing from the end of a structure definition.<br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[struct keyword|struct]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<br />
;Void expression where non void required<br />
: Assigned a member of a [[vector]] which was itself a member of a [[struct keyword|struct]] to a variable.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --></div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User:Sunjammer&diff=19925User:Sunjammer2020-04-13T11:43:29Z<p>Sunjammer: Added link, sorted WIP section</p>
<hr />
<div>Community Code Monkey<br />
<br />
== Work in progress ==<br />
<br />
* [[/90210|90210]]<br />
* [[/Abrigand's Arena of Agony|Abrigand's Arena of Agony]]<br />
* [[/Compiler error message|Compiler error message (draft)]] (see also [[Script error]])<br />
* [[/Item_upgrades_(draft)|Item upgrades (draft)]]<br />
* [[/Move resources (draft)|Move resources (draft)]]<br />
* [[/Plot_flags_(draft)|Plot flags (draft)]]<br />
* [[/Struct keyword (draft)|Struct keyword (draft)]]<br />
<br />
== Tests ==<br />
<br />
* [[/Wiki extensions test]]<br />
* [[/Main Page]]<br />
<br />
== To Do List ==<br />
{{ToDoList|Sunjammer}}<br />
<br />
* [[:Category:Keywords|Keywords]] & [[Keyword]]<br />
* [[:Category:Directives|Directives]] & [[Directive]]<br />
* [[:Category:Operators|Operators]] & [[Operator]]<br />
* [[:Category:Core scripts|Core scripts]]<br />
* [[:Category:Broken functions|Broken functions]]<br />
* [[Itemproperty keyword]]<br />
<br />
<br />
* [[Special:WantedCategories|Wanted categories]]<br />
* [[Special:WantedPages|Wanted pages]]<br />
<br />
<br />
<DynamicPageList><br />
category = Category:2da files from ABI base.xls<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
* confirm common root for M2DA_base m2da files<br />
* update links in all 2da files<br />
* make formatting consistent<br />
* remove negative assertions<br />
<br />
<DynamicPageList><br />
category = Include files<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = 2da types<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
<DynamicPageList><br />
category = Maintenance<br />
order = ascending<br />
ordermethod = sortkey<br />
</DynamicPageList><br />
<br />
* New Tutorial Navigation icons</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19924Compiler error message2020-04-13T01:44:10Z<p>Sunjammer: Fixed rogue comment tag.</p>
<hr />
<div>When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying compiler error message:'<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [explanation].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [explanation].<br />
<!-- <br />
=== <span id="F">F</span> === --><!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [explanation].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --> <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[Struct keyword|structure]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --></div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Compiler_error_message&diff=19923Compiler error message2020-04-13T01:42:12Z<p>Sunjammer: Cleaned up existing messages, added some new messages.</p>
<hr />
<div>When the compiler encounters a syntax error it aborts the process for that script and displays a '''compiler error message''' in the [[Log window panel|Log window]].<br />
<br />
There are a couple of guidelines to remember when trying compiler error message:'<br />
* The compiler reports the error when it can no longer make sense of the script: this often occurs on the line '''after'' the line containing the error.<br />
* If the script has one or more include files the error may have "'''while compiling <include>.nss'''" appended to it, however the error may be in the script being compiled rather than an include file.<br />
<br />
<br />
{{TOC}}<br />
<br />
=== <span id="A">A</span> ===<br />
;After compound statement at end<br />
:The double quote before the file name is missing from an [[#include]] directive.<br />
<br />
=== <span id="B">B</span> ===<br />
; Break outside of loop or case statement<br />
: [explanation].<br />
<br />
<!-- <br />
=== <span id="C">C</span> === --> <br />
=== <span id="D">D</span> ===<br />
;Declaration does not match parameters<br />
: The wrong type of argument used when calling a function, e.g. a [[string]] passed into a [[int]] argument.<br />
<br />
;Declaration does not match parameters (<function>)<br />
: Too few or too many arguments used when calling a function.<br />
<br />
=== <span id="E">E</span> ===<br />
; Equality test has invalid operands<br />
: [explanation].<br />
<!-- <br />
=== <span id="F">F</span> === --><!-- <br />
=== <span id="G">G</span> === --><!-- <br />
=== <span id="H">H</span> === --><br />
=== <span id="I">I</span> ===<br />
;Included file not found<br />
# An include file does not exist or has not been saved.<br />
# The wrong file name used or the ".nss" extension included in an [[#include]] directive.<br />
: NOTE: include files cannot not be compiled (attempting to do so will generate a [[#S|Script must contain either a main or StartingConditional]] error).<br />
<!-- <br />
=== <span id="J">J</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="L">L</span> === --><!-- <br />
=== <span id="K">K</span> === --><!-- <br />
=== <span id="K">K</span> === --><br />
=== <span id="M">M</span> ===<br />
; Mismatched types<br />
# A value or variable is assigned to a variable of a different type, e.g. a [[string]] value assigned to an [[int]] varaible.<br />
# A function is assigned to a variable of a different type, e.g. a [[string] function to assigned to an [[int]] variable.<br />
# A function returns a different type from its declared return type.<br />
# A [[void]] function is assigned to a variable.<br />
<br />
=== <span id="N">N</span> ===<br />
; No colon after case label <br />
: [explanation].<br />
<br />
; No left bracket on arg list<br />
# The brackets were omitted when calling a function (without arguments).<br />
<br />
; No semicolon after expression<br />
# The statement terminator (;) is missing from the end of an expression.<br />
# A keyword in an expression contains a typo. <br />
<br />
; Not all control paths return a value<br />
# A function does not have a return statement.<br />
# A logic branch in a function does not have a return statement.<br />
# A function does not have an else or default case with a return function.<br />
<!-- <br />
=== <span id="O">O</span> === --><br />
=== <span id="P">P</span> ===<br />
; Parsing variable list <br />
# The statement terminator (;) is missing from the on previous line.<br />
# A line contains a rogue double-quotes mark.<br />
<!-- <br />
=== <span id="Q">Q</span> === --><!-- <br />
=== <span id="R">R</span> === --><!-- <br />
=== <span id="S">S</span> ===<br />
;Script must contain either a main or StartingConditional<br />
# Compiled an include file directly (instead of the script including it).<br />
# Used the incorrect case i.e. Main instead of main.<br />
<!--<br />
=== <span id="T">T</span> === --><br />
=== <span id="U">U</span> ===<br />
; Undefined identifier (<identifier>) <br />
# A variable is being used before it is defined.<br />
# A string is missing its opening double-quotes mark.<br />
<br />
;Undefined structure<br />
: A [[Struct keyword|structure]] is being used before it is defined.<br />
<br />
;Unknown state in compiler<br />
: Invalid syntax e.g. an extra comma in a list of arguments.<br />
<br />
; Unterminated string constant <br />
# A string is missing its closing double-quotes mark.<br />
# A line contains a rogue double-quotes mark.<br />
<br />
=== <span id="V">V</span> ===<br />
; Variable defined without type<br />
# A value is being assigned to a variable before it has been declared.<br />
# A variable is being assigned or passed into a function before it has been declared.<br />
<!-- <br />
=== <span id="W">W</span> === --><!-- <br />
=== <span id="X">X</span> === --><!-- <br />
=== <span id="Y">Y</span> === --><!-- <br />
=== <span id="Z">Z</span> === --></div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=User_talk:Sunjammer&diff=19922User talk:Sunjammer2018-02-18T21:56:26Z<p>Sunjammer: Reverted edits by Ladyofpayne1 (talk) to last revision by BryanDerksen</p>
<hr />
<div>I've give you admin and bureaucrat group membership, hope this will finally break the logjam we've been stuck in for so long now. Use them wisely! [[User:BryanDerksen|BryanDerksen]] 21:56, 11 May 2011 (UTC)</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Dragon_Age_Toolset_Wiki:Language_policy&diff=19886Dragon Age Toolset Wiki:Language policy2018-01-15T16:14:07Z<p>Sunjammer: Reverted edits by Bendixofdead (talk) to last revision by Sunjammer</p>
<hr />
<div>== Languages Bar ==<br />
<br />
A '''languages bar''' has been provided using the [[Template:Languages|Languages]] navigation template to make it easier for readers to see which translations are available for the current page and to navigate to those translated pages. The template also makes it easier for editors to link to translated pages from the original English page (and vice versa).<br />
<br />
As you can see the languages bar can be added anywhere on a page however it is recommended that it is placed at the bottom of each page for consistency.<br />
<br />
{{Languages}}<br />
<br />
=== Usage ===<br />
<br />
In order for the languages bar to function correctly each translated page must be created as a subpage of the original English page and the name of the subpage must be the language code, for example, "fr" for French. <br />
<br />
Creating a subpage is done by adding a forward slash and the name of the subpage to the name of the parent page.<br />
<br />
Parent_page/subpage<br />
<br />
The languages bar can then be added to both the original English page and each of the translated pages. On the original English page the '''PageName''' parameter can be omitted so the following format is used:<br />
<br />
<nowiki>{{Languages}}</nowiki><br />
<br />
On the translated page (regardless of language) the '''PageName''' parameter must be used to identify the original English page so the following format is used:<br />
<br />
<nowiki>{{Languages|name-of-the-English-page}}</nowiki><br />
<br />
=== Example ===<br />
<br />
The location for the Russian translation of this page is [[Project:Language_policy/ru]]. To display the language bar to this page we use <code><nowiki>{{Languages}}</nowiki></code> and to display the language bar (correctly) on the Russian version of this page we would use <code><nowiki>{{Languages|Project:Language_policy}}</nowiki></code>.<br />
<br />
We do ''not'' use <code><nowiki>{{Languages|Project:Language_policy/ru}}</nowiki></code> as the links to the original English page and any other translated pages would not be generated.<br />
<br />
=== Supported languages ===<br />
<br />
The table below lists the languages and language codes currently supported by the language bar. The language codes are show as a subpage of the Main Page.<br />
<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
! Page Name !! Language <br />
|-<br />
| Main Page || English<br />
|-<br />
| Main Page'''/af''' || Afrikaans<br />
|-<br />
| Main Page'''/ar''' || Arabic<br />
|-<br />
| Main Page'''/az''' || Azerbaijani<br />
|-<br />
| Main Page'''/bcc''' || Southern Balochi<br />
|-<br />
| Main Page'''/bg''' || Bulgarian<br />
|-<br />
| Main Page'''/br''' || Breton<br />
|-<br />
| Main Page'''/ca''' || Catalan<br />
|-<br />
| Main Page'''/cs''' || Czech<br />
|-<br />
| Main Page'''/da''' || Danish<br />
|-<br />
| Main Page'''/de''' || German<br />
|-<br />
| Main Page'''/el''' || Greek<br />
|-<br />
| Main Page'''/es''' || Spanish<br />
|-<br />
| Main Page'''/fa''' || Persian<br />
|-<br />
| Main Page'''/fi''' || Finnish<br />
|-<br />
| Main Page'''/fr''' || French<br />
|-<br />
| Main Page'''/gl''' || Galician<br />
|-<br />
| Main Page'''/gu''' || Gujarati<br />
|-<br />
| Main Page'''/he''' || Hebrew<br />
|-<br />
| Main Page'''/hu''' || Hungarian<br />
|-<br />
| Main Page'''/id''' || Indonesian<br />
|-<br />
| Main Page'''/it''' || Italian<br />
|-<br />
| Main Page'''/ja''' || Japanese<br />
|-<br />
| Main Page'''/ka''' || Georgian<br />
|-<br />
| Main Page'''/ko''' || Korean<br />
|-<br />
| Main Page'''/ksh''' || Kölsch<br />
|-<br />
| Main Page'''/mk''' || Macedonian<br />
|-<br />
| Main Page'''/ml''' || Malayalam<br />
|-<br />
| Main Page'''/mr''' || Marathi<br />
|-<br />
| Main Page'''/ms''' || Malay<br />
|-<br />
| Main Page'''/nl''' || Nederlands<br />
|-<br />
| Main Page'''/no''' || Norwegian<br />
|-<br />
| Main Page'''/oc''' || Occitan<br />
|-<br />
| Main Page'''/pl''' || Polish<br />
|-<br />
| Main Page'''/pt''' || Portuguese<br />
|-<br />
| Main Page'''/pt-br''' || Brazilian Portuguese<br />
|-<br />
| Main Page'''/ro''' || Romanian<br />
|-<br />
| Main Page'''/ru''' || Russian<br />
|-<br />
| Main Page'''/si''' || Sinhalese<br />
|-<br />
| Main Page'''/sk''' || Slovak<br />
|-<br />
| Main Page'''/sq''' || Albanian<br />
|-<br />
| Main Page'''/sr''' || Serbian<br />
|-<br />
| Main Page'''/sv''' || Swedish<br />
|-<br />
| Main Page'''/ta''' || Tamil<br />
|-<br />
| Main Page'''/th''' || Thai<br />
|-<br />
| Main Page'''/tr''' || Turkish<br />
|-<br />
| Main Page'''/uk''' || Ukrainian<br />
|-<br />
| Main Page'''/vi''' || Vietnamese<br />
|-<br />
| Main Page'''/yue''' || Cantonese<br />
|-<br />
| Main Page'''/zh''' || Chinese<br />
|-<br />
| Main Page'''/zh-hans''' || Chinese (Simplified)<br />
|-<br />
| Main Page'''/zh-hant''' || Chinese (Traditional)<br />
|-<br />
| Main Page'''/zh-tw''' || Chinese (Taiwan)<br />
|}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=MediaWiki:Common.css&diff=19859MediaWiki:Common.css2017-12-30T21:39:00Z<p>Sunjammer: Undo revision 19847 by Sunjammer (talk)</p>
<hr />
<div>/* CSS placed here will be applied to all skins */<br />
<br />
<br />
/* Toolset's anvil logo */<br />
#p-logo a { <br />
background-image: url('http://www.datoolset.net/mw/images/4/4c/DA_Toolset.png') !important; <br />
background-repeat:no-repeat !important; <br />
background-position: 35% 50% !important;<br />
}<br />
<br />
<br />
/* 'show'/'hide' buttons created dynamically by the */<br />
/* CollapsibleTables JavaScript in [[MediaWiki:Common.js]] */<br />
/* are styled here so they can be customised. */<br />
.collapseButton {<br />
float: right;<br />
font-weight: normal;<br />
text-align: right;<br />
width: auto;<br />
}<br />
<br />
<br />
/* Hide the heading on the main page */<br />
body.page-Main_Page h1.firstHeading { <br />
display:none; <br />
}<br />
<br />
<br />
/* Fix font size for dascript and pre */<br />
.dascript, code, pre {<br />
font-size: 10pt !important; <br />
}<br />
<br />
<br />
<br />
/* wikitable/prettytable class for skinning normal tables */<br />
table.wikitable,<br />
table.prettytable {<br />
margin: 1em 1em 1em 0;<br />
background: #F9F9F9;<br />
border: 1px #AAAAAA solid;<br />
border-collapse: collapse;<br />
empty-cells: show;<br />
}<br />
<br />
.wikitable th, .wikitable td,<br />
.prettytable th, .prettytable td {<br />
border: 1px #AAAAAA solid;<br />
padding: 0.2em;<br />
}<br />
<br />
.wikitable th,<br />
.prettytable th {<br />
background: #F2F2F2;<br />
text-align: center;<br />
}<br />
<br />
.wikitable caption,<br />
.prettytable caption {<br />
font-weight: bold;<br />
}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=MediaWiki:Common.css&diff=19847MediaWiki:Common.css2017-12-14T01:43:00Z<p>Sunjammer: Fixing logo path (https)</p>
<hr />
<div>/* CSS placed here will be applied to all skins */<br />
<br />
<br />
/* Toolset's anvil logo */<br />
#p-logo a { <br />
background-image: url('https://www.datoolset.net/mw/images/4/4c/DA_Toolset.png') !important; <br />
background-repeat:no-repeat !important; <br />
background-position: 35% 50% !important;<br />
}<br />
<br />
<br />
/* 'show'/'hide' buttons created dynamically by the */<br />
/* CollapsibleTables JavaScript in [[MediaWiki:Common.js]] */<br />
/* are styled here so they can be customised. */<br />
.collapseButton {<br />
float: right;<br />
font-weight: normal;<br />
text-align: right;<br />
width: auto;<br />
}<br />
<br />
<br />
/* Hide the heading on the main page */<br />
body.page-Main_Page h1.firstHeading { <br />
display:none; <br />
}<br />
<br />
<br />
/* Fix font size for dascript and pre */<br />
.dascript, code, pre {<br />
font-size: 10pt !important; <br />
}<br />
<br />
<br />
<br />
/* wikitable/prettytable class for skinning normal tables */<br />
table.wikitable,<br />
table.prettytable {<br />
margin: 1em 1em 1em 0;<br />
background: #F9F9F9;<br />
border: 1px #AAAAAA solid;<br />
border-collapse: collapse;<br />
empty-cells: show;<br />
}<br />
<br />
.wikitable th, .wikitable td,<br />
.prettytable th, .prettytable td {<br />
border: 1px #AAAAAA solid;<br />
padding: 0.2em;<br />
}<br />
<br />
.wikitable th,<br />
.prettytable th {<br />
background: #F2F2F2;<br />
text-align: center;<br />
}<br />
<br />
.wikitable caption,<br />
.prettytable caption {<br />
font-weight: bold;<br />
}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=GeSHi_highlighting&diff=19846GeSHi highlighting2017-12-12T21:27:26Z<p>Sunjammer: Sunjammer moved page GeSHI highlighting to GeSHi highlighting without leaving a redirect</p>
<hr />
<div>GeSHi highlighting allows you to specify blocks of content as a particular programming language and have it highlighted appropriately. <br />
<br />
We have installed syntax highlighting for NWN scripting and DA scripting! Just use either the "dascript" or "nwscript" tags around your code. (like so: <nowiki><dascript>Dragon Age script code</dascript></nowiki> and <nowiki><nwscript>NWN script code</nwscript></nowiki>)<br />
<br />
'''NOTE:''' the dascript highlighting is copied/pasted from the nwscript one; we are looking for contributions/improvements to match what is actually in DAscripts!<br />
<br />
Example:<br />
<br />
DAscript:<br />
<dascript><br />
void main()<br />
{<br />
SendMessageToPC(GetEnteringObject(), "Hello world");<br />
}<br />
</dascript><br />
<br />
NWScript:<br />
<nwscript><br />
void main()<br />
{<br />
SendMessageToPC(GetEnteringObject(), "Hello world");<br />
}<br />
</nwscript><br />
<br />
<br />
Geshi homepage: http://qbnz.com/highlighter/</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Main_Page&diff=19845Main Page2017-12-12T21:26:23Z<p>Sunjammer: Fixed typo</p>
<hr />
<div>__NOTOC__<br />
<big>'''Welcome to the Dragon Age Toolset documentation wiki!'''</big><br />
<br />
The Dragon Age Toolset puts the power of the game developer in the palm of your hands. The Dragon Age Toolset will allow you to produce your own content including dungeons crawls, full-length campaigns, add-ons and cut-scenes you can share with friends and the BioWare community. Registered game owners of the PC version of Dragon Age: Origins can download the toolset [http://social.bioware.com/toolset.php here].<br />
<br />
'''Note that version 1.00 of the toolset has a flaw in its core resources that can prevent the main campaign from playing properly after you export resources. This can be cleaned up if it happens, but can require a bit of work to get right. See [[Plot GUID bug]] for more details. Version 1.01 (the current version) corrects this.'''<br />
<br />
'''If you are upgrading from version 1.00 to version 1.01 or later and wish to keep your existing database resources, see [[database migration]] for instructions on how to to move resources into the new version of the database. The DADBDATA format has changed between these versions.'''<br />
<br />
For assistance with installing or running the game, or for issues regarding BioWare-published content, see the [http://help.dragonage.com/ Dragon Age help site].<br />
<br />
{| width="100%"<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%" |<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Getting Started]] <div style="float:right; font-size:x-small;">([[Getting Started|link]])</div></h2><br />
<br />
<div style="margin:0; background: #f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; float:right; font-size:x-small;"><br />
* [[Creating an account]]<br />
* [[Installing the toolset]]<br />
* [[Installation troubleshooting]]<br />
* [[Overview of the toolset]]<br />
</div><br />
<br />
The toolset can be very daunting to dive into at first. This section covers topics useful to new users - how to get the toolset set up, how to navigate its interfaces, and where to look to get started on common tasks.<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%" |<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Tutorials]] <div style="float:right; font-size:x-small;">([[Tutorials|link]])</div></h2><br />
<br />
This section contains a list of step-by-step tutorials for a wide variety of editors and tasks you might need to do. Note that these tutorials will also be linked to from the sections that cover their respective subject matter; this is just to collect them all into one place for ease of reference.<br />
<br />
|-<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Design]] <div style="float:right; font-size:x-small;">([[Design|link]])</div></h2><br />
<br />
Once you have the pieces you need for an adventure - level layouts, creatures, abilities, and so forth - there's still the step of putting it all together into a playable game. This involves placing resources into areas, hooking up plots, and all sorts of other miscellaneous tasks. <br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%; " valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Art]] <div style="float:right; font-size:x-small;">([[Art|link]])</div></h2><br />
<br />
This section covers such things as how to import new models into the game, how to design level layouts, and how to create unique head morphs for NPCs. You can download the art sources for the main campaign from [http://social.bioware.com/project/1331/#files the Single player and core resource source files] project.<br />
<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Cinematography]] <div style="float:right; font-size:x-small;">([[Cinematography|link]])</div></h2><br />
<br />
Dragon Age is a heavily cinematics-oriented game. Every line in every conversation has the potential to be written as a full-blown cutscene, though in most cases a simpler treatment is perfectly adequate. Cutscenes can also be created independent of any conversation, to be triggered by script at appropriate moments.<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Sound and music]] <div style="float:right; font-size:x-small;">([[Sound and music|link]])</div> </h2><br />
<br />
Sounds are used in Dragon Age in a variety of ways. Voice over, background music, the sounds of combat and spells, ambient noises placed throughout areas or triggered by scripts and player actions, are all covered in this section.<br />
<br />
|-<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[Script]] <div style="float:right; font-size:x-small;">([[Script|link]])</div></h2><br />
<br />
Scripting is used whenever the designers need control over the game's behaviour. The syntax for DA scripts is very similar to the C programming language. Scripting is commonly used to:<br />
* Trigger plot events <br />
* Create or modify abilities - skills, talents, and spells <br />
* Handle creature and party member AI<br />
<br />
| valign="top" height="100%" style="margin:0; background:#f5faff; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em; width:50%; height:100%" valign="top"|<br />
<br />
<h2 style="margin:0; background:#cedff2; font-size:150%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">[[3rd party extensions]] <div style="float:right; font-size:x-small;">([[3rd party extensions|link]])</div></h2><br />
<br />
The toolset released by BioWare doesn't cover every possible task that might be needed by the end user. This section covers third-party tools that don't easily fall under other subject areas covered by the toolset.<br />
<br />
|}<br />
<br />
* Also see [[technical information]] for a list of documents about the more in-depth technical workings of the toolset and of Dragon Age: Origins.<br />
<br />
== Editing this wiki ==<br />
<br />
The documentation for the toolset is still being worked on so some of the material here may be incomplete or somewhat out-of-date. If you wish to contribute (either by adding your own material or by highlighting holes) you are most welcome to jump right in and edit. If you see something that needs improvement but you're not sure how (or you just don't have the time) you can mark it by adding "<nowiki>{{undocumented}}</nowiki>" at the trouble spot.<br />
*The '''[http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide]''' has information on how to edit this wiki. This wiki is powered by the MediaWiki engine.<br />
*[[GeSHi highlighting]] is installed, including "nwscript" and "dascript" tags.<br />
<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=MediaWiki:Common.css&diff=19844MediaWiki:Common.css2017-12-12T20:59:07Z<p>Sunjammer: Fixing image path</p>
<hr />
<div>/* CSS placed here will be applied to all skins */<br />
<br />
<br />
/* Toolset's anvil logo */<br />
#p-logo a { <br />
background-image: url('http://www.datoolset.net/mw/images/4/4c/DA_Toolset.png') !important; <br />
background-repeat:no-repeat !important; <br />
background-position: 35% 50% !important;<br />
}<br />
<br />
<br />
/* 'show'/'hide' buttons created dynamically by the */<br />
/* CollapsibleTables JavaScript in [[MediaWiki:Common.js]] */<br />
/* are styled here so they can be customised. */<br />
.collapseButton {<br />
float: right;<br />
font-weight: normal;<br />
text-align: right;<br />
width: auto;<br />
}<br />
<br />
<br />
/* Hide the heading on the main page */<br />
body.page-Main_Page h1.firstHeading { <br />
display:none; <br />
}<br />
<br />
<br />
/* Fix font size for dascript and pre */<br />
.dascript, code, pre {<br />
font-size: 10pt !important; <br />
}<br />
<br />
<br />
<br />
/* wikitable/prettytable class for skinning normal tables */<br />
table.wikitable,<br />
table.prettytable {<br />
margin: 1em 1em 1em 0;<br />
background: #F9F9F9;<br />
border: 1px #AAAAAA solid;<br />
border-collapse: collapse;<br />
empty-cells: show;<br />
}<br />
<br />
.wikitable th, .wikitable td,<br />
.prettytable th, .prettytable td {<br />
border: 1px #AAAAAA solid;<br />
padding: 0.2em;<br />
}<br />
<br />
.wikitable th,<br />
.prettytable th {<br />
background: #F2F2F2;<br />
text-align: center;<br />
}<br />
<br />
.wikitable caption,<br />
.prettytable caption {<br />
font-weight: bold;<br />
}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Adding_custom_armor_tutorial&diff=19834Adding custom armor tutorial2017-11-18T18:43:21Z<p>Sunjammer: Adding note</p>
<hr />
<div><div align="center" style="background-color:#FFF7F0; border:2px #FF7f00 solid; padding:4px; margin:4px;"><br />
The English version of this page does not yet exist.<br />
</div><br />
<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Adding_custom_armor_tutorial/ru&diff=19833Adding custom armor tutorial/ru2017-11-18T18:36:11Z<p>Sunjammer: Adding launguages bar</p>
<hr />
<div>В ходе этого туториала мы импортируем платье Кристины Веспуччи из Assassins Creed: Brotherhood в ДАО. Вернее из XNA Lara, потому что ничего другого я не нашел. Это платье я выбрал не случайно - в ходе его адаптации мы используем все те приемы, которые часто используются в этом процессе ("дырявая ткань" аля кружева, текстуры кложи, зависящие от кожи персонажа, многослойный материал и т.д.).Это будет всего-лишь реплейсер, заменитель. Заменять будем церковную робу - просто потому что ее легче всего достать (в прологе мага, например, или с Лелианы в Лотеринге). Ну чтож, приступим...<br />
Инструменты, что нам понадобятся:<br />
*3ds max (или бесплатная версия - gmax). 3ds max не старше 2011 года- скрипт по импорту не будет работать.<br />
*Dragon Age Origins<br />
*Dragon Age Toolset<br />
*Adobe Photoshop 32 version only because Nvidia DDS Plugin work only with 32 program.<br />
*[http://www.nexusmods.com/dragonage/mods/895/? Eshme Import/Export DAO Tools] (плагин для 3ds max)<br />
*Вы можете использовать эту программу [http://www.nexusmods.com/dragonage/mods/214/? GDA Editor] для файлов GDA типа.<br />
*Движок не сможет работать с моделью больше 45 000 полигонов (Faces) и 30 000 вершин (Vertices).<br />
<br />
== Script Settings ==<br />
<br />
Сделите за тем, куда вы устанавливаете все программы- program files(x86) для 32 битных программ на 64 bit компьютерах. Скрипт экспорта и сама игра должны быть в одной папке program files.<br />
<br />
Установка скрипта Eshme Import/Export: Startup, YAGG и DAOTools добавить в C(диск):/Program Files/Autodesk/3dsmax/Scripts -> scripts <br />
<br />
Настройка. Если вы все сделали правильно, то при первом запуске возникнет окно с настройками. <br />
<br />
В Game Path должно быть указано папка с игрой аля C:\Program Files (x86)\Dragon Age, в Export Path папка Override в документах аля C:\Program Files (x86)\Dragon Age\packages\core\override. Наличие установленного тулсета самой последней версии ОБЯЗАТЕЛЬНО. Сам тулсет должен быть установлен в папку с игрой и после этого вы сможете начать работу в 3 d Max -> Run Script.<br />
<br />
== Textures preparation ==<br />
<br />
Нам понадобятся четыре: диффузная карта (основная, видимая текстура), нормал карта (однотонная рельефная карта), спекуляр карта (она помогает настроить освещение конкретно под модель) и тинт карта (она говорит двужку где кожа, а где не изменная ткань). Так как исходная модель содержит несколько материалов, то и наборов текстур тоже несколько. Это значит, что например диффузных карт будет тоже несколько.<br />
Сначала переведем их в формат .DDS с помощью фотошопа. Помните, что размер текстур ВСЕГДА должен быть кратным 4: 1024 -> 2048 -> 4096 -> 8192.<br />
<br />
Diffuse map:<br />
Кожа обязательно должна быть перведена в бледно-серый цвет, чтобы максимально корректно отображать цвет кожи. Должно получиться примерно так:<br />
<br />
[[File:Skin1ex.png|border]]<br />
<br />
В альфа канале (если его нету, то создаем его с названием Alpha 1) выделяем черным те области, которые будут "дырками", белое так и останется не прозрачным. Получиться должно нечто вроде этого:<br />
<br />
[[File:Alpha1ex.png|border]]<br />
<br />
Normal map: <br />
Нужно перенести текстуру в монотонно серый. Помимо этого, нужно еще изменить изображение альфа-канала на идентичный зеленому каналу. Должно получится нечто вроде этого:<br />
<br />
[[File:Normalex.png|border]]<br />
<br />
Spectacular map:<br />
Почти ничем не отличается от диффузной, только чуть более темней. Элементы с кожей в обязательном порядке нужно модифицировать. Цвет нужно изменить на темно-красный, почти черный. Саму область нужно подвергнуть обработке: image-> adjustments ->brightness/contrast значение выставлять примерно такие brightness -45, contrast 95. В итоге кожа должна стать примерно такой:<br />
<br />
[[File:Spectacularex.png|border]]<br />
<br />
* Note: В альфа канал спекуляр карты нужно просто скопировать синий канал. '''Делать это нужно уже после того, как разберетесь с участками кожи.'''Чем больше белого на текстуре _s тем больше и интенсивней будет блеск.<br />
<br />
Tint map:<br />
* '''Note: Не нужна вам если на вашей броне нет участков кожи'''<br />
Самая простая текстура - работать будет только в альфа канале. Всю текстуру полностью залейте черным цветом. В альфа канале нужно будет сделать примерно тоже самое, что мы уже проделали с альфа каналом диффузной карты, только на этот раз черным будут зоны, которые будут менять тон в соответствии с кожей персонажа, а белые оставаться не изменными. Эта тесктура полностью залита черным потому, что она полностью покрывает кожу и участки, а значит и выделываться здесь смысла нет. То есть да - конкретно в нашем случае должна получиться полностью черная текстура - все четыре канала залиты черным.<br />
<br />
== Connecting textures ==<br />
<br />
Cоединение текстур. Как я уже упомянал, платье Кристины Веспуччи содержит несколько материалов. Движок ДАО может поддерживать только один материал, а значит нам придется все текстуры объединить.<br />
Самое главное в том, что один раз определившись порядком текстур, нужно придерживаться его постоянно. В общем, нам нужно выстроить примерно такую конструкцию:<br />
<br />
[[File:Text1.png|border]]<br />
<br />
'''*Note: Запомните положение текстур, оно вам понадобится при объединении материалов в 3ds Max.'''Тоже самое и для остальных карт (нормали, спекуляр и тинт). Альфа каналы выстраиваем так же. Размер текстур должен быть кратным 4.<br />
<br />
== Save textures ==<br />
<br />
Текстуры нужно сохранять с такими настройками: <br />
<br />
[[File:Therestsave.png|border|50%]]<br />
<br />
Normal map:<br />
<br />
[[File:Normalsave.png|border|50%]]<br />
<br />
Все, на этом в фотошопе закончено. Можно его закрывать. Переименуйте текстуры в hf_rob_chaz_0n.dds (normal-текстура), hf_rob_chaz_0d (diffuse-текстура), hf_rob_chaz_0s (спекуляр) и hf_rob_chaz_0t (тинт карта). Сами текстуры уже можно переместить в папку [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\<br />
<br />
== Names ==<br />
<br />
Очень важно для GDA. <br />
Текстуры надо называть так: [принадлежность полу-расе]_[тип брони\одежды]_[уникальный индекс из 4 букв]_0[тип текстуры].<br />
Принадлежность полу расе обозначается так:<br />
*hf- жен. человек<br />
*hm- муж. человек<br />
*ef- жен. эльф<br />
*em- муж. эльф<br />
*df- жен. гном<br />
*dm- муж. гном<br />
*qm- кунари-мужик<br />
Броня:<br />
*arm - броня<br />
*rob - роба (мага, церковника)<br />
*cth - одежда (дворянина, свадебная)<br />
Helmets:<br />
*hlh - for mages.<br />
*hlf - massive ones.<br />
<br />
'''NOTE: Уникальный индекс можете выбрать любой. Главное помните - не больше 4 букв и не занятый другой вещью.'''<br />
<br />
Типов текстур 5:<br />
*d - диффузная (Duffise)<br />
*n - нормаль (Normal)<br />
*s - спекуляр (Spectacular)<br />
*t - тинт (Tint)<br />
*e - эммиссив (Emissive) Нужна для свечения аля скай-фай броня. В дао почти не используется)<br />
В итоге должно получиться нечто вроде такого: hf_rob_xmpl_0d или em_arm_exmp_0n. <br />
'''*NOTE: Сам материал (название материала в максе, потом это будет MAO файл) именуем также, только без типа текстуры. Например: hf_rob_xmpl или em_arm_exmp. Модель именуется так-же, только с цифрой детализации в конце: hf_rob_xmpl_0 или em_arm_exmp_0'''<br />
<br />
== 3D MAX ==<br />
<br />
'''NOTE: Если ваша броня выглядит слишком "грубой", то это можно исправить ПКМ-> Convert to Edit Poly -> Режим Vertex на панели справа -> press button Weld (Vertexes) на панели справа. Можно там же использовать и Smooth, но будьте осторожны- это добавит новые полигоны ваша модель может не подойти для движка.'''<br />
<br />
В ходе адаптации модели нам понадобится максимально похожий образец из оригинальной игры. В моем случае я выбрал церковную робу (hf_rob_chaa) – этакий универсальный образец, который подходит для большинства случаев. В Toolset’е откроем архивы modelhierarchies.erf materialobjects.erf modelmeshdata.erf (найти их можно по даресу [имя_диска_с_игрой]: \Dragon Age\packages\core\data). Так-же откроем архив texturepack.erf находящийся по адресу [имя_диска_с_игрой]:\Dragon Age\packages\core\textures\high. В этих архивах находим файлы<br />
hf_rob_chaa_0.mmh, hf_rob_chaa_0.phy (modelhierarchies.erf)<br />
hf_rob_chaa_0.msh (modelmeshdata.erf)<br />
pf_rob_chaa.mao (materialobjects.erf)<br />
pf_rob_chaa_0d.dds, pf_rob_chaa_0n.dds, pf_rob_chaa_0s.dds, pf_rob_chaa_0t.dds (texturepack.erf)<br />
и распаковываем в отдельную папку. Всего на выходе должно получится 8 файлов.<br />
<br />
А теперь перейдем в 3ds max. Прежде, чем приступить непосредственно к конвентированию, настроим плагин для 3ds max. Мне гораздо удобнее запускать сразу скрипты, чем захламлять разными кнопками рабочее пространство редактора. Для запуска конфигуратора запустим скрипт (Max Script->Run Script) DAOToolsSetup находящийся по адресу C:\Program Files\Autodesk\3dsMax8\Scripts\DAOTools.<br />
<br />
Итак, приступим, к настройке. В строке Game Path указываем адрес к папке с игрой. В Export Path указываем, куда будут сохранятся экспортированные файлы. Т.к. наша модель будет заменять уже имеющуюся, то укажем там адрес [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\ Ползунок World Scale ставим на значение 100. Дело в том, что в своем «естественном» виде, модели ДА очень маленькие. Для комфортной работы с ними нужно увеличить их в 100 (сто) раз. Эта функция как раз создана для того, чтобы на время работы увеличивать модель в удобный размер, а экспортируя обратно возвращая к естественным размерам. Все остальное оставляем нетронутым и нажимаем ОК. Конфигуратор перед закрытием проинформирует нас о возможности в любой момент изменить настройки, не пугайтесь выскочившего окна.<br />
<br />
И вот наконец теперь можно заняться непосредственно конвертированием. В окне редактора у нас должна уже быть открыта сама модель. Следующее, что нам нужно сделать, это загрузить оригинальную модель из ДАО. Для этого запускаем скрипт DAOImport. В пункте File секции Model Import указываем месторасположение недавно вытащенного нами .mmh файла (hf_rob_chaa_0.mmh). Нажимаем на кнопку Import, специальное окно известит нас о готовности к импорту, жмем ОК и ждем 5-30 секунд (в зависимости от мощности компьютера) пока загрузится модель.<br />
<br />
Для начала скроем все, что нам в данный момент не понадобится. Откроем Schematic View (Graph Editors-> New Schematic View) <br />
<br />
Здесь можно увидеть две большие древовидные структуры – это обе наши модели с их иерархией. Полностью выделим структуру оригинальной модели (легко определить по наличию в ней зеленых элементов). Сворачиваем Schematic View. В основном рабочем окне можно увидеть, что выделена оригинальная игровая модель и все ее элементы <br />
<br />
Теперь снимем выделение с самой робы, так чтобы выделенными остались лишь второстепенные элементы. Скроем их, чтобы не мешались, они нам все-равно не понадобятся. Для этого нажмем по пустому пространству рабочей области правой кнопкой мыши->hide selection. Теперь осталось только зафиксировать оригинальную модель. Для этого выделяем ее и правой кнопкой мыши->properties.<br />
Поставьте напротив опции Freeze секции interactivity, уберите напротив опции Show Frozen in Gray секции display Properties соответственно. Все, теперь оригинальная модель зафиксирована и защищена от случайных манипуляций.<br />
<br />
Теперь нужно подогнать модель платья Кристины под габариты игровой робы. Желательно сделать это как можно точнее. Для трансформации модели лучше всего воздействовать на ее кости, так гораздо удобнее. Масштабируем, поворачиваем и двигаем кости так, чтобы модель ровно легла в очертания оригинальной робы. Разводим руки, сводим ноги – процесс нужно делать на «глазок».<br />
<br />
== Working with materials ==<br />
<br />
*NOTE: Работать с материалами нужно до риггинга. Иначе будут проблемы.<br />
<br />
== More than one texture ==<br />
<br />
Важное отступление - если ваша модель полностью покрывается одной текстурой, то ничего из нижеописанного вам проделывать не нужно.<br />
Сейчас нам нужно объединить несколько материалов в один. Процесс не тривиальный. Итак, когда вы откроете редактор координат, то увидите вот такую картину:<br />
<br />
[[File:Editingmaterials.png|border]]<br />
<br />
Зеленые линии - это координаты модели на текстуре. Многие игровые движки используют все пространство редактора, но не ДАО. Наша игра не видит ничего за границами выделенного квадрата. Наша задача - передвинуть все координаты во внутрь этого квадрата. Во вкладке All ID's можно выбирать отдельные материалы и двигать их. Наложите текстуру, которую вы создали в фотошопе и согласно ее контурам отмасштабируте и перенесите ее на соответствующее место. Тоже самое нужно бьудет проделать и со всеми сетами материалов, чтобы в конце-концов получилось что-то вроде этого:<br />
<br />
[[File:Mated2.png|border]]<br />
<br />
После этого можно закрывать редактор координат.<br />
<br />
== Continue working with materials ==<br />
<br />
На верхней панели инструментов найдем кнопку редактора метериалов (четыре разноцветных шара) <br />
Далее нажимаем Get Material и выбираем из списка Dragon Age Material (если плагин установлен правильно, то он в списке будет) <br />
<br />
[[File:Materialeditor.png|border]]<br />
<br />
В Material Type указываем Character, в Render Semantics – [Armor w / Skin Tint][Alpha Blending][No Emissive]. Разворачиваем список Texture Maps и назначаем соответствующие текстуры. Далее Assign Material to Selection (платье должно быть выделенным). Если так хочется увидеть текстуру в редакторе, то жмем Show Map in Viewport. Осталось только дать нашему материалу нормальное имя. В соответствующем поле введем pf_rob_chaz_0. Вот и все.<br />
<br />
[[File:Materialwork.png|border]]<br />
<br />
== Rigging ==<br />
<br />
* [https://youtu.be/1QMcAX1cDyo Rigging tutorial]<br />
<br />
Как только наша модель полностью ляжет в очертания оригинальной робы, можно приступать к следующей фазе <br />
Выделим нашу модель, правой кнопкой мыши по пустому месту->Convert To-> Convert To Editable Mesh.<br />
Теперь полностью выделяем все объекты, снимаем выделение с самой модели платья Кристины (выделеными должны остаться все объекты КРОМЕ платья Кристины) и удаляем. Должны остаться только церковная роба и платье Кристины. Далее правой кнопкой мыши по пустому месту->Unfreeze All. Это разморозит оригинальную робу, сделав ее доступной для редактирования. Затем в списке ее модификаторов выделим Skin и Edit Normals (с зажатым CTRL). Правой кнопкой мыши по ним->Cut. Из списка модификаторов они должны исчезнуть. Далее правой кнопкой мыши по пустому месту рабочего пространства->Convert To->Convert To Editable Mesh. Это низведет оригинальную робу в тоже состояние, в котором сейчас пребывает и платье Кристины.<br />
<br />
Теперь перейдем в режим редактирования полигонов <br />
<br />
[[File:Polygon.png|border]]<br />
<br />
Нажмите CTL+ A Вся оригинальная роба должна окраситься в красный цвет выделения. Далее нужно снять выделение с одного-единственного полигона (делается с зажатой клавишей ALT). Какого именно – неважно, главное чтобы он был на виду и до него было просто добраться. Я выбрал один у самых ног. Все, что теперь нужно сделать – нажать кнопку Delete. Это удалит всю модель, кроме одного оставленного нами полигона. Теперь нам нужно прирастить к этому полигону платье Кристины. Для этого выберем на панели инструментов справа кнопку Attach и нажмем мышью на скафандр. Появится окно, выбрать опцию Match Material to Material IDs. Жмем ОК. Теперь нужно убрать последний полигон оригинальной робы. Вновь переходим в режим редактирования полигонов (предварительно «отжав» кнопку attach), находим когда-то оставленный нами полигон и удаляем его. Все, теперь уже не осталось ничего, что напоминало-бы нам о церковной робе.<br />
<br />
Вы должны закончить со всеми правками модели до того, как добавите модификатор Unwrap UVW. Если ваша модель выглядит грубой, то необходимо исправить:<br />
ПКМ -> converto to Editable Poly-> Vertex-> Select all (CTRL+ A)-> Weld -> Convert to editable Mesh<br />
<br />
'''Note:'''Закончите все правки модели и материалов до следующего шага - после него все изменения не отобразятся на конечном результате и придется переделывать. <br />
<br />
В списке модификаторов нашей модели найдем Unwrap UVW и добавим его к нашей модели. Модель должна окраситься ярко зелеными линиями.<br />
<br />
Далее правой кнопкой мыши по списку модификаторов->Paste. Список модификаторов должен стать таким (сверху-вниз: Skin, Edit Normals, Unwrap UVW)<br />
<br />
С самой моделью мы наконец закончили.<br />
<br />
== Dress with crinoline ==<br />
<br />
[[File:Crinoline_dressDAO.jpg|border]]<br />
*[https://youtu.be/_q4mmFMmIK8 Как сделать платье с кринолином]<br />
<br />
== Export ==<br />
<br />
Для этого запускаем скрипт DAOModelExport. Нам предстанет вот так вот такое окно:<br />
<br />
[[File:Export.png|border]]<br />
<br />
Между Name и .MMH вписать hf_rob_chaa_0. Между Name и .MSH вписать тоже самое (если этого не сделалось автоматически). Отметить опцию Create MAO Material File. Все, теперь жмем Export. По окончании процесса экспорта в папке [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\ должны появится пять новых файлов<br />
hf_rob_chaa_0.phy<br />
hf_rob_chaa_0.msh<br />
hf_rob_chaa_0.mmh<br />
hf_rob_chaa_0.met<br />
pf_rob_chaz_0.mao<br />
Там-же уже должны находится обе текстуры. Ну, вот собственно и все. Модель готова, можно запускать игру и смотреть результат.<br />
<br />
== Addding custom shield ==<br />
<br />
Процесс тот же самый с разницей, что щиту не нужен rigging.<br />
<br />
1) Импортируйте любой щит из игры. В отличие от брони тут не нужно следить за размером - ЛЮБОЙ щит подойдет.<br />
<br />
2) Импортируйте ваш щит в ту же сцену и погдгоните его размер к тому, что из игры.<br />
<br />
3) Сделайте из ващего нового щита ПКМ -> "make editable mesh". Collapse any active modifiers on the "new" item. Then add a new "unwrap UVW" modiefier to it, and double click it to open the UVW window. then drag and select everything you see there, and DRAG IT ANYWHERE OUTSIDE THE OUTLINED BOX IN THE CENTER. This will make life easier for you in step 6.<br />
<br />
4) Выберите щит из игры и выберете все модификаторы исключая "unwrap UVW". ПКМ ->"cut", а не удалить, потому что м ыбудем их использовать. Далее ПКМ -> "make editable mesh". <br />
<br />
5) Теперь "attach" щит из ДАО к вашему новому щиту. <br />
<br />
6) Добавть новый "unwrap uvw" к этому mesh. Проверьте все ли модификаторы на месте - press the "+" слева. Выберите "face", и выберете все, что внутри the outlined box в середине. ПКМ "unwrap UVW" и выберете "collapse to".<br />
<br />
7) Потом нажмите "+" слева от слов "editable mesh". Выберте "element" и удалите. Вставьте все модификаторы, которые мы вырезали на шаге 4.<br />
<br />
8) Добавьте текстуры и экспортируйте.<br />
<br />
== Useful links ==<br />
<br />
*[[Customisation of original Dragon age armor]]<br />
*[[Adding custom shield tutorial]]<br />
*[[Adding custom level tutorial]] - Add your own level.<br />
*[http://forums.nexusmods.com/index.php?/topic/423834-the-witcher-1-armors-in-da-origins/page-2#entry3544131 How to add new armor to DAO on English] <br />
*[http://forums.nexusmods.com/index.php?/topic/1122450-loincloth-fashion/page-56#entry16909714 How to fix GDA conflict]<br />
*[http://www.nexusmods.com/dragonage/mods/3974/? Item Variation ID spreadsheet modification]<br />
*[https://youtu.be/370D7Lul9tk Skinning tutorial]<br />
<br />
[[Category:Tutorials]]<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Adding_custom_armor_tutorial&diff=19832Adding custom armor tutorial2017-11-18T18:33:36Z<p>Sunjammer: Adding languages bar</p>
<hr />
<div>{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Adding_custom_armor_tutorial/ru&diff=19830Adding custom armor tutorial/ru2017-11-18T18:32:14Z<p>Sunjammer: moved Adding custom armor tutorial to Adding custom armor tutorial/ru: Relocating for languages bar</p>
<hr />
<div>В ходе этого туториала мы импортируем платье Кристины Веспуччи из Assassins Creed: Brotherhood в ДАО. Вернее из XNA Lara, потому что ничего другого я не нашел. Это платье я выбрал не случайно - в ходе его адаптации мы используем все те приемы, которые часто используются в этом процессе ("дырявая ткань" аля кружева, текстуры кложи, зависящие от кожи персонажа, многослойный материал и т.д.).Это будет всего-лишь реплейсер, заменитель. Заменять будем церковную робу - просто потому что ее легче всего достать (в прологе мага, например, или с Лелианы в Лотеринге). Ну чтож, приступим...<br />
Инструменты, что нам понадобятся:<br />
*3ds max (или бесплатная версия - gmax). 3ds max не старше 2011 года- скрипт по импорту не будет работать.<br />
*Dragon Age Origins<br />
*Dragon Age Toolset<br />
*Adobe Photoshop 32 version only because Nvidia DDS Plugin work only with 32 program.<br />
*[http://www.nexusmods.com/dragonage/mods/895/? Eshme Import/Export DAO Tools] (плагин для 3ds max)<br />
*Вы можете использовать эту программу [http://www.nexusmods.com/dragonage/mods/214/? GDA Editor] для файлов GDA типа.<br />
*Движок не сможет работать с моделью больше 45 000 полигонов (Faces) и 30 000 вершин (Vertices).<br />
<br />
<br />
== Script Settings ==<br />
<br />
Сделите за тем, куда вы устанавливаете все программы- program files(x86) для 32 битных программ на 64 bit компьютерах. Скрипт экспорта и сама игра должны быть в одной папке program files.<br />
<br />
Установка скрипта Eshme Import/Export: Startup, YAGG и DAOTools добавить в C(диск):/Program Files/Autodesk/3dsmax/Scripts -> scripts <br />
<br />
Настройка. Если вы все сделали правильно, то при первом запуске возникнет окно с настройками. <br />
<br />
В Game Path должно быть указано папка с игрой аля C:\Program Files (x86)\Dragon Age, в Export Path папка Override в документах аля C:\Program Files (x86)\Dragon Age\packages\core\override. Наличие установленного тулсета самой последней версии ОБЯЗАТЕЛЬНО. Сам тулсет должен быть установлен в папку с игрой и после этого вы сможете начать работу в 3 d Max -> Run Script.<br />
<br />
== Textures preparation ==<br />
<br />
Нам понадобятся четыре: диффузная карта (основная, видимая текстура), нормал карта (однотонная рельефная карта), спекуляр карта (она помогает настроить освещение конкретно под модель) и тинт карта (она говорит двужку где кожа, а где не изменная ткань). Так как исходная модель содержит несколько материалов, то и наборов текстур тоже несколько. Это значит, что например диффузных карт будет тоже несколько.<br />
Сначала переведем их в формат .DDS с помощью фотошопа. Помните, что размер текстур ВСЕГДА должен быть кратным 4: 1024 -> 2048 -> 4096 -> 8192.<br />
<br />
Diffuse map:<br />
Кожа обязательно должна быть перведена в бледно-серый цвет, чтобы максимально корректно отображать цвет кожи. Должно получиться примерно так:<br />
<br />
[[File:Skin1ex.png|border]]<br />
<br />
В альфа канале (если его нету, то создаем его с названием Alpha 1) выделяем черным те области, которые будут "дырками", белое так и останется не прозрачным. Получиться должно нечто вроде этого:<br />
<br />
[[File:Alpha1ex.png|border]]<br />
<br />
Normal map: <br />
Нужно перенести текстуру в монотонно серый. Помимо этого, нужно еще изменить изображение альфа-канала на идентичный зеленому каналу. Должно получится нечто вроде этого:<br />
<br />
[[File:Normalex.png|border]]<br />
<br />
Spectacular map:<br />
Почти ничем не отличается от диффузной, только чуть более темней. Элементы с кожей в обязательном порядке нужно модифицировать. Цвет нужно изменить на темно-красный, почти черный. Саму область нужно подвергнуть обработке: image-> adjustments ->brightness/contrast значение выставлять примерно такие brightness -45, contrast 95. В итоге кожа должна стать примерно такой:<br />
<br />
[[File:Spectacularex.png|border]]<br />
<br />
* Note: В альфа канал спекуляр карты нужно просто скопировать синий канал. '''Делать это нужно уже после того, как разберетесь с участками кожи.'''Чем больше белого на текстуре _s тем больше и интенсивней будет блеск.<br />
<br />
Tint map:<br />
* '''Note: Не нужна вам если на вашей броне нет участков кожи'''<br />
Самая простая текстура - работать будет только в альфа канале. Всю текстуру полностью залейте черным цветом. В альфа канале нужно будет сделать примерно тоже самое, что мы уже проделали с альфа каналом диффузной карты, только на этот раз черным будут зоны, которые будут менять тон в соответствии с кожей персонажа, а белые оставаться не изменными. Эта тесктура полностью залита черным потому, что она полностью покрывает кожу и участки, а значит и выделываться здесь смысла нет. То есть да - конкретно в нашем случае должна получиться полностью черная текстура - все четыре канала залиты черным.<br />
<br />
== Connecting textures ==<br />
Cоединение текстур. Как я уже упомянал, платье Кристины Веспуччи содержит несколько материалов. Движок ДАО может поддерживать только один материал, а значит нам придется все текстуры объединить.<br />
Самое главное в том, что один раз определившись порядком текстур, нужно придерживаться его постоянно. В общем, нам нужно выстроить примерно такую конструкцию:<br />
<br />
[[File:Text1.png|border]]<br />
<br />
'''*Note: Запомните положение текстур, оно вам понадобится при объединении материалов в 3ds Max.'''Тоже самое и для остальных карт (нормали, спекуляр и тинт). Альфа каналы выстраиваем так же. Размер текстур должен быть кратным 4.<br />
<br />
== Save textures ==<br />
<br />
Текстуры нужно сохранять с такими настройками: <br />
<br />
[[File:Therestsave.png|border|50%]]<br />
<br />
Normal map:<br />
<br />
[[File:Normalsave.png|border|50%]]<br />
<br />
Все, на этом в фотошопе закончено. Можно его закрывать. Переименуйте текстуры в hf_rob_chaz_0n.dds (normal-текстура), hf_rob_chaz_0d (diffuse-текстура), hf_rob_chaz_0s (спекуляр) и hf_rob_chaz_0t (тинт карта). Сами текстуры уже можно переместить в папку [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\<br />
<br />
== Names ==<br />
Очень важно для GDA. <br />
Текстуры надо называть так: [принадлежность полу-расе]_[тип брони\одежды]_[уникальный индекс из 4 букв]_0[тип текстуры].<br />
Принадлежность полу расе обозначается так:<br />
*hf- жен. человек<br />
*hm- муж. человек<br />
*ef- жен. эльф<br />
*em- муж. эльф<br />
*df- жен. гном<br />
*dm- муж. гном<br />
*qm- кунари-мужик<br />
Броня:<br />
*arm - броня<br />
*rob - роба (мага, церковника)<br />
*cth - одежда (дворянина, свадебная)<br />
Helmets:<br />
*hlh - for mages.<br />
*hlf - massive ones.<br />
<br />
'''NOTE: Уникальный индекс можете выбрать любой. Главное помните - не больше 4 букв и не занятый другой вещью.'''<br />
<br />
Типов текстур 5:<br />
*d - диффузная (Duffise)<br />
*n - нормаль (Normal)<br />
*s - спекуляр (Spectacular)<br />
*t - тинт (Tint)<br />
*e - эммиссив (Emissive) Нужна для свечения аля скай-фай броня. В дао почти не используется)<br />
В итоге должно получиться нечто вроде такого: hf_rob_xmpl_0d или em_arm_exmp_0n. <br />
'''*NOTE: Сам материал (название материала в максе, потом это будет MAO файл) именуем также, только без типа текстуры. Например: hf_rob_xmpl или em_arm_exmp. Модель именуется так-же, только с цифрой детализации в конце: hf_rob_xmpl_0 или em_arm_exmp_0'''<br />
<br />
== 3D MAX ==<br />
'''NOTE: Если ваша броня выглядит слишком "грубой", то это можно исправить ПКМ-> Convert to Edit Poly -> Режим Vertex на панели справа -> press button Weld (Vertexes) на панели справа. Можно там же использовать и Smooth, но будьте осторожны- это добавит новые полигоны ваша модель может не подойти для движка.'''<br />
<br />
В ходе адаптации модели нам понадобится максимально похожий образец из оригинальной игры. В моем случае я выбрал церковную робу (hf_rob_chaa) – этакий универсальный образец, который подходит для большинства случаев. В Toolset’е откроем архивы modelhierarchies.erf materialobjects.erf modelmeshdata.erf (найти их можно по даресу [имя_диска_с_игрой]: \Dragon Age\packages\core\data). Так-же откроем архив texturepack.erf находящийся по адресу [имя_диска_с_игрой]:\Dragon Age\packages\core\textures\high. В этих архивах находим файлы<br />
hf_rob_chaa_0.mmh, hf_rob_chaa_0.phy (modelhierarchies.erf)<br />
hf_rob_chaa_0.msh (modelmeshdata.erf)<br />
pf_rob_chaa.mao (materialobjects.erf)<br />
pf_rob_chaa_0d.dds, pf_rob_chaa_0n.dds, pf_rob_chaa_0s.dds, pf_rob_chaa_0t.dds (texturepack.erf)<br />
и распаковываем в отдельную папку. Всего на выходе должно получится 8 файлов.<br />
<br />
А теперь перейдем в 3ds max. Прежде, чем приступить непосредственно к конвентированию, настроим плагин для 3ds max. Мне гораздо удобнее запускать сразу скрипты, чем захламлять разными кнопками рабочее пространство редактора. Для запуска конфигуратора запустим скрипт (Max Script->Run Script) DAOToolsSetup находящийся по адресу C:\Program Files\Autodesk\3dsMax8\Scripts\DAOTools.<br />
<br />
Итак, приступим, к настройке. В строке Game Path указываем адрес к папке с игрой. В Export Path указываем, куда будут сохранятся экспортированные файлы. Т.к. наша модель будет заменять уже имеющуюся, то укажем там адрес [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\ Ползунок World Scale ставим на значение 100. Дело в том, что в своем «естественном» виде, модели ДА очень маленькие. Для комфортной работы с ними нужно увеличить их в 100 (сто) раз. Эта функция как раз создана для того, чтобы на время работы увеличивать модель в удобный размер, а экспортируя обратно возвращая к естественным размерам. Все остальное оставляем нетронутым и нажимаем ОК. Конфигуратор перед закрытием проинформирует нас о возможности в любой момент изменить настройки, не пугайтесь выскочившего окна.<br />
<br />
И вот наконец теперь можно заняться непосредственно конвертированием. В окне редактора у нас должна уже быть открыта сама модель. Следующее, что нам нужно сделать, это загрузить оригинальную модель из ДАО. Для этого запускаем скрипт DAOImport. В пункте File секции Model Import указываем месторасположение недавно вытащенного нами .mmh файла (hf_rob_chaa_0.mmh). Нажимаем на кнопку Import, специальное окно известит нас о готовности к импорту, жмем ОК и ждем 5-30 секунд (в зависимости от мощности компьютера) пока загрузится модель.<br />
<br />
Для начала скроем все, что нам в данный момент не понадобится. Откроем Schematic View (Graph Editors-> New Schematic View) <br />
<br />
Здесь можно увидеть две большие древовидные структуры – это обе наши модели с их иерархией. Полностью выделим структуру оригинальной модели (легко определить по наличию в ней зеленых элементов). Сворачиваем Schematic View. В основном рабочем окне можно увидеть, что выделена оригинальная игровая модель и все ее элементы <br />
<br />
Теперь снимем выделение с самой робы, так чтобы выделенными остались лишь второстепенные элементы. Скроем их, чтобы не мешались, они нам все-равно не понадобятся. Для этого нажмем по пустому пространству рабочей области правой кнопкой мыши->hide selection. Теперь осталось только зафиксировать оригинальную модель. Для этого выделяем ее и правой кнопкой мыши->properties.<br />
Поставьте напротив опции Freeze секции interactivity, уберите напротив опции Show Frozen in Gray секции display Properties соответственно. Все, теперь оригинальная модель зафиксирована и защищена от случайных манипуляций.<br />
<br />
Теперь нужно подогнать модель платья Кристины под габариты игровой робы. Желательно сделать это как можно точнее. Для трансформации модели лучше всего воздействовать на ее кости, так гораздо удобнее. Масштабируем, поворачиваем и двигаем кости так, чтобы модель ровно легла в очертания оригинальной робы. Разводим руки, сводим ноги – процесс нужно делать на «глазок».<br />
<br />
== Working with materials ==<br />
*NOTE: Работать с материалами нужно до риггинга. Иначе будут проблемы.<br />
<br />
== More than one texture ==<br />
Важное отступление - если ваша модель полностью покрывается одной текстурой, то ничего из нижеописанного вам проделывать не нужно.<br />
Сейчас нам нужно объединить несколько материалов в один. Процесс не тривиальный. Итак, когда вы откроете редактор координат, то увидите вот такую картину:<br />
<br />
[[File:Editingmaterials.png|border]]<br />
<br />
Зеленые линии - это координаты модели на текстуре. Многие игровые движки используют все пространство редактора, но не ДАО. Наша игра не видит ничего за границами выделенного квадрата. Наша задача - передвинуть все координаты во внутрь этого квадрата. Во вкладке All ID's можно выбирать отдельные материалы и двигать их. Наложите текстуру, которую вы создали в фотошопе и согласно ее контурам отмасштабируте и перенесите ее на соответствующее место. Тоже самое нужно бьудет проделать и со всеми сетами материалов, чтобы в конце-концов получилось что-то вроде этого:<br />
<br />
[[File:Mated2.png|border]]<br />
<br />
После этого можно закрывать редактор координат.<br />
<br />
<br />
== Continue working with materials ==<br />
<br />
На верхней панели инструментов найдем кнопку редактора метериалов (четыре разноцветных шара) <br />
Далее нажимаем Get Material и выбираем из списка Dragon Age Material (если плагин установлен правильно, то он в списке будет) <br />
<br />
[[File:Materialeditor.png|border]]<br />
<br />
В Material Type указываем Character, в Render Semantics – [Armor w / Skin Tint][Alpha Blending][No Emissive]. Разворачиваем список Texture Maps и назначаем соответствующие текстуры. Далее Assign Material to Selection (платье должно быть выделенным). Если так хочется увидеть текстуру в редакторе, то жмем Show Map in Viewport. Осталось только дать нашему материалу нормальное имя. В соответствующем поле введем pf_rob_chaz_0. Вот и все.<br />
<br />
[[File:Materialwork.png|border]]<br />
<br />
== Rigging ==<br />
<br />
* [https://youtu.be/1QMcAX1cDyo Rigging tutorial]<br />
<br />
<br />
Как только наша модель полностью ляжет в очертания оригинальной робы, можно приступать к следующей фазе <br />
Выделим нашу модель, правой кнопкой мыши по пустому месту->Convert To-> Convert To Editable Mesh.<br />
Теперь полностью выделяем все объекты, снимаем выделение с самой модели платья Кристины (выделеными должны остаться все объекты КРОМЕ платья Кристины) и удаляем. Должны остаться только церковная роба и платье Кристины. Далее правой кнопкой мыши по пустому месту->Unfreeze All. Это разморозит оригинальную робу, сделав ее доступной для редактирования. Затем в списке ее модификаторов выделим Skin и Edit Normals (с зажатым CTRL). Правой кнопкой мыши по ним->Cut. Из списка модификаторов они должны исчезнуть. Далее правой кнопкой мыши по пустому месту рабочего пространства->Convert To->Convert To Editable Mesh. Это низведет оригинальную робу в тоже состояние, в котором сейчас пребывает и платье Кристины.<br />
<br />
Теперь перейдем в режим редактирования полигонов <br />
<br />
[[File:Polygon.png|border]]<br />
<br />
Нажмите CTL+ A Вся оригинальная роба должна окраситься в красный цвет выделения. Далее нужно снять выделение с одного-единственного полигона (делается с зажатой клавишей ALT). Какого именно – неважно, главное чтобы он был на виду и до него было просто добраться. Я выбрал один у самых ног. Все, что теперь нужно сделать – нажать кнопку Delete. Это удалит всю модель, кроме одного оставленного нами полигона. Теперь нам нужно прирастить к этому полигону платье Кристины. Для этого выберем на панели инструментов справа кнопку Attach и нажмем мышью на скафандр. Появится окно, выбрать опцию Match Material to Material IDs. Жмем ОК. Теперь нужно убрать последний полигон оригинальной робы. Вновь переходим в режим редактирования полигонов (предварительно «отжав» кнопку attach), находим когда-то оставленный нами полигон и удаляем его. Все, теперь уже не осталось ничего, что напоминало-бы нам о церковной робе.<br />
<br />
Вы должны закончить со всеми правками модели до того, как добавите модификатор Unwrap UVW. Если ваша модель выглядит грубой, то необходимо исправить:<br />
ПКМ -> converto to Editable Poly-> Vertex-> Select all (CTRL+ A)-> Weld -> Convert to editable Mesh<br />
<br />
'''Note:'''Закончите все правки модели и материалов до следующего шага - после него все изменения не отобразятся на конечном результате и придется переделывать. <br />
<br />
В списке модификаторов нашей модели найдем Unwrap UVW и добавим его к нашей модели. Модель должна окраситься ярко зелеными линиями.<br />
<br />
Далее правой кнопкой мыши по списку модификаторов->Paste. Список модификаторов должен стать таким (сверху-вниз: Skin, Edit Normals, Unwrap UVW)<br />
<br />
С самой моделью мы наконец закончили.<br />
<br />
== Dress with crinoline ==<br />
[[File:Crinoline_dressDAO.jpg|border]]<br />
*[https://youtu.be/_q4mmFMmIK8 Как сделать платье с кринолином]<br />
<br />
== Export ==<br />
<br />
Для этого запускаем скрипт DAOModelExport. Нам предстанет вот так вот такое окно:<br />
<br />
[[File:Export.png|border]]<br />
<br />
<br />
Между Name и .MMH вписать hf_rob_chaa_0. Между Name и .MSH вписать тоже самое (если этого не сделалось автоматически). Отметить опцию Create MAO Material File. Все, теперь жмем Export. По окончании процесса экспорта в папке [имя_локального_диска]:\Documents and Settings\[имя_пользователя]\My Documents\BioWare\Dragon Age\packages\core\override\ должны появится пять новых файлов<br />
hf_rob_chaa_0.phy<br />
hf_rob_chaa_0.msh<br />
hf_rob_chaa_0.mmh<br />
hf_rob_chaa_0.met<br />
pf_rob_chaz_0.mao<br />
Там-же уже должны находится обе текстуры. Ну, вот собственно и все. Модель готова, можно запускать игру и смотреть результат.<br />
<br />
<br />
== Addding custom shield ==<br />
<br />
Процесс тот же самый с разницей, что щиту не нужен rigging.<br />
<br />
1) Импортируйте любой щит из игры. В отличие от брони тут не нужно следить за размером - ЛЮБОЙ щит подойдет.<br />
<br />
2) Импортируйте ваш щит в ту же сцену и погдгоните его размер к тому, что из игры.<br />
<br />
3) Сделайте из ващего нового щита ПКМ -> "make editable mesh". Collapse any active modifiers on the "new" item. Then add a new "unwrap UVW" modiefier to it, and double click it to open the UVW window. then drag and select everything you see there, and DRAG IT ANYWHERE OUTSIDE THE OUTLINED BOX IN THE CENTER. This will make life easier for you in step 6.<br />
<br />
4) Выберите щит из игры и выберете все модификаторы исключая "unwrap UVW". ПКМ ->"cut", а не удалить, потому что м ыбудем их использовать. Далее ПКМ -> "make editable mesh". <br />
<br />
5) Теперь "attach" щит из ДАО к вашему новому щиту. <br />
<br />
6) Добавть новый "unwrap uvw" к этому mesh. Проверьте все ли модификаторы на месте - press the "+" слева. Выберите "face", и выберете все, что внутри the outlined box в середине. ПКМ "unwrap UVW" и выберете "collapse to".<br />
<br />
7) Потом нажмите "+" слева от слов "editable mesh". Выберте "element" и удалите. Вставьте все модификаторы, которые мы вырезали на шаге 4.<br />
<br />
8) Добавьте текстуры и экспортируйте.<br />
<br />
== Useful links ==<br />
*[[Customisation of original Dragon age armor]]<br />
*[[Adding custom shield tutorial]]<br />
*[[Adding custom level tutorial]] - Add your own level.<br />
*[http://forums.nexusmods.com/index.php?/topic/423834-the-witcher-1-armors-in-da-origins/page-2#entry3544131 How to add new armor to DAO on English] <br />
*[http://forums.nexusmods.com/index.php?/topic/1122450-loincloth-fashion/page-56#entry16909714 How to fix GDA conflict]<br />
*[http://www.nexusmods.com/dragonage/mods/3974/? Item Variation ID spreadsheet modification]<br />
*[https://youtu.be/370D7Lul9tk Skinning tutorial]<br />
[[Category:Tutorials]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Adding_custom_armor_tutorial&diff=19831Adding custom armor tutorial2017-11-18T18:32:14Z<p>Sunjammer: moved Adding custom armor tutorial to Adding custom armor tutorial/ru: Relocating for languages bar</p>
<hr />
<div>#REDIRECT [[Adding custom armor tutorial/ru]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=GetCurrentEvent&diff=19829GetCurrentEvent2017-11-18T18:28:21Z<p>Sunjammer: Formatting</p>
<hr />
<div>{{dafunction<br />
|name=GetCurrentEvent<br />
|brief=Gets the current event for the event script.<br />
|returntype=event<br />
|returndesc=Returns the current event.<br />
|sourcefile=script.ldf<br />
|sourcemodule=<br />
}}<br />
<br />
== Description ==<br />
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. --><br />
Gets the current event for the event script that was just fired.<br />
This function should only be used in the event script.<br />
<br />
== Remarks ==<br />
<!-- This section contains additional comments, observations and known issues. --><br />
Using this function outside of the event script might result in odd behaviour as the event returned might be invalid.<br />
<!-- <br />
== Examples == <br />
<!-- This section contains examples transcluded from the snippet library.<br />
--><br />
== See also ==<br />
<!-- This section contains links to articles, functions or constant groups. --><br />
[[HandleEvent]]<br />
[[Category: Event functions]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Installation_troubleshooting&diff=19807Installation troubleshooting2017-07-02T16:17:12Z<p>Sunjammer: Reverted edits by Ladyofpayne (talk) to last revision by Sunjammer</p>
<hr />
<div>'''NOTE: version 1.00 had a problem with installing to directories with paths longer than 58 characters, which is the default for Steam installations. 1.01 overcomes this problem, and fixes several other important bugs, but if for some reason you wish to install 1.00 see [[Installation with Steam]] for details and a workaround.'''<br />
<br />
Refer to [[Known issues]] for the current list of issues that are being worked on, and their status.<br />
<br />
See [[Installing the toolset]] for general information and guidance about installing the Dragon Age toolset. If something goes wrong during that process this page may have useful information and advice.<br />
<br />
If you experience a crash, logs can be found in <code>My Documents\BioWare\Dragon Age\Toolset\logs</code>. The log filenames will include the date on which the log file was created. Sending in a log will help greatly with bug fixing.<br />
<br />
== General errors ==<br />
<br />
If the Dragon Age toolset downloads to near-completion, but you then get the error "[browser] cannot download, etc. Connection with the server was reset", this may be due to a downloading management issue. One solution is to first download an internet download manager (IDM) freeware program (e.g. www.internetdownloadmanager.com/). Then, once the IDM is installed and in control of your downloads, retry downloading the DA toolset through your default browser. <br />
<br />
If you get the "Dragon Age: Origins game install not found" error when you run the toolset installer:<br />
* You must have the game installed before you can install the toolset. Please install the game first.<br />
* If you have installed the game, but not yet run the configure program, you will get this message: "Please launch the Dragon Age: Origins Configure Utility". This happens automatically the first time you attempt to run the game. After you have successfully configured and launched the game at least once, you should no longer get this error.<br />
<br />
If the toolset cannot find DLLs you may need to run the configuration tool after installation to tell the toolset where to find the Dragon Age build. This can happen if you uninstall the toolset and then reinstall it again in a different location.<br />
<br />
If you install the toolset in a non-default location, the toolset may not be made aware of where the [[Resource Builder]] has been put. This can be easily fixed by changing the "Resource Build Path" variable found in Options->Environment.<br />
<br />
On Vista and Windows 7 systems you may get a message reading "Windows has blocked some of the features of this program." It will indicate that the offending program is "Microsoft Register Server", located at C:\windows\system32\regsvr32.exe. The installer makes use of this program to register the game engine's DLL for use by the toolset. You can choose to block or allow this, the installer will work either way. It is somewhat safer to leave it blocked.<br />
<br />
On Windows 7 64 bit you may experience this error durring the installation of the toolset.<br />
Error opening File or Writing:<br />
<br />
C:\Program Files\Common Files\BioWare\Uninstall Dragon Age Toolset.exe<br />
<br />
Click Abort to stop the installation,<br />
Retry to try again, or<br />
Ignore to skip the file.<br />
<br />
The work around for this is to either create the folder "BioWare" in the directory of C:\Program Files\Common Files\ prior to the installation or at the point where the error is experienced. This is due to the installation program not creating the folder "BioWare" in the C:\Program Files (x86)\Common Files. Once this "BioWare" folder is created the installation will complete by clicking on "retry".<br />
<br />
MSSQL Express 2005's installer has a limitation that prevents it from installing to a directory path that's longer than 58 characters.<sup>[http://support.microsoft.com/kb/935371]</sup> Version 1.01 of the toolset installer has addressed this issue by installing the database to a predefined location independant of the location of the game executable.<br />
<br />
== Empty Palette Window ==<br />
If after succesful launching of toolset, your window palette is empty, probably the problem is the default language not set to "English" in your DataBase properties:<br />
* to change it launch Microsoft SQLServer Management Studio Express 2005 (this is covered in [[Manual database installation]])<br />
* in the Database tree, choose "Security" (translate it in your language)<br />
* then choose something like, "accounts" or "logins", then you should see a list of users, including your windows user<br />
* right click on your username and choose "properties"<br />
* at bottom right of the window that pop up locate "Default Language" and change it in "English"<br />
* click "ok" button <br />
<br />
Now the empty palette window should show the resources. ''Thanks to Vreltek for this solution!''<br />
<br />
== "[[Unable to connect to the database]]" ==<br />
If you receive the "unable to connect to the database" error message there are many reasons why this happens, and various ways to correct it.<br />
<br />
A new troubleshooting page for this error has been created. Rather than random suggestions of things to try, it has a troubleshooting flowchart to help you diagnose and fix your problem. Please visit [[Unable to connect to the database]] for the latest help with this problem.<br />
<br />
== Installer hangs at the stage of "Execute:regsvr32.exe /s "C:\Dragon Age\tools\Engine.dll" ==<br />
<br />
In some instances Regsvr32.exe is failing for some unknown reason and refusing to terminate. Version 1.01 of the toolset installer has addressed this problem by no longer waiting for a return value from regsvr32, so the installer should no longer hang at this stage.<br />
<br />
See [[Bug: Installer hangs at the stage of Execute:regsvr32.exe /s "C:\Dragon Age\tools\Engine.dll"]] for details should you encounter something like this again, or need to register engine.dll manually.<br />
<br />
== Other database issues and solutions ==<br />
<br />
If you have never installed MSSQLServer Express, check for updates available for it through Windows Update after installing the toolset.<br />
<br />
If the SQL install fails with a crash it is possible that it is conflicting with MSXML6. If you have MSXML6 installed, uninstall it and try reinstalling the toolset. See [http://support.microsoft.com/kb/968749 Microsoft's support page on this issue]. If you have trouble uninstalling MSXML6, try the [http://support.microsoft.com/kb/290301 Microsoft Windows Installer Cleanup Utility].<br />
<br />
During the SQL Server Express installation when the installation script attempts to start the database, a message box with the "The SQL Server service failed to start..." error message and options to Retry or Cancel may pop up.<br />
* Do '''not''' click Cancel. Clicking Cancel rolls back the installation, preventing the creation of the BWDATOOLSET database. You will need to reinstall from scratch if this happens.<br />
* Instead, navigate to and right click on the Protect folder and open the Properties window. On the Security tab add NETWORK SERVICE to the list of Groups and User names and grant it Full Permissions. The path to the Protect folder will be:<br />
** Windows XP: <code>C:\Documents and Settings\NetworkService\Application Data\Microsoft\Protect </code><br />
** Windows 7: <code>C:\Users\<username>\AppData\Roaming\Microsoft\Protect</code><br />
* If you don't have a Security tab then close the Properties window and select Tools | Folder Options from Explorer's menu bar. In the Folder Options window click on the View tab, scroll to the last option and uncheck Use simple file sharing (Recommended) option. Now you should be able to do complete the previous step.<br />
* Finally return to the "The SQL Server service failed to start..." error message and click on the Retry option.<br />
<br />
The version of MSSQL Server 2005 included with the toolset may have trouble installing on 64-bit operating systems. This can be indicated by SQL Server Error 70047 in the installer's logs. To resolve this problem, install [http://go.microsoft.com/fwlink/?LinkId=55734 Microsoft .NET Framework Version 2.0] for 64-bit architectures before installing the toolset. <!-- ref: http://www.microsoft.com/downloadS/details.aspx?familyid=220549B5-0B07-4448-8848-DCC397514B41&displaylang=en --><br />
<br />
You may also encounter issues running migration scripts on 64 bit OSes. An alternate migration script can be found here: http://social.bioware.com/project/46/<br />
<br />
You may get issues with access permissions. This can be avoided by giving your username admin rights to the database. To do this:<br />
# Run "SQL Server Surface Area Configuration" (should be on your start menu under Microsoft SQL Server 2005)<br />
# Select the "Add new administrator" option.<br />
# Add yourself as administrator.<br />
<br />
If you get a syntax error during installation, it could be caused by the path being too long. Rather than moving your whole install, try this: http://support.microsoft.com/kb/935371<br />
<br />
See [[Manual database installation]] for instructions on how to manually set up the database for use with your toolset.<br />
<br />
== Windows XP SP 2 and endless reboot cycles after install ==<br />
<br />
*See [[Bug: Endless reboot cycles after install under Windows XP SP 2]]<br />
<br />
The MSSQL Server Express installer bundled with the toolset has a potential issue when installed on Windows XP Service Pack 2 that can cause an endless cycle of reboots. The toolset installer will warn you not to proceed if it detects SP2 on your system. Dragon Age: Origins has Service Pack 3 as part of its minimum installation requirements, so you should try upgrading to Service Pack 3 and reinstall.<br />
<br />
If you're stuck in an endless reboot cycle:<br />
<br />
*Press ctrl+alt+del and open the task manager as soon as possible. Failing that, try booting in safe mode by holding down F8 during the boot process.<br />
*Then go to the start menu and in execute type in "msconfig"<br />
*In MSConfig go to services and deactivate all the SQL services.<br />
*Now you can go to control panel...software and uninstall the SQL server from the last piece upward.<br />
<br />
Alternately, instead of booting into safe mode after holding down F8 during boot, you can choose the option "Last known good configuration (your most recent settings that worked)". This may restore your system to a functional state and allow SQL Server to function correctly.<br />
<br />
Once you've uninstalled SQL Server this should prevent further reboot cycles. You can now install Windows XP Service Pack 3.<br />
<br />
== Externals links for troubleshooting ==<br />
<br />
[http://forum.canardpc.com/showthread.php?p=2675920 Canard PC forum] French only :Forum résumant la marche a faire en cas de problèmes. <br />
<br />
{{Languages}}<br />
[[Category:Toolset installation]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Background.xls&diff=19784Background.xls2016-12-06T18:35:06Z<p>Sunjammer: </p>
<hr />
<div>The [[background.xls]] file contains the [[2da]] files that define the standard backgrounds and determine which are available to each combination of race and class.<br />
<br />
The workbook contains the following worksheets:<br />
<br />
* [[Backgrounds_2da|Backgrounds]]<br />
* [[background_desc_2da|background_desc]]<br />
* [[background_names_2da|background_names]]<br />
* [[background_icons_2da|background_icons]]<br />
* _old<br />
* _old_equipment<br />
* [[background_defaults_2da|background_defaults]]<br />
* [[chargen_preload_2da|chargen_preload]]<br />
<br />
<br />
[[Category:Backgrounds]]<br />
[[Category:Character generation]]<br />
[[Category:XLS files]]<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Background.xls&diff=19783Background.xls2016-12-06T18:34:05Z<p>Sunjammer: </p>
<hr />
<div>The [[background.xls]] file contains the [[2da]] files that define the standard backgrounds and determine which are available to each race.<br />
<br />
The workbook contains the following worksheets:<br />
<br />
* [[Backgrounds_2da|Backgrounds]]<br />
* [[background_desc_2da|background_desc]]<br />
* [[background_names_2da|background_names]]<br />
* [[background_icons_2da|background_icons]]<br />
* _old<br />
* _old_equipment<br />
* [[background_defaults_2da|background_defaults]]<br />
* [[chargen_preload_2da|chargen_preload]]<br />
<br />
<br />
[[Category:Backgrounds]]<br />
[[Category:Character generation]]<br />
[[Category:XLS files]]<br />
{{Languages}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Backgrounds_tutorial&diff=19782Backgrounds tutorial2016-12-06T18:14:58Z<p>Sunjammer: </p>
<hr />
<div>== Introduction ==<br />
This tutorial shows you how to modify the character backgrounds that can be selected during character generation. This is likely only of use if you are creating your own module or campaign as there would be no point to changing the background in the single player campaign unless you were also going to make extensive additions to support the new backgrounds (e.g a completely new origin story). So the example we will use for this tutorial is a new stand alone module in which we completely replace the existing backgrounds. Changing backgrounds is especially useful if your module is set in a different lore to the main Dragon Age game or if you simply want to reduce the scope of the number of different backgrounds.<br />
<br />
We will also demonstrate some important principals that can be followed when modifying other core rules such as available races or classes. Most importantly we will add the new backgrounds in a way that doesn’t require any editing of core resources. By leaving the core resources alone we make our changes compatible with future patches which might otherwise overwrite our work. Furthermore keeping the core resources in tact allows us to make different modifications to different modules within the same toolset.<br />
<br />
It is recommended that the reader should have some experience with scripting or coding in order to carry out the operations involved. The more you are relying on just copy pasting these instructions the more likely you are to make mistakes that you won’t know how to fix.<br />
<br />
== The backgrounds demo module ==<br />
Any basic module will do for the purposes of this tutorial. If you want to create a test module for this tutorial then just create a simple module with a single area and a starting location. Make sure that the only thing selected in the module’s hierarchy is ''Core game resources''. This will ensure that the module is a stand alone module rather than an add-in to the single player campaign or some other module. For the purposes of this tutorial we will assume the module is called ''Backgrounds demo'' and I will prefix my resources with ''bdm_'' to be sure that they are distinct from any that are already in existence.<br />
<br />
We are going to completely replace the existing backgrounds with 3 new ones of our own. You can use new backgrounds in your module however you see fit. You could create entire origin stories for each one like in the single player campaign (possibly a major undertaking depending on length) or you can just use them to influence dialogue and plot options in the main part of your game.<br />
<br />
For our demo we are creating a module in which the player starts off in a small human village (we will not be creating the details of this module so this is just for the purpose of an example). There is a wizard in this village who plays a pivotal role in the story. We allow the player to start as the wizard’s apprentice (if they are a mage) or as his servant (if they are human or elven and not a mage) or as a wandering traveller who has come to visit the wizard (if they are not human and not a mage). So the three backgrounds will be:<br />
<br />
* Servant<br />
* Apprentice<br />
* Traveller<br />
<br />
== Creating the background strings ==<br />
Before we start modifying the 2DA files we are going to create some strings. Open the string editor in the toolset and create the following strings in your ‘Backgrounds demo’ talk table:<br />
<br />
[[Image:Back_tut_talk_table.png]]<br />
<br />
Your string IDs might be different to these so be sure to reference the right string ID in the instructions that follow. Simply replace these string Ids with your own.<br />
<br />
'''IMPORTANT!''' ''There is currently a bug in the game that causes it to crash if a background description ID has a value greater than 109 912 680. There is a [http://social.bioware.com/project/4695/ community fix] for this. Alternatively, you can go into your module’s properties and change the start ID for strings to be less than the critical value. After that the string editor will generate IDs in a range that won’t crash. Reset the start ID to its original value after you create the background descriptions (that way you have less to alter once Bioware fix this, and less risk of incompatibility with other mods).''<br />
<br />
You may have noticed that we have given two different names and descriptions for the traveller background depending on the PC’s race. We will say more about that in the following section.<br />
<br />
{{TutorialRef|String editor}}<br />
<br />
== Modifying the 2DAs ==<br />
The next thing we need to do is to modify the worksheets in backgrounds.xls. Be sure to make a copy of the spreadsheet first so that you leave the original intact. See LINK for general information about editing 2DA files. The first worksheet is called ‘backgrounds’; modify it to look like the following:<br />
<br />
[[Image:back_tut_backgrounds.png]]<br />
<br />
Note that since 2DAs combine together to form M2DAs, and we don’t want the existing backgrounds in our game, we have overwritten the last two slots as unused1 and unused2, even though we won’t be using them. The name and desc string refs on this tab will be overwritten by the race specific ones on the names tab so we can leave those blank (AFAIK these string refs are not used providing the ones on the names tab are provided - also the tooltip string ref seems not to be used anywhere – if you prefer you can set these to something just to be safe).<br />
<br />
The three race columns determine which backgrounds can be selected by which race and the 3 class columns determine which background can be selected by which class. So, as you can see from the picture our Servant background is accessible to elf or human warriors and rogues, the Apprentice background can be selected by elf or human mages and the Traveller background by elf or dwarf warriors and rogues.<br />
<br />
The last three tabs indicate a starting ability for each background by race. Note that by default these columns are not hooked up into the character generation script (instead they are hard coded in the script) and are not used, but we will correct that later on when we do the scripting. You have to be careful here because the columns relate to the race IDs, so 1=dwarf, 2=elf and 3=human, which is in a different order to the other race columns in this table. The number in the column is an ability ID as given in ABI_base.xls. For this demo we have just given the same skill for each race for a given background. Servants get combat tactics, Apprentices get persuade and Travellers get survival.<br />
<br />
The next tab table to modify is background_names.<br />
<br />
[[Image:back_tut_bg_names.png]]<br />
<br />
Make sure that the IDs here match the IDs in your string table. Note that for Apprentices and Servants we use the same strings regardless of race, but for the Traveller background we use different strings. This is to illustrate how you can divide a single background up into multiple names and descriptions. Internally they are both stored as the same background ID but during character generation a different name, description and icon can be shown to the player. In the single player game this was done with the Noble background by splitting it into human and dwarf Noble variations.<br />
<br />
NOTE – you must be careful when splitting a single background into different parts for each race. You must make both the names and descriptions different! If you don’t make the descriptions different then the engine will not recognise them as different even if they have different names.<br />
<br />
Now modify the background_desc table as follows<br />
<br />
[[Image:back_tut_bg_desc.png]]<br />
<br />
Again note the distinct descriptions for the Traveller background.<br />
<br />
Now for the background_icons table. For this demo we will just use some of the existing icons but you may want to create your own icons to add here.<br />
<br />
[[Image:back_tut_bg_icons.png]]<br />
<br />
The background_defaults table must have an entry for each race, background and class combination that is allowed. The ID column must be calculated as follows:<br />
<br />
(1000 * raceID) + (100 * classID) + backgroundID<br />
<br />
[[Image:back_tute_bg_defaults.png]]<br />
<br />
The label column should give a description of the row (AFAIK this is not used anywhere).<br />
For this simple demo we will have each background combination spawn in the same place (the module default start location) but if you wanted different origins to spawn in different places then you can use the next two columns to specify this (AFAIK you have to write your own scripts to accomplish this though).<br />
<br />
In the template column you can put the name of a creature resource that you want to use as a template for this race/background/class combination. In the picture you can see that we have just used some default templates that shipped with the toolset but you can easily create your own. Note that only the inventory is copied across to the PC so if you want to create your own templates you do not need to alter anything on the creature except for their inventory.<br />
<br />
The name columns take string Ids. If you want to add your own names then you’ll have to create new strings in the string editor.<br />
<br />
Finally we have the ability column. As with the skill columns in the backgrounds table these IDs correspond to entries in the ABI_base.xls file. It should be noted that race, class and background are all possible sources of starting abilities so before you decide what to put in this column you should familiarise yourself with what skills are already being added in different parts of character generation in order to ensure that you don’t duplicate an ability somewhere.<br />
<br />
The final table is the chargen_preload table. The two columns here should exactly match the entries from the ID and Template columns of the previous table.<br />
<br />
[[Image:back_tut_chargen_preload.png]]<br />
<br />
{{TutorialRef|2DA|2DA#Excel file formatting|Background.xls}}<br />
<br />
== Compiling and fixing the GDAs ==<br />
Now compile backgrounds.xls and place the resulting GDAs into your ''AddIns\module_name\module\override'' directory.<br />
Never place anything in your ''AddIns\module_name\core\override'' directory or it will affect other modules than the one you are editing.<br />
<br />
There used to be a [[Bug: ExcelProcessor doesn't handle row IDs above 8.3 million correctly|bug]] that prevented large string IDs from compiling correctly. This is now fixed. For the record, the old workaround was to edit the GDA files in the toolset to correct the string IDs manually, but you should now see that the string IDs are correct.<br />
<br />
{{TutorialRef|Compiling 2DAs|GDA}}<br />
<br />
== Creating the backgrounds plot ==<br />
The background plot is used for keeping track of a PC’s background and can be used to affect conversation options.<br />
<br />
The single player game uses a plot called gen00pt_backgrounds to keep track of the PC background. You can find it in the ''\_Global\Generic'' folder of the plots tab if you want to take a look. We will create a similar plot for our custom backgrounds. Create a new plot and call it ''bdm_000pt_backgrounds'' (My naming convention is to use 000 to indicate a resource that isn’t tied to any particular area – feel free to use your own convention but remember to update any references later in the tutorial). Add main plot flags as indicated in the picture below:<br />
<br />
[[Image:Back_tut_bg_plot.png]]<br />
<br />
You could also add some defined flags if you wanted. Defined flags can be used to return some combination of the main flags such as TRAVELLER or add some extra condition like FEMALE_APPRENTICE or ELVEN_APPRENTICE. Defined flags are beyond the scope of this tutorial however.<br />
<br />
{{TutorialRef|Designer Resources|Plot}}<br />
<br />
== Creating the scripts ==<br />
<br />
We are not going to edit any of the original core game scripts, we will only be adding new scripts of our own. As we discuss how to do this you should examine the core scripts that are referred to, but under no circumstances should you make any changes to those files. By leaving the core scripts as they are we make our modification more compatible with any future patches that may be released. If you modified the core scripts and then a patch was released that overwrote those scripts you would lose your changes. Also keeping your modification contained within your own module allows you to make different modifications to different modules within the one toolset.<br />
<br />
=== Module Script ===<br />
<br />
Lets start off with a script to handle the character generation events that are normally handled by the module_core script. Create a new script called ''bdm_module_core''. It is up to you what directory structure to use for your scripts but it can be a good idea to keep all your scripts in a directory with your module name to make them distinct from the core scripts. Then if you are emulating the functionality of a particular core script you can mirror the original directory structure underneath your main module folder. So in this case the module_core script is contained in the ''\_Core Scripts'' folder so we will put our bdm_module_core in ''\Backgrounds demo\_Core Scripts'' (the underscore ensures the core directories come first – looks like Bioware accidentally created one without it! I’m pretty sure Core and _Core are meant to be the same directory). Organising things this way will really help with keeping track of your scripts.<br />
<br />
The ''bdm_module_core'' script should contain the following code:<br />
<br />
<dascript><br />
#include "global_objects_h"<br />
<br />
void main()<br />
{<br />
event ev = GetCurrentEvent();<br />
int nEvent = GetEventType(ev); //extract event type from current event<br />
int nEventHandled = FALSE; //keep track of whether the event has been handled<br />
<br />
switch(nEvent)<br />
{<br />
case EVENT_TYPE_MODULE_START:<br />
{<br />
// -----------------------------------------------------------------<br />
// Initiate character generation.<br />
// -----------------------------------------------------------------<br />
PreloadCharGen(); //preloads resources for character generation<br />
StartCharGen(GetHero(),0,TRUE); //initiates character generation<br />
break;<br />
}<br />
default:<br />
{<br />
// -----------------------------------------------------------------<br />
// Handle character generation events sent by the engine.<br />
// -----------------------------------------------------------------<br />
if ((nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) <br />
|| nEvent == EVENT_TYPE_PLAYERLEVELUP )<br />
{<br />
HandleEvent(ev, R"bdm_sys_chargen.ncs");<br />
nEventHandled = TRUE;<br />
}<br />
break;<br />
}<br />
<br />
}<br />
if(!nEventHandled)<br />
{<br />
// if this event wasn't handled by this script, let the core script try<br />
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);<br />
}<br />
}<br />
</dascript><br />
<br />
Now go to ''File > Manage modules'' and open the properties for your module and set the script property to point at this script.<br />
<br />
Our new script handles some of the events that are usually handled by the module_core script. Once it has handled the event it chooses whether or not to pass the event on to module_core. The first event that we handle is [[EVENT_TYPE_MODULE_START]], which is where we initiate character generation. In this case we pass the event on to the core script to handle after we have done what we need to.<br />
<br />
NOTE: you may find that you don't need to change any other scripts. It's not clear what the scripts in the rest of this section are trying to do - see discussion.<br />
<br />
=== 2DA Constants ===<br />
<br />
Before we create the next event script we are going to need some new constants defined. Create a new script called ''bdm_2da_constants_h'' and put it in folder ''\Backgrounds demo\_Core Includes''. Now add the following to this script:<br />
<br />
<dascript><br />
// -----------------------------------------------------------------------------<br />
// Backgrounds - rules/backgrounds.xls<br />
// -----------------------------------------------------------------------------<br />
const int BACKGROUND_SERVANT = 1;<br />
const int BACKGROUND_APPRENTICE = 2;<br />
const int BACKGROUND_TRAVELLER = 3;<br />
</dascript><br />
<br />
These constants provide a way for us to refer to the background IDs that we defined in the 2DA files without having to remember the numbers. Constants like this also make your code more readable. If you need to add more new items to 2DAs when you are modding something else you can also add constants for them here. From now on we will be using these background constants instead of the original single player background constants that you can find in the ''2da_constants_h'' script. That means we’d better find all the places where those constants are used and update them with our own scripts.<br />
<br />
=== CharGen System ===<br />
<br />
The second thing we handle is actually a group of events. If you look in the module_core script you will see that right down the bottom in the default event handler is some code that looks just like the code we have added in our default event, with a couple of little differences. Instead of passing the character generation events to the ''sys_chargen.ncs'' script we are going to pass it to our own script called ''bdm_sys_chargen.ncs'' which we will write shortly. If we catch one of those character generation events then we want to handle it ourselves and prevent the core script from handling it so we set nEventHandled = TRUE. Note that any other event that is caught by the default handler but isn’t a character generation event is going to go straight on through to the core script.<br />
<br />
Create another new script and call it ''bdm_sys_chargen'' and put it in a folder called ''\Backgrounds demo\_Systems''. Put the following code in it:<br />
<br />
<dascript><br />
#include "log_h"<br />
<br />
#include "bdm_sys_chargen_h"<br />
<br />
const int CHARGEN_QUICKSTART_QUICK = 0;<br />
const int CHARGEN_QUICKSTART_NORMAL = 1;<br />
const int CHARGEN_QUICKSTART_ADVANCED = 2;<br />
<br />
void _RunChargen(int nRace, int nClass, object oChar, int nBackground)<br />
{<br />
Chargen_InitializeCharacter(oChar);<br />
Chargen_SelectGender(oChar,GENDER_MALE);<br />
Chargen_SelectRace(oChar,nRace);<br />
Chargen_SelectCoreClass(oChar,nClass);<br />
Chargen_SelectBackground(oChar, nBackground,FALSE);<br />
<br />
int nEquipIdx = Chargen_GetEquipIndex(nRace, nClass, nBackground);<br />
Chargen_InitInventory(oChar,0,nEquipIdx);<br />
Chargen_SpendAttributePoints(oChar,PROPERTY_ATTRIBUTE_STRENGTH, 3,FALSE);<br />
Chargen_SpendAttributePoints(oChar,PROPERTY_ATTRIBUTE_DEXTERITY, 2,FALSE);<br />
}<br />
<br />
void main(){<br />
event ev = GetCurrentEvent();<br />
int nEventType = GetEventType(ev);<br />
object oChar = GetEventObject(ev,0);<br />
<br />
int nMode;<br />
int nInt0 = GetEventInteger(ev,0);<br />
int nInt1 = GetEventInteger(ev,1);<br />
// -------------------------------------------------------------------------<br />
// Debug Data.<br />
// -------------------------------------------------------------------------<br />
Log_Trace(LOG_CHANNEL_EVENTS_CHARGEN,"bdm_sys_chargen","Chargen Event:" + Log_GetEventNameById (nEventType) <br />
+ " " + ToString(nInt0) + "," + ToString(nInt1), oChar);<br />
<br />
int nEventHandled = FALSE;<br />
<br />
switch(nEventType)<br />
{<br />
// ----------------------------------------------------------------------<br />
// This fires when the player selects the icon corresponding to any of<br />
// the available backgrounds<br />
//<br />
// nInt0 - Constant BACKGROUND_* integer<br />
// ----------------------------------------------------------------------<br />
case EVENT_TYPE_CHARGEN_SELECT_BACKGROUND: <br />
{<br />
int nBackground = nInt0;<br />
// -----------------------------------------------------------------<br />
// Set the background on the player and reinitialize plot flags<br />
// for the background<br />
// -----------------------------------------------------------------<br />
Chargen_InitializeCharacter(oChar,TRUE);<br />
Chargen_SelectGender(oChar,GetCreatureGender(oChar));<br />
Chargen_SelectRace(oChar,GetCreatureRacialType(oChar));<br />
Chargen_SelectCoreClass(oChar,GetCreatureCoreClass(oChar));<br />
<br />
bdm_Chargen_SelectBackground(oChar, nBackground, FALSE);<br />
bdm_Chargen_SetupPlotFlags(oChar);<br />
<br />
// -----------------------------------------------------------------<br />
// Generate the index into the equipment template 2da and<br />
// then load the starting equipment based on the data returned.<br />
// -----------------------------------------------------------------<br />
int nClass = GetCreatureCoreClass(oChar);<br />
int nRace = GetCreatureRacialType(oChar);<br />
int nEquipIdx = Chargen_GetEquipIndex(nRace, nClass, nBackground);<br />
Chargen_InitInventory(oChar,0,nEquipIdx);<br />
nEventHandled = TRUE;<br />
break;<br />
}<br />
case EVENT_TYPE_CHARGEN_END: <br />
{<br />
nMode = nInt0;<br />
<br />
int nQuickStart = nInt1;<br />
// 0 - quickstart<br />
// 1 - normal \<br />
// 2 - advanced / treat as the same<br />
Log_Trace(LOG_CHANNEL_CHARACTER,"bdm_sys_chargen","MODE: " + IntToString(nMode) <br />
+ ", Quick Start: " + IntToString(nQuickStart));<br />
<br />
if(nMode == CHARGEN_MODE_CREATE && nQuickStart == CHARGEN_QUICKSTART_QUICK)<br />
{<br />
Log_Trace(LOG_CHANNEL_CHARACTER,"bdm_sys_chargen","Setting default values for player character");<br />
<br />
int nRandClass = abs((GetLowResTimer() % 3) + 1);<br />
<br />
if(nRandClass == CLASS_ROGUE || nRandClass == CLASS_WARRIOR)<br />
{<br />
_RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_SERVANT);<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_SERVANT, TRUE);<br />
}<br />
else // mage<br />
{<br />
_RunChargen(RACE_HUMAN, nRandClass, oChar, BACKGROUND_APPRENTICE );<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_APPRENTICE, TRUE);<br />
}<br />
<br />
Chargen_SetNumTactics(oChar);<br />
SetCanLevelUp(oChar,Chargen_HasPointsToSpend(oChar));<br />
SendEventModuleChargenDone("", "");<br />
nEventHandled = TRUE;<br />
}<br />
break;<br />
}<br />
} //end switch<br />
<br />
if(!nEventHandled)<br />
{<br />
HandleEvent(ev, R"sys_chargen.ncs");<br />
}<br />
<br />
<br />
}<br />
</dascript><br />
<br />
There are two events in the original sys_chargen script that we need to replace because they deal with backgrounds. The first of these is [[EVENT_TYPE_CHARGEN_SELECT_BACKGROUND]] and the other is [[EVENT_TYPE_CHARGEN_END]]. For the second event we only need to change the case where the character is being created in quickstart mode, so we just handle that section of the code. The objective here is to change only as much as we need to and then pass any remaining events through to the original sys_chargen script. Take some time to compare the new script with Bioware's ''sys_chargen'' script .<br />
<br />
You will notice that we include a script called ''bdm_sys_chargen_h'' and that we use some functions with a ''bdm_'' prefix. Those functions are contained in that include file which we’ll write now. Essentially these are modifications of a couple of functions from the ''sys_chargen_h'' include file. Create a new script and call it ''bdm_sys_chargen_h''. Put it in folder ''\Backgrounds demo\_Systems\Includes'' and add the following code:<br />
<br />
<dascript><br />
#include "sys_chargen_h"<br />
#include "wrappers_h"<br />
<br />
#include "bdm_2da_constants_h"<br />
#include "plt_bdm_000pt_backgrounds"<br />
<br />
void bdm_Chargen_SelectBackground(object oChar, int nBackground, int bUnApply = FALSE)<br />
{<br />
Log_Chargen("bdm_Chargen_SelectBackground","-- " + (bUnApply?"Un":"") +"Selecting BG: " + ToString(nBackground),oChar);<br />
// -------------------------------------------------------------------------<br />
// 1. Set the background variable<br />
// - Create creature property (or check what we used so far<br />
// - We don't set backgrounds on non player generated chars.<br />
// -------------------------------------------------------------------------<br />
if(bUnApply)<br />
{<br />
SetCreatureProperty(oChar, PROPERTY_SIMPLE_BACKGROUND, 0.0, PROPERTY_VALUE_BASE);<br />
}<br />
else<br />
{<br />
SetCreatureProperty(oChar, PROPERTY_SIMPLE_BACKGROUND, IntToFloat(nBackground), PROPERTY_VALUE_BASE);<br />
}<br />
// -------------------------------------------------------------------------<br />
// 2. Give one skill<br />
// - retrieve the skill that is granted by the background from backgrounds.xls<br />
// - give it to the player.<br />
// -------------------------------------------------------------------------<br />
int nAbility = ChargenGetBackgroundSkill(GetCreatureRacialType(oChar), nBackground);<br />
if(nAbility)<br />
{<br />
_AddAbility (oChar, nAbility, bUnApply);<br />
}<br />
}<br />
<br />
void bdm_Chargen_SetupPlotFlags(object oChar)<br />
{<br />
int nRace = GetCreatureRacialType(oChar);<br />
int nBackground = GetPlayerBackground(oChar);<br />
<br />
Log_Trace(LOG_CHANNEL_CHARACTER,"bdm_sys_chargen_h","Setting plot flags, race: " <br />
+ IntToString(nRace) + ", background: " + IntToString(nBackground));<br />
<br />
// First, init all flags (debug setup)<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_SERVANT,FALSE);<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_APPRENTICE,FALSE);<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_DWARF_TRAVELLER,FALSE);<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_ELF_TRAVELLER,FALSE);<br />
<br />
switch (nBackground)<br />
{<br />
case BACKGROUND_SERVANT:<br />
{<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_SERVANT,TRUE); break;<br />
break;<br />
}<br />
case BACKGROUND_APPRENTICE:<br />
{<br />
WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_APPRENTICE,TRUE); break;<br />
break;<br />
}<br />
case BACKGROUND_TRAVELLER:<br />
{<br />
switch(nRace)<br />
{<br />
case RACE_DWARF: WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_DWARF_TRAVELLER,TRUE); break;<br />
case RACE_ELF: WR_SetPlotFlag(PLT_BDM_000PT_BACKGROUNDS, BDM_GEN_BACK_ELF_TRAVELLER,TRUE); break;<br />
}<br />
break;<br />
}<br />
}<br />
}<br />
</dascript><br />
<br />
Lets examine these two functions. <br />
<br />
Comparing the first function, ''bdm_Chargen_SelectBackground'', to its original version we have actually made a more generic version that should work with any backgrounds. We have removed the hard coded values for the background abilities and now use the [[ChargenGetBackgroundSkill]] function which actually gets the background skill from the backgrounds 2DA file that we edited earlier (recall the last three columns that give a skill depending on background and race). If you need fancier logic than just reading the values form the GDA (e.g. like Bioware’s logic for the Noble background) then you can always go back to hard coding them the way Bioware did.<br />
<br />
The second function is ''bdm_Chargen_SetupPlotFlags'' which does just what it says. Remember the plot we created earlier? Here we set the appropriate flag based on race and background.<br />
<br />
=== Starting Locations ===<br />
<br />
In order for characters with different backgrounds to appear in different locations, you must do a little additional scripting.<br />
<br />
First create a new script titled ''bdm_campaign_h'' and put the following code in it:<br />
<br />
<dascript><br />
#include "wrappers_h"<br />
#include "utility_h"<br />
#include "log_h"<br />
<br />
#include "bdm_sys_chargen_h"<br />
<br />
void bdm_Campaign_ChargenDone(string sParam1, string sParam2);<br />
void bdm_Campaign_ChargenDone(string sParam1, string sParam2)<br />
{<br />
string sArea;<br />
string sWP;<br />
<br />
object oHero = GetHero();<br />
<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, "Campaign_ChargenDone", "START, param1: " + sParam1 + ", param2: " + sParam2);<br />
<br />
if(sParam1 != "" && sParam2 != "")<br />
{<br />
sArea = sParam1;<br />
sWP = sParam2;<br />
}<br />
else<br />
{<br />
int nRace = GetCreatureRacialType(oHero);<br />
int nClass = GetCreatureCoreClass(oHero);<br />
<br />
int nBackground = FloatToInt(GetCreatureProperty(oHero, PROPERTY_SIMPLE_BACKGROUND));<br />
int nEquipIndex = Chargen_GetEquipIndex(nRace, nClass, nBackground);<br />
<br />
sArea = GetM2DAString(TABLE_STARTING_EQUIPMENT, "StartArea", nEquipIndex);<br />
sWP = GetM2DAString(TABLE_STARTING_EQUIPMENT, "StartWP", nEquipIndex);<br />
}<br />
<br />
UT_DoAreaTransition(sArea, sWP);<br />
}<br />
</dascript><br />
<br />
Now add the following [[Case keyword|case]] statement into the ''bdm_module_core'' script you created earlier. The code must go above the [[Default keyword|default]] case statement:<br />
<br />
<dascript><br />
case EVENT_TYPE_MODULE_CHARGEN_DONE:<br />
{<br />
Log_Trace(LOG_CHANNEL_SYSTEMS, "EVENT_TYPE_MODULE_CHARGEN_DONE", "START");<br />
string sParam1 = GetEventString(ev, 0);<br />
string sParam2 = GetEventString(ev, 1);<br />
<br />
bdm_Campaign_ChargenDone(sParam1, sParam2);<br />
<br />
break;<br />
}<br />
</dascript><br />
<br />
The module script will get the area and waypoint assigned to your character from the GDA, then send it to the ''bdm_Campaign_ChargenDone'' function, which in turn will transport your character in the right location.<br />
<br />
{{TutorialRef|Script}}<br />
<br />
== Testing that everything works ==<br />
Now compile your scripts and export your module. Also, make sure that you export your talk table.<br />
<br />
'''IMPORTANT!''' ''Always make sure you empty your \Dragon Age\packages\core\override folder after doing an export. Due to a bug in the current toolset your single player game will become damaged if you don’t do this before playing.''<br />
<br />
You should now be able to run your game and see the backgrounds you created appear in character generation. If you want to test that the background plots have been set correctly, add an NPC to the start area and create a conversation for them in which each line is switched according to a background plot flag. You can also check that the character is receiving the abilities that we set in the 2DAs.<br />
<br />
'''NOTE''' ''There seems to be no way to change the popup message that comes up at the beginning of character generation. Altering the Pre-chargen string ID in the loadhints GDA does not seem to do anything.''<br />
<br />
{{TutorialRef|Exporting a module}}<br />
<br />
== Optional extras ==<br />
There are a couple of other Bioware scripts that reference the background constants. They are not essential to modify because they are not used anywhere by default. The genev_tutorial script uses a background check but unless you plan on firing the tutorial from your module then you won’t have need of it. Also there is at least one debug script that makes use of the original single player backgrounds (to grant a background plot flag to the PC) so if you want similar debug functionality you may have to roll your own function.<br />
<br />
== Race & Gender descriptions ==<br />
If your module is not set in Ferelden, you may wish to change the descriptions of the Race and Gender buttons that appear during Character Creation.<br />
<br />
The Race descriptions are in the Description column of the RACE_base 2DA, so you can replace them with new strings. As before, until the bug is fixed, use a string id in the 100000000 range. <br />
<br />
Unfortunately, the gender description is hard-coded in the game as string id 377283. Fortunately, you can make a [[String_editor#Editing_a_string_with_a_specific_id | local version]] of this string, which only applies to your campaign. <br />
<br />
Alternatively, if you an advanced user who is familar with the [[UI_Tutorial_%28draft%29 | UI Tutorial]], it's set in the GUI's Localization.as file as LOC_GENDER_DESCRIPTION = 377283, which is then used in the RaceGenderScene.as file. after editing the Localization.as file, you compile it and inject it into the appropriate .gfx'es.<br />
<br />
== Conclusion ==<br />
In this tutorial we have demonstrated a way to modify the backgrounds used in the game without altering any of the core scripts. It is expected that a similar approach could be taken to modding other aspects of the game such as adding classes or races. In these cases the scripts that were created in this tutorial could be extended to handle other parts of the character generation process such as class and race selection.<br />
<br />
[[Category:Backgrounds]]<br />
[[Category:Character generation]]<br />
[[Category:Tutorials]]<br />
{{Languages|Backgrounds tutorial}}</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Category:Backgrounds&diff=19781Category:Backgrounds2016-12-06T18:12:58Z<p>Sunjammer: Created</p>
<hr />
<div>Articles relating to the player's background.</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Category:2da_files_from_background.xls&diff=19780Category:2da files from background.xls2016-12-06T18:11:06Z<p>Sunjammer: Created</p>
<hr />
<div>The [[:Category:2da files from background.xls|2da files from background.xls]] category lists the 2da files found in the [[background.xls]] workbook.<br />
<br />
[[Category:2da files by source|{{uc:background.xls}}]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Chargen_preload_2da&diff=19779Chargen preload 2da2016-12-06T18:10:32Z<p>Sunjammer: </p>
<hr />
<div>The [[background_names 2da]] defines the default creature template for each race and class combination. <br />
<br />
The background_names 2da file is not listed in the [[M2DA_base 2da]] and has not been assigned a [[TABLE_*]] constant.<br />
<br />
== Structure ==<br />
<br />
{{2da start | Chargen_preload }}<br />
{{2da column | Template | string | Creature resource (i.e. including extension)}}<br />
{{2da end}}<br />
<br />
== Remarks ==<br />
<br />
The ID for each row is calculated using this formula (defined in the [[Chargen_GetEquipIndex]] function):<br />
<dascript>nRace * 1000 + nClass * 100 + nBackground</dascript><br />
Where <code>nRace</code>, <code>nClass</code> and <code>nBackground</code> are the value of the corresponding ID from the [[RACE_base 2da|race]], [[CLA_ 2da|class]] and [[Backgrounds 2da|background]] 2da files.<br />
<br />
[[Category:2da files]]<br />
[[Category:2da files from background.xls]]<br />
[[Category:Backgrounds]]</div>Sunjammerhttp://www.datoolset.net/mw/index.php?title=Backgrounds_2da&diff=19778Backgrounds 2da2016-12-06T18:10:24Z<p>Sunjammer: </p>
<hr />
<div>The [[Backgrounds 2da]] defines the standard backgrounds and their availability to particular combinations of race and class.<br />
<br />
The [[2da]] is not listed in the [[M2DA_base 2da]] but can be referenced in scripting using the [[TABLE_*|TABLE_RULES_BACKGROUNDS]] constant defined in [[2da_constants_h]].<br />
<br />
== Structure ==<br />
<br />
{{2da start | Backgrounds}}<br />
{{2da column | Label | string | Human-friendly description}}<br />
{{2da column | NameStrref | int | StringRef ID}}<br />
{{2da column | DescStrref | int | StringRef ID, but see [[background_desc_2da|background_desc]].}}<br />
{{2da column | TooltipStrref | int | StringRef ID}}<br />
{{2da column | Elf | int | <br />
* 0 - not available<br />
* 1 - available}}<br />
{{2da column | Human | int | <br />
* 0 - not available <br />
* 1 - available}}<br />
{{2da column | Dwarf | int | <br />
* 0 - not available <br />
* 1 - available}}<br />
{{2da column | Warrior | int | <br />
* 0 - not available <br />
* 1 - available}}<br />
{{2da column | Rogue | int | <br />
* 0 - not available <br />
* 1 - available}}<br />
{{2da column | Mage | int | <br />
* 0 - not available <br />
* 1 - available}}<br />
{{2da column | Skill_1 | int | Dwarf skill (race 1)}}<br />
{{2da column | Skill_2 | int | Elf skill (race 2)}}<br />
{{2da column | Skill_3 | int | Human Skill (race 3)}}<br />
{{2da end}}<br />
<br />
== Remarks ==<br />
<br />
The '''DescStrref''' column does not appear to be used (all values are 0) and to have been superseded by [[background_desc_2da|background_desc]].<br />
<br />
The '''Skill_#''' columns do not appear to be used (all values are **** (i.e. empty)).<br />
<br />
[[Category:2da files]]<br />
[[Category:2da files from background.xls]]<br />
[[Category:Backgrounds]]</div>Sunjammer