Creating a module

From Dragon Age Toolset Wiki
Revision as of 18:08, 27 June 2009 by BryanDerksen (Talk | contribs) (imported from extranet)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Module menu command.png

Module manage module window.png

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);
    }
}

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

To create a module 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.

Properties

General
Client Script Client scripts simulate user input
Description
DescriptionStringID
Directory
DisplayName
DisplayNameStringID
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.
Include In Resource Build
Name The name of the module.
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.
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.