Creating a module

From Dragon Age Toolset Wiki
Revision as of 16:37, 21 July 2009 by BryanDerksen (Talk | contribs) (Properties: updating properties)

Jump to: navigation, search

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).

Resources that are in the "Core Games Resources" module are available to all modules.

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.

Select "Manage Modules"
Then click the "New" button to create a new module.

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.

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

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.

To open a module's object inspector window to modify its properties, open "manage modules", select the module, and click the "properties" button.

Character generation

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:

#include "events_h"
#include "global_objects_h"
 
void main()
{
    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);
    }
}

Another quick and dirty method that skips the character generation interface:

        case EVENT_TYPE_MODULE_START:
        {
 
            // skip character generation
            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
            object oItem = UT_AddItemToInventory(R"kingarmor.uti");
            EquipItem(oHero,oItem);
            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;
        }

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).

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.

To create an addin that extends another module:

  1. Open File/Manage Modules
  2. Add a new Module
  3. Click on the “Hierarchy” button
  4. Select the parent module

Remember also to set the Extended Module property.

Core resources:

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:

  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.

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

Properties

General
Client Script Client scripts simulate user input
Include In Resource Build This was used internally in the development of Dragon Age to determine whether a module in the designer database was automatically included in builds.
Name The name of the module, used internally in the toolset title bar and as a fallback in the game if a description string ID has not been set.
Script Event script assigned to the resource
Starting Area The area that the player starts in when the campaign begins.
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.
Type Core, Module, Package or PRC.
UID "Unique ID", this is not seen by the player. It is used in various configuration files and as the name of the directory that the module is stored in when exported.
Info
Content Module If this module is a PRC "offer" module, this indicates the module that it is offering for download. This is not likely to be used outside of BioWare.
Description This property can't be set directly, it displays the contents of the description string ID set below.
DescriptionStringID A string ID pointing to a short description of your module
DisplayName This property can't be set directly, it displays the contents of the display name string ID set below.
DisplayNameStringID A string ID pointing to the name of your module.
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.
Game Version
Image An icon that's displayed in the installed content page
Presentation
Price
Priority
ProductID
Publisher This property can't be set directly, it displays the contents of the publisher string ID set below.
PublisherStringID
Rating This property can't be set directly, it displays the contents of the rating string ID set below.
Rating Description This property can't be set directly, it displays the contents of the rating description string ID set below.
RatingDescriptionStringID
RatingStringID
Release Date The date the module was released in its current form
URL
URLStringID
Version The version number you've assigned to the module's current state.
Modification History
Created By User who created this module.
Created On The date it was created on.
Last Modified By The user who last modified the module.
Last Modified On The date it was last modified on.
Variables
Variable 2da 2da file containing a variable table. Only the values in the table can be set and retrieved by scripting.
Variables Opens the variable table for editing, allows the initial values of the variables to be defined.