Difference between pages "Item" and "Template:Dafunction"

From Dragon Age Toolset Wiki
(Difference between pages)
Jump to: navigation, search
(Item Script)
 
(add headers to copy-and-pasteable template)
 
Line 1: Line 1:
{| style="float:right;"
+
{{{brief}}}
|-
+
| {{Resource palette}}
+
|-
+
| {{Infobox items}}
+
|}
+
  
An item is a game object that can be picked up or equipped by a creature. Armor, as well as mmushrooms.
+
<div class="dascript" style="font-family:monospace; background-color:#F9F9F9; border: 1px dashed #2F6FAB; line-height: 1.1em; padding: 1em;">
 +
[[{{{returntype}}}]]{{#if:{{{returnarra|}}}|[]}} {{{name}}}(
 +
:{{#if:{{{param1name|}}}|[[{{{param1type}}}]]{{#if:{{{param1arra|}}}|[]}} {{{param1name}}}{{#if:{{{param1default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param1default}}}|}}|}}{{#if:{{{param2name|}}}|,
 +
:[[{{{param2type}}}]]{{#if:{{{param2arra|}}}|[]}} {{{param2name}}}{{#if:{{{param2default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param2default}}}|}}|}}{{#if:{{{param3name|}}}|,
 +
:[[{{{param3type}}}]]{{#if:{{{param3arra|}}}|[]}} {{{param3name}}}{{#if:{{{param3default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param3default}}}|}}|}}{{#if:{{{param4name|}}}|,
 +
:[[{{{param4type}}}]]{{#if:{{{param4arra|}}}|[]}} {{{param4name}}}{{#if:{{{param4default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param4default}}}|}}|}}{{#if:{{{param5name|}}}|,
 +
:[[{{{param5type}}}]]{{#if:{{{param5arra|}}}|[]}} {{{param5name}}}{{#if:{{{param5default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param5default}}}|}}|}}{{#if:{{{param6name|}}}|,
 +
:[[{{{param6type}}}]]{{#if:{{{param6arra|}}}|[]}} {{{param6name}}}{{#if:{{{param6default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param6default}}}|}}|}}{{#if:{{{param7name|}}}|,
 +
:[[{{{param7type}}}]]{{#if:{{{param7arra|}}}|[]}} {{{param7name}}}{{#if:{{{param7default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param7default}}}|}}|}}{{#if:{{{param8name|}}}|,
 +
:[[{{{param8type}}}]]{{#if:{{{param8arra|}}}|[]}} {{{param8name}}}{{#if:{{{param8default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param8default}}}|}}|}}{{#if:{{{param9name|}}}|,
 +
:[[{{{param9type}}}]]{{#if:{{{param9arra|}}}|[]}} {{{param9name}}}{{#if:{{{param9default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param9default}}}|}}|}}{{#if:{{{param10name|}}}|,
 +
:[[{{{param10type}}}]]{{#if:{{{param10arra|}}}|[]}} {{{param10name}}}{{#if:{{{param10default|}}}|&nbsp;<span style="color: #FF0000;">=</span> {{{param10default}}}|}}|}}
 +
);
 +
</div>
  
== Overview ==
+
<dl>
 +
<dt>Parameters:
 +
<dd>{{#if:{{{param1name|}}}|
 +
<dl>
 +
{{#if:{{{param1name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param1name}}}<dd>{{{param1desc|}}}|}}<!--
 +
-->{{#if:{{{param2name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param2name}}}<dd>{{{param2desc|}}}|}}<!--
 +
-->{{#if:{{{param3name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param3name}}}<dd>{{{param3desc|}}}|}}<!--
 +
-->{{#if:{{{param4name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param4name}}}<dd>{{{param4desc|}}}|}}<!--
 +
-->{{#if:{{{param5name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param5name}}}<dd>{{{param5desc|}}}|}}<!--
 +
-->{{#if:{{{param6name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param6name}}}<dd>{{{param6desc|}}}|}}<!--
 +
-->{{#if:{{{param7name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param7name}}}<dd>{{{param7desc|}}}|}}<!--
 +
-->{{#if:{{{param8name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param8name}}}<dd>{{{param8desc|}}}|}}<!--
 +
-->{{#if:{{{param9name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param9name}}}<dd>{{{param9desc|}}}|}}<!--
 +
-->{{#if:{{{param10name|}}}|<dt style="font-weight:normal; font-style:italic;">{{{param10name}}}<dd>{{{param10desc|}}}|}}
 +
</dl>|None}}
 +
<dt>Returns:
 +
<dd>{{#ifeq:{{{returntype}}}|void|Nothing.|{{{returndesc}}}}}
 +
<dt>Source:
 +
<dd>[[{{{sourcefile}}}]] {{#if:{{{sourcemodule|}}}|from the module [[{{{sourcemodule}}}]]|}}
 +
</dl><includeonly>[[Category:Functions from {{{sourcefile|unspecified source file}}}]]</includeonly>
 +
<noinclude>
  
Items for the Single player campaign are all stored in the Toolset's [[Resource palette]], under the Item Category. They are as such files describing what an Item is and what it looks like, but they do not tell who or where it is in the Game. It is sort of indepentant resource in that way. Any other Resource however can make use of it as they want.
+
----
  
Items, as with any other Resource follow a [[Naming conventions#Resource Naming Convention|Naming convention]], to make it easier to navigate the [[Resource palette]].
+
Usage:
  
Unlike in Neverwinter Nights, items can't be placed on the floor. They can only be stored in an inventory of some kind.
+
<pre>
 +
{{dafunction
 +
|name = _AI_Condition_GetCreatureWithAIStatus
 +
|brief = Returns a creature with a specifc AI Status
 +
|param1type = int
 +
|param1name = nAIStatus
 +
|param1desc = the status being checked for if active on a creature
 +
|param1default =
 +
|param2type = int
 +
|param2name = nTargetType
 +
|param2desc = the target type of creature we are looking for that might have the specified status
 +
|param2default =
 +
.
 +
.
 +
.
 +
|returntype = object
 +
|returndesc = A creature of a specific type (self, ally, hostile) that has the status applied, OBJECT_INVALID otherwise
 +
|sourcefile = ai_conditions_h
 +
|sourcemodule = Core Resources
 +
}}
  
Items are stored in *.UTI File format.
+
<!-- == Description == -->
 +
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
  
=== Basic Resource Integration ===
+
<!-- == Remarks == -->
{| border="3" cellpadding="5" cellspacing="0" align"left"
+
<!-- This section contains additional comments, observations and known issues. -->
|- style="background-color:white;" align="center"
+
| style="border-right:3px solid black; background-color:#EFDF9A" width="60pt" |Other
+
| style="border-right:3px solid black; background-color:#CFCFA0" width="100pt"|Apply Rules
+
| style="border-right:3px solid black; background-color:#E0B080" width="90pt"|[[MSH|MSH Modelmesh]]
+
| style="border-right:3px solid black; background-color:#E0B080" width="90pt"|[[MAO|MAO Material]]
+
| style="border-right:3px solid black; background-color:#E0C0C0" width="90pt"|Heraldry Texture
+
| style="border-right:3px solid black; background-color:#C0C0E0" width="60pt"|Basestats
+
| style="background-color:#C0C0E0" width="60pt" |[[TNT|TNT (Tint)]]
+
|- align="center"
+
| style="border-right:3px solid black; background-color:#EFDF9A" rowspan="4" |Other
+
| style="border-right:3px solid black; background-color:#CFCFA0" rowspan="4" |[[BITM_base.xls]] [[2DA|(2DA)]]
+
| style="border-right:3px solid black; background-color:#E0B080" colspan="2" |[[Model|MMH (Model)]]
+
| style="border-right:3px solid black; background-color:#E0C0C0" rowspan="2" |[[Heraldry.xls]] [[2DA|(2DA)]]
+
| style="background-color:#C0C0E0" rowspan="2" colspan="2" |[[Materialtypes.xls|Materialrules]] [[2DA|(2DA)]]
+
|- align="center"
+
| style="border-right:3px solid black; background-color:#E0B080" colspan="2" |[[ItemVariations.xls]] [[2DA|(2DA)]]
+
|- align="center"
+
| style="border-right:3px solid black; background-color:#E0B080" colspan="2" |[[2DA base.xls|(M)2DA_base.XLS]] [[2DA|(2DA)]]
+
| style="border-right:3px solid black; background-color:#E0C0C0" rowspan="2" |[[BITM_base.xls]] [[2DA|(2DA)]]
+
| style="background-color:#C0C0E0" colspan="2" rowspan="2" |[[Materialtypes.xls]] [[2DA|(2DA)]]
+
|- align="center"
+
| style="border-right:3px solid black; background-color:#E0B080" colspan="2" |[[BITM_base.xls]] [[2DA|(2DA)]]
+
|- align="center" style="background-color:#FFFFE0"
+
| style="border-right:0px" |Other
+
| style="border-right:0px" |BaseItemType
+
| style="border-right:0px" colspan="2" |Itemvariation
+
| style="border-right:0px" |Heraldry
+
| colspan="2" |MaterialType
+
|- align="center"
+
| colspan="7" style="border-top:0px; border-bottom:2px solid black; background-color:#FFFFE0" |'''&uarr;&darr;Item&uarr;&darr;'''
+
|- align="center"
+
| colspan="7" |Game / Toolset
+
|}
+
  
This is a basic scheme, of the dependencies an Item creates, the Resources needed and how they are distributed. Each entry is directly connected to the next, from a modders point of view, who want to know which page is of interest. From the Item Resource, it spreads out into many smaller Resources the Item may depend on. Not all Items require a Model. It must not be exact at all Angles, and many other Properties go along with it. See below for a closeup description.
+
<!-- == Examples == -->
 +
<!-- This section contains examples transcluded from the snippet library. -->
  
== Item Types ==
+
<!-- == See also == -->
 +
<!-- This section contains links to articles, functions or constant groups. -->
  
Items are grouped into types called "Base Item Types".  The item's base type determines how it can be used and what its basic properties are. Weapon and armour items get their basic ratings from their base item type.  This is further modified by the material type of the item (i.e., high steel sword vs. low steel sword) and other item properties on them.
+
</pre>
  
You can edit or create new Items with the Toolsets Object Inspector Editor. This will yield their Properties.
+
A standard dafunction page will have a number of other headers below this template where more detailed and free-form information will be added by editors.
  
=== Properties ===
+
The return and parameter fields also have corresponding "arra" fields, for example param1arra. When any value is placed in these fields the corresponding return type or parameter type will be made into an array. This is needed because the [] notation of arrays conflicts with the wiki's link notation.
  
{{inspector start}}
+
Suggested standard headers include:
{{inspector section|General}}
+
__NOTOC__
{{inspector row|Activated Ability| Action happening on a specific event related to the item (hit with weapon, being hit on armor, etc.)}}
+
== Description ==
{{inspector row|Base Item Type| The inventory type of the item. Also gives the base appearance type for the item. As defined in [[BITM base.xls]] }}
+
== Known issues ==
{{inspector row|Comments| General information about the item }}
+
== Examples ==
{{inspector row|Crafting Recipe Type| The type of recipe this is. As defined in "recipes.gda" 2DA. }}
+
== See also ==
{{inspector row|Description| Description (as seen in game?) }}
+
{{inspector row|DescriptionRequiresReTranslation| A flag used for [[localization]]. }}
+
{{inspector row|Heraldry| Allows Heraldry when defined in [[BITM base.xls]] (Shields can). Variations as defined in "[[heraldry.xls]]" 2DA. }}
+
{{inspector row|Icon| Icon for display in game. Only names beginning with ico_ to be used }}
+
{{inspector row|Inventory Subgroup| {{undocumented}} }}
+
{{inspector row|Item Variation| An appearance variation based on the base item type. As defined in the appropriate Variations 2DA. See [[ItemVariations.xls]] }}
+
{{inspector row|MaterialProgression| {{undocumented}} }}
+
{{inspector row|MaterialType| Material Variation, and can give the Item additional properties. As defined in materialtypes 2DA}}
+
{{inspector row|Name| Name of the Item.  (as it appears in Game?) }}
+
{{inspector row|NameRequiresReTranslation| A flag used for [[localization]]. }}
+
{{inspector row|Resource Name| A unique string identifier the toolset and the game both use to refer to this resource}}
+
{{inspector row|Tag| A non-unique string identifier used mostly by scripts and other resources to refer to this resource. }}
+
{{inspector row|Tint Override| {{undocumented}} }}
+
  
{{inspector section|Attributes}}
+
With others added when and where needed.
{{inspector row|Body Tint| Affects the appearance of item wearer. Typically used to customize the Dog's warpaint. }}
+
{{inspector row|Body Tint Mask| Affects the appearance of item wearer. Typically used to customize the Dog's warpaint. }}
+
{{inspector row|Cost| Base money value of the item. In Coppers. }}
+
{{inspector row|Damaged| {{undocumented}} }}
+
{{inspector row|Item Properties| Allows selecting one or more item properties for the item. Item Properties are any special power, effects, or stat variations beyond the basic item attributes. Properties also includes restrictions by class, race, etc. See [[Item properties]] for more information. }}
+
{{inspector row|OnHit Effect| {{undocumented}} }}
+
{{inspector row|OnHit Power| {{undocumented}} }}
+
{{inspector row|Plot Item| A plot item can not be destroyed or removed from inventory by the player once the player has acquired it. Plot items can only be removed via scripts written by the designer.}}
+
{{inspector row|Script| Event script assigned to the resource - see below}}
+
{{inspector row|Unique| {{undocumented}} }}
+
{{inspector row|Variable 2da| 2da file containing a variable table. Only the values in the table can be set and retrieved by scripting. }}
+
{{inspector row|Variables| Opens the variable table for editing, allows the initial values of the variables to be defined. See below. }}
+
  
{{inspector section|Model Appearance (R/O)}}
+
[[Category:Formatting templates]]
{{inspector row|Model Appearance| Shows the Model how it appears on a specific wearer, ie Human. Helps distinguish Models worn by multiple races? }}
+
</noinclude>
{{inspector row|Model Gender| Same as above ,but switches Gender. (Only for display?) }}
+
{{inspector end}}
+
 
+
=== Appearance ===
+
 
+
An item's appearance will be determined by their base type and an appearance field. Most Items are in some way visible in Game. "Base Item Type" is merely a category of [[Model|Models]] with the default displaying first. Whereas "Item Variation" determines the [[Model]] file itself, while also paying attention to the Gender and Race of the wearer.
+
 
+
Visual effect item properties can be applied later to further modify the appearance of the item (flame effects, etc…)
+
 
+
=== Item Script ===
+
 
+
The purpose of the item event script (if any) is not clear. Events involving items (acquire, lose, equip, unequip, etc…) are received by the event script for the creature or placeable owning the item, but are not received by the item script.
+
 
+
=== Activated Ability ===
+
 
+
Item Abilities are activated abilities on items (for example, a potion with the activated ability Healing is a Potion of Healing). An item can only have one item ability. This item ability is assigned in the toolset. They are not item properties.
+
 
+
Item abilities cannot be placed on equippable items. Item abilities are activated by right-clicking or double-clicking the item or from using the item from the quickbar.
+
 
+
=== Variables ===
+
 
+
{{variable table start}}
+
{{variable table row|APP_ITEM_MOTIVATION | int |0| }}
+
{{variable table row|ITEM_CODEX_FLAG | int |-1| when != -1, this will be the codex plot flag to set for this item when acquired. The plot name is the tag of the item}}
+
{{variable table row|ITEM_COUNTER_1 to 2 | int |0| }}
+
{{variable table row|ITEM_CRUST | int |0| }}
+
{{variable table row|ITEM_DO_ONCE_A and B | int |0| }}
+
{{variable table row|ITEM_SEND_ACQUIRED_EVENT | int |0| When true, [[EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED]] is sent to the module's event script when the item is aquired. }}
+
{{variable table row|ITEM_SET | int |-1| Certain items will give a bonus when equipped with other members of the same set (as identified by this integer).}}
+
{{variable table row|ITEM_SPECIALIZATION_FLAG| int|0|For items that unlock a class specialisation this must match an ID from Achievements.xls, ITEM_SEND_ACQUIRED_EVENT must also be set.}}
+
{{variable table row|ITEM_SEND_LOST_EVENT| int| 0 | }}
+
{{variable table row|PROJECTILE_OVERRIDE|int|0|Used to change the default projectile for Mage Staves, values must match an ID from [[PRJ_base.xls|PRJ_base.xls]] (typically 125-129).}}
+
{{variable table row|ITEM_RUNE_ENABLED|int|0|When true, items may have a number of rune slots, dependant on the relevant RuneCount values in [[BITM_base.xls#BITM_base_worksheet|BITM_base.xls]] and [[Materialtypes.xls#materialtypes|Materialtypes.xls]] }}
+
{{variable table end}}
+
 
+
 
+
== Tools ==
+
 
+
Once created, item can be given as inventory to creatures and placeables.  Once placed, both the creature/placeable and the item must be exported in order to be viewed in the game.  Exporting happens automatically or can be done manually by the designer during testing.
+
 
+
== Item Scaling ==
+
<!-- this can only be years old -->
+
The item system needs to be very robust, allowing for a wide diversity of item types, item appearances within a type, and rules scaling. Material types are the primary mechanism for item scaling... i.e., we won't randomize the type of item in many cases (flaming sword) but we will randomize its material type (low steel flaming sword vs. high steel flaming sword)
+
 
+
As the player gains levels he or she will encounter progressively more powerful items. Through the use of material types (unique models and/or color variation) we will scale our items so that we have a greater range of item diversity than in our previous games.
+
 
+
[[Category:Items]]
+

Revision as of 22:29, 9 February 2010

{{{brief}}}

[[{{{returntype}}}]] {{{name}}}(

);

Parameters:
None
Returns:
{{{returndesc}}}
Source:
[[{{{sourcefile}}}]]



Usage:

{{dafunction
|name = _AI_Condition_GetCreatureWithAIStatus
|brief = Returns a creature with a specifc AI Status
|param1type = int
|param1name = nAIStatus
|param1desc = the status being checked for if active on a creature
|param1default =
|param2type = int
|param2name = nTargetType
|param2desc = the target type of creature we are looking for that might have the specified status
|param2default =
.
.
.
|returntype = object
|returndesc = A creature of a specific type (self, ally, hostile) that has the status applied, OBJECT_INVALID otherwise
|sourcefile = ai_conditions_h
|sourcemodule = Core Resources
}}

<!-- == Description == -->
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->

<!-- == Remarks == -->
<!-- This section contains additional comments, observations and known issues. -->

<!-- == Examples == -->
<!-- This section contains examples transcluded from the snippet library. -->

<!-- == See also == -->
<!-- This section contains links to articles, functions or constant groups. -->

A standard dafunction page will have a number of other headers below this template where more detailed and free-form information will be added by editors.

The return and parameter fields also have corresponding "arra" fields, for example param1arra. When any value is placed in these fields the corresponding return type or parameter type will be made into an array. This is needed because the [] notation of arrays conflicts with the wiki's link notation.

Suggested standard headers include:

Description

Known issues

Examples

See also

With others added when and where needed.