Difference between revisions of "Creating a module"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(addins)
 
(29 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Modules are the campaigns that players can embark on. They contain the resources needed for the adventure they encompass (though you can also have modules inherit the resources of other modules).
+
{{Infobox module}}
 +
To create and modify [[module]]s, select "Manage Modules" from the File menu. This will bring up a list of existing modules, with a "New" button for creating new modules and a "Properties" button for editing the properties of existing modules. You can only edit the properties of the module that's currently open.
  
Resources that are in the "Core Games Resources" module are available to all modules.
+
'''NOTE:''' when you create new items, it's best to stick to unique naming, specially if items belongs to your module. For example: your module UID is "asar" so item, createre, area or any other file should begin with asar_ (asar_mysword).
  
To create and modify modules, select "Manage Modules" from the File menu. This will bring up a list of existing modules, with a "New" button for creating new modules and a "Properties" button for editing the properties of existing modules. You can only edit the properties of the module that's currently open.
 
  
{|
+
== Creating a new Module ==
 +
 
 +
{| align=right
 
|-
 
|-
 
| [[Image:Module menu command.png|frame|Select "Manage Modules"]]
 
| [[Image:Module menu command.png|frame|Select "Manage Modules"]]
Line 11: Line 13:
 
|}
 
|}
  
When you create a new module the properties window will open. Edit the "Name" field to name the new module and then click "OK"; the other properties can be changed later on once you have some content to set them to.
+
#Open File/Manage Modules
 +
#Click on "New" and the module properties window will open.  
 +
#Edit the "Name" field give the module a name (This is the name that will also be visible in Game as a Addin)
 +
#Add a unique identifier string to the UID field. The File and Folder will appear in that name.
 +
#Make an independent note of the StringID Begin value. This is vital information if you ever have to export the module to a new data base.
 +
#Then click "OK"; the other properties can be changed later on once you have some content to set them to.
  
Currently there is no way to delete a module within the toolset once it's been created.
+
=== Opening the Module ===
  
To select which module you're working with, select the module in the Manage Modules list and click the "Open" button. Only resources that are available to the open module will be visible.
+
#Select the module in the Manage Modules list  
 +
#Click the "Open" button.  
  
To open a module's object inspector window to modify its properties, open "manage modules", select the module, and click the "properties" button.
+
*The Open Module is displayed in the Title Bar. Only resources that are available to the open module will be visible.
  
== Character generation ==
+
=== To create a standalone module: ===
  
A module with no event script will start the player without going through character generation, which will leave the player with an almost unusable character to play with. To send the player through a basic character generation UI use the following script as the module event script:
+
#Select the module in the Manage Modules list
 +
#Click on the "Hierarchy" button
 +
#Unmark any parent module (all are unmarked by default)
  
<pre>
+
*The Extended Module property should be left as the default (None).
#include "events_h"
+
*You should use the default script "module_core" or your own custom script.
#include "global_objects_h"
+
  
void main()
+
=== Extending the game with addins (common) ===
{
+
    event ev = GetCurrentEvent();
+
    int nEventType = GetEventType(ev); //extract event type from current event
+
    int nEventHandled = FALSE; //keep track of whether the event has been handled
+
    switch(nEventType)
+
    {
+
        case EVENT_TYPE_MODULE_START:
+
        {
+
            PreloadCharGen(); //preloads resources needed for character generation
+
            StartCharGen(GetHero(),0); //initiates character generation
+
            break;
+
        }
+
    }
+
    if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
+
    {
+
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
+
    }
+
}
+
</pre>
+
  
Another quick and dirty method that skips the character generation interface:
+
#Select the module in the Manage Modules list
 +
#Click on the "Hierarchy" button
 +
#Mark the parent module "Single Player"
 +
#Hit OK
  
<pre>
+
*The Extended Module property should be set to "Single Player".
        case EVENT_TYPE_MODULE_START:
+
*Note that as of toolset version 1.01 and game version 1.02b, you should NOT use "module_core" as the script (as found in module properties) for an add-in that extends an existing module, otherwise you will encounter issues that may include slow-downs during conversations and attribute allocation.  The exact cause of these issues is not yet known, but using a blank script with an empty main function will eliminate these issues.
        {
+
*Resources of "Single Player" will now become available to this module.
  
            // skip character generation
+
=== Advanced Properties ===
            object oHero = GetHero();
+
            Chargen_InitializeCharacter(oHero);
+
            Chargen_SelectRace(oHero,RACE_HUMAN);
+
            Chargen_SelectCoreClass(oHero,CLASS_WARRIOR);
+
            Chargen_SelectBackground(oHero,BACKGROUND_NOBLE);
+
  
            // give the player some equipment
+
#Select the module in the Manage Modules list
            object oItem = UT_AddItemToInventory(R"kingarmor.uti");
+
#Click on the "Properties" button
            EquipItem(oHero,oItem);
+
The Settings can be changed at any later time. To set up your Module prior Exporting see [[Manage modules]]
            oItem = UT_AddItemToInventory(R"kingboots.uti");
+
            EquipItem(oHero,oItem);
+
            oItem = UT_AddItemToInventory(R"kinggloves.uti");
+
            EquipItem(oHero,oItem);
+
            oItem = UT_AddItemToInventory(R"kingshield.uti");
+
            EquipItem(oHero,oItem);
+
            oItem = UT_AddItemToInventory(R"kingsword.uti");
+
            EquipItem(oHero,oItem);
+
  
            break;
+
*For a detailed explanation of the properties you will see here, See [[module|Module]].
        }
+
</pre>
+
  
A more sophisticated script could include other setup code, for example triggering an introductory cinematic to inform the player of the game's plot.
 
  
== Extending the game - Addins vs. Modules ==
+
----
  
Add-ins are meant to extend an existing module or provide resources for (potentially) multiple modules, whereas modules are stand-alone units, which can be extended or draw on additional resources, but don't need to).
+
The only module type that's supported by the toolset is "Addin". You can use addins in two basic ways; either to extend an existing campaign (such as the main campaign) or as a stand-alone campaign in its own right. Addins can be enabled and disabled by the user in the "Downloadable content" menu from the game. You can also create addins that add to or modify core resources, which are available to all modules of the game.
  
Addins can be enabled and disabled. Addins not only extend a module but add onto a module as well. Modules can't interact with other Modules in the game. An Addin that extends a module will always have its core resources loaded when the module is loaded regardless of whether the Addin is disabled. An Addin that adds onto a module will only have it's core resources loaded when it is enabled.
+
A module with no event script will start the player without going through character generation, which will leave the player with an almost unusable character to play with. See [[character generation]] for some simple character generation code you can use.  
  
To create an addin that extends another module:
+
'''NOTE:''' Currently there is no way to delete a module within the toolset once it's been created.
  
# Open File/Manage Modules
+
== Core resources: ==
# Add a new Module
+
# Click on the “Hierarchy” button
+
# Select the parent module
+
  
Remember also to set the Extended Module property.
+
One way of using the same object template in more than one module is to create a core resource.  
  
Core resources:
+
When importing a character from one module to another, custom items in the player's inventory will be lost unless the resource template is available to both modules. A core resource is one way of doing this.
  
Any item that the player can use or that a creatures drops for the player, needs to be a core resource. To create a core resource:
+
Note that core resources are visible to every campaign, so, for compatibility purposes, it's better to use alternate methods where available. For example, an add-in inherits resources from the parent module, so there's no need to use core resources in that case.  
 +
 
 +
To create a core resource:
 
# Right click on properties for the resource in the Palette Window
 
# Right click on properties for the resource in the Palette Window
 
# Change Module to: Core Game Resources
 
# Change Module to: Core Game Resources
 
# Change Owner Module to: New Module Name
 
# Change Owner Module to: New Module Name
Be aware of dependencies between core and non-core resources; especially around scripts.  
+
Be aware of dependencies between core and non-core resources; especially around scripts. If a core resource uses a non-core script, the script won't exist if you use the core resource in a different module.
 
+
== Properties ==
+
 
+
{{inspector start}}
+
{{inspector section|General }}
+
{{inspector row|Client Script | Client scripts simulate user input }}
+
{{inspector row|Description | }}
+
{{inspector row|DescriptionStringID | }}
+
{{inspector row|Directory | }}
+
{{inspector row|DisplayName | }}
+
{{inspector row|DisplayNameStringID | }}
+
{{inspector row|Extended Module | If the module is an add-on to an existing module (such as Single Player), select it from the drop-down list here. When this is set the module will be added to addins.xml when it is exported. }}
+
{{inspector row|Include In Resource Build | }}
+
{{inspector row|Name | The name of the module. }}
+
{{inspector row|Script | Event script assigned to the resource }}
+
{{inspector row|Starting Area | The area that the player starts in when the campaign begins. }}
+
{{inspector row|Starting Waypoint | The waypoint within the starting area that the player appears at when the campaign begins. This property is not used if the module is an add-on to an existing module. }}
+
{{inspector row|Type | Core, Module, Package or PRC. }}
+
  
{{inspector section|Modification History }}
+
There will be a separate [[talk table]] created for the Addin in its directories. When the game loads it will combine all the talk tables across all the addins that it knows about.
{{inspector row|Created By | User who created this module. }}
+
{{inspector row|Created On | The date it was created on. }}
+
{{inspector row|Last Modified By | The user who last modified the module. }}
+
{{inspector row|Last Modified On | The date it was last modified on. }}
+
  
{{inspector section|Variables }}
+
{{languages}}
{{inspector row|Variable 2da | 2da file containing a variable table. Only the values in the table can be set and retrieved by scripting. }}
+
[[category:modules]]
{{inspector row|Variables | Opens the variable table for editing, allows the initial values of the variables to be defined. }}
+
{{inspector end}}
+

Latest revision as of 07:34, 29 November 2013

Module topics

To create and modify modules, select "Manage Modules" from the File menu. This will bring up a list of existing modules, with a "New" button for creating new modules and a "Properties" button for editing the properties of existing modules. You can only edit the properties of the module that's currently open.

NOTE: when you create new items, it's best to stick to unique naming, specially if items belongs to your module. For example: your module UID is "asar" so item, createre, area or any other file should begin with asar_ (asar_mysword).


Creating a new Module

Select "Manage Modules"
Then click the "New" button to create a new module.
  1. Open File/Manage Modules
  2. Click on "New" and the module properties window will open.
  3. Edit the "Name" field give the module a name (This is the name that will also be visible in Game as a Addin)
  4. Add a unique identifier string to the UID field. The File and Folder will appear in that name.
  5. Make an independent note of the StringID Begin value. This is vital information if you ever have to export the module to a new data base.
  6. Then click "OK"; the other properties can be changed later on once you have some content to set them to.

Opening the Module

  1. Select the module in the Manage Modules list
  2. Click the "Open" button.
  • The Open Module is displayed in the Title Bar. Only resources that are available to the open module will be visible.

To create a standalone module:

  1. Select the module in the Manage Modules list
  2. Click on the "Hierarchy" button
  3. Unmark any parent module (all are unmarked by default)
  • The Extended Module property should be left as the default (None).
  • You should use the default script "module_core" or your own custom script.

Extending the game with addins (common)

  1. Select the module in the Manage Modules list
  2. Click on the "Hierarchy" button
  3. Mark the parent module "Single Player"
  4. Hit OK
  • The Extended Module property should be set to "Single Player".
  • Note that as of toolset version 1.01 and game version 1.02b, you should NOT use "module_core" as the script (as found in module properties) for an add-in that extends an existing module, otherwise you will encounter issues that may include slow-downs during conversations and attribute allocation. The exact cause of these issues is not yet known, but using a blank script with an empty main function will eliminate these issues.
  • Resources of "Single Player" will now become available to this module.

Advanced Properties

  1. Select the module in the Manage Modules list
  2. Click on the "Properties" button

The Settings can be changed at any later time. To set up your Module prior Exporting see Manage modules

  • For a detailed explanation of the properties you will see here, See Module.



The only module type that's supported by the toolset is "Addin". You can use addins in two basic ways; either to extend an existing campaign (such as the main campaign) or as a stand-alone campaign in its own right. Addins can be enabled and disabled by the user in the "Downloadable content" menu from the game. You can also create addins that add to or modify core resources, which are available to all modules of the game.

A module with no event script will start the player without going through character generation, which will leave the player with an almost unusable character to play with. See character generation for some simple character generation code you can use.

NOTE: Currently there is no way to delete a module within the toolset once it's been created.

Core resources:

One way of using the same object template in more than one module is to create a core resource.

When importing a character from one module to another, custom items in the player's inventory will be lost unless the resource template is available to both modules. A core resource is one way of doing this.

Note that core resources are visible to every campaign, so, for compatibility purposes, it's better to use alternate methods where available. For example, an add-in inherits resources from the parent module, so there's no need to use core resources in that case.

To create a core resource:

  1. Right click on properties for the resource in the Palette Window
  2. Change Module to: Core Game Resources
  3. Change Owner Module to: New Module Name

Be aware of dependencies between core and non-core resources; especially around scripts. If a core resource uses a non-core script, the script won't exist if you use the core resource in a different module.

There will be a separate talk table created for the Addin in its directories. When the game loads it will combine all the talk tables across all the addins that it knows about.


Language: English  • русский