Difference between revisions of "How-tos"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(import from extranet)
 
(BSN link flagged for maintenance - using AWB)
 
(38 intermediate revisions by 12 users not shown)
Line 1: Line 1:
 +
{{BSN link}}
 +
 
This page lists how to accomplish tasks that are relatively simple and commonly needed, but that touch on multiple areas of the toolset or are difficult to figure out intuitively how to do.
 
This page lists how to accomplish tasks that are relatively simple and commonly needed, but that touch on multiple areas of the toolset or are difficult to figure out intuitively how to do.
  
Just collecting ideas at the moment, add headers if you think a how-to is needed on a particular subject.
+
See also [[Useful Scripts]] for "how-tos" that specifically involve [[script]]ing.
  
*[[3D control]]
+
See [[compiling 2DAs]] for methods of converting Excel source files into GDAs.
  
== Run a cutscene from a trigger ==
 
  
!!compile fails in test database due to bad core libraries, so this hasn't been tested!!
+
__TOC__
 +
== Add new music ==
  
Create a script:
+
Open up [[FMOD]]
  
<pre>
+
It creates a project - set the build directory to your DA override directory - with project highlighted, it is over on the top right about half way down the project settings. You can set a default resource directory but that will just set where the file browser defaults to so it is optional. I'd also define a name in those parameters while you are there.
#include "events_h"
+
#include "global_objects_h"
+
#include "utility_h"
+
  
void main ()
+
From there, you need a new event !!(not sure whether a blank default is generated or whether you have to right click and make a default blank event)!!. After you have an event, highlight it and change to the event tab (2nd tab). Here you need to import your file to link to that event.
{
+
    event ev = GetCurrentEvent();
+
    int nEventType = GetEventType(ev);
+
    int nEventHandled = FALSE;
+
    switch (nEventType)
+
    {
+
    case EVENT_TYPE_ENTER:
+
        {
+
        object oCreature = GetEventCreator(ev);
+
        if(IsPlayer(oCreature)) {
+
              resource rCutscene = R"my_cutscene.cut";
+
              CS_LoadCutscene(rCutscene);
+
              DestroyObject(OBJECT_SELF, 0);
+
        }
+
        break;
+
    }
+
    if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
+
    {
+
        HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
+
    }
+
}
+
</pre>
+
  
And set it as the event script for the trigger that you want to have run the cutscene.
+
On that tab I think it creates a empty row for your new event - right click and add wavetable or something like that - I think I use the top option. (Again, might be wrong but the basic goal is getting a audio file in that screen that plays when you hit the play button at the top)
  
== Add a follower to the player's party ==
+
Browse to your wav file or whatever you have.
  
<pre>
+
From there you should be able to play the sound both in the pop-up box and (once that is closed) back in the event tab. You'll see the name of the wave in that once empty row (IIRC).
if(IsPlayer(oCreature)) {
+
  object oFollower = GetObjectByTag("myfollower");
+
  UT_HireFollower(oCreature, oFollower);
+
}
+
</pre>
+
  
== Have an enemy play possum and then get up to fight ==
+
If you want, you can add layers of sounds to this event using the same process over and over, but keeping it simple; we'll just move along.
  
Set the creature's CREATURE_SPAWN_DEAD variable to 2.
+
Now you have a project and an event. You can set various parameters on the first tab that alter pitch etc on the first tab. (When you import the sound, you set whether it is a one shot or looping).
  
When it's time for the creature to rise and attack, execute the following script commands:
+
Once you have that done, go to the top drop down and find build. Build the files and you should see extra files in your override directory.
  
<pre>
+
From there, just open up the toolset (or hit refresh from within the toolset) and your project and event sounds should show up in the listing of sounds.
#include "wrappers_h"
+
...
+
WR_SetObjectActive(oCreature, TRUE);
+
SetCommandable(oCreature, TRUE);
+
// Make sure to set this flag back to 0 to avoid problems with savegames.
+
SetLocalInt(oCreature, CREATURE_SPAWN_DEAD, 0);
+
UT_CombatStart(oCreature, oPC);
+
</pre>
+
  
== Insert content into an existing area ==
+
You can then drag and drop them into the game or cutscene and they will play.
  
If you want to add new content on to an existing area (for example, putting a new character or area transition door into an area that exists in the single-player campaign) there are two different ways to do it. One is to override the existing area with a new area of your own design that duplicates the original with the exception of your additions. This is straightforward to do but can interact poorly with other add-ons - you can only have one version of an area active at a time.
+
== Adding music to cutscenes ==
  
A more elegant and extensible approach is to use a PRCSCR_-prefixed M2DA. The PRCSCR M2DA has a very simple structure and a simple but profound effect:
+
The way we have been doing the music changes is via placed sound objects. These sound objects are generally created in [[FMOD]], and in FMOD you can say if the music will persist after the cutscene or end when the cutscene ends.
  
*ID - a unique integer identifier for each row
+
We are just using other sounds to switch music tracks. Designers can add music switch parameter to any sound in Fmod Designer, usually this is just VO line to change music track, for example:
*AreaListName - a string that identifies a specific area list, or the special keyword "any".
+
*Script - the name of a script file.
+
  
Whenever a player enters an area in an area list in this M2DA the associated script will be run. A modder can therefore include a script with his mod that will be run when the player enters an existing area that he didn't create. This script can freely add or remove placeables and creatures and perform whatever other modifications to the area that a script is capable of doing.
+
[[Image:FMOD music switch.jpg]]
  
Note that the script will be run every time the player enters the area, so you'll want to have an associated plot flag to ensure that the changes are only made once.
+
If there are no other sounds, designers can create empty sound event and add #music parameter there and place this sound on cutscene timeline.
 +
Music track has to be defined in the same group as music in current area in “music.fdp” to work.
  
The following example is a script that adds a new character from an add-on module to an existing area in the main game:
+
[[Image:FMOD music switch 2.jpg]]
  
 
<pre>
 
<pre>
void main()
+
#music:name,1 – non looping, for stingers
{
+
#music:name – for looping music
    //Check whether we've added Joblo already.
+
</pre>
    if (WR_GetPlotFlag("joblos_quest", JOBLO_ADDED_TO_TOWN) == FALSE)
+
    {
+
        object oTown = GetObjectByTag("lot100ar_lothering"); //An area's tag is the same as its resource name
+
        vector vJobloLocation = Vector(126.745f,120.724f,0.460568f); // See below for how to get these coordinates
+
  
        CreateObject(
+
--------------
            OBJECT_TYPE_CREATURE,
+
Another way
            R"joblo.utc",
+
--------------
            Location(oTown, vJobloLocation, 180.0f) //See below for how to get the value for orientation
+
        )
+
  
        WR_SetPlotFlag("joblos_quest", JOBLO_ADDED_TO_TOWN, TRUE);
+
1. Open up '''FMOD''' (fmod comes with dragon age, do a search for fmod in dragon age directory)
    }
+
}
+
</pre>
+
  
Since you can't add [[waypoint]]s to an existing area you'll need to enter the position and orientation values for the target location manually. You can find them by creating a local copy of the area in question and temporarily adding a waypoint to copy down the coordinates and orientation you'll need.
+
2. '''File''' ---> '''New Project''' --> and call the project whatever you want and place it in whatever folder you want.
  
== Add new music ==
+
3. '''Double click''' the '''folder''' under '''Hierarchy''' (purple icon folder) and an event will appear beneath it. Name this event whatever you want.  (If there is no event for some reason right click and add one).
  
Open up [[FMOD]]
+
4. Now click '''"Event Editor"''' Tab. (Make sure your event was selected before you do this).
  
It creates a project - set the build directory to your DA override directory - with project highlighted, it is over on the top right about half way down the project settings. You can set a default resource directory but that will just set where the file browser defaults to so it is optional. I'd also define a name in those parameters while you are there.
+
5. '''Right click''' one of the open sound fields (find it) and click '''"Add Sound"'''. (just right click all over until you see the option).
  
From there, you need a new event !!(not sure whether a blank default is generated or whether you have to right click and make a default blank event)!!. After you have an event, highlight it and change to the event tab (2nd tab). Here you need to import your file to link to that event.
+
6. In this window you will see '''"LOOPING"''' and '''"ONE SHOT"''' on the right hand side. Looping will be selected by default.  If you want your music to loop over & over again even after a cutscene is over leave it there. If you want your music to play ONE TIME then select "One Shot".
  
On that tab I think it creates a empty row for your new event - right click and add wavetable or something like that - I think I use the top option. (Again, might be wrong but the basic goal is getting a audio file in that screen that plays when you hit the play button at the top)
+
7. Now it's time to '''pick your music file''' by clicking '''"new wavetable"'''. '''Browse''' to your music file (wav), select it and '''press ok'''.
  
Browse to your wav file or whatever you have.
+
8. '''VERY VERY IMPORTANT'''.. '''YOU MUST DO THIS STEP'''....... Right click slightly above the timeline and click '''"ADD PARAMETER"'''.
  
From there you should be able to play the sound both in the pop-up box and (once that is closed) back in the event tab. You'll see the name of the wave in that once empty row (IIRC).
+
9. Now '''right click''' your new blank parameter, look at the bottom and click '''"PARAMETER PROPERTIES"'''.  Another new window will pop up.
  
If you want, you can add layers of sounds to this event using the same process over and over, but keeping it simple; we'll just move along.
+
10. '''VERY IMPORTANT'''..... Name this parameter:
  
Now you have a project and an event. You can set various parameters on the first tab that alter pitch etc on the first tab. (When you import the sound, you set whether it is a one shot or looping).
+
  #duck:music,1000,0,5000,-30     
  
Once you have that done, go to the top drop down and find build. Build the files and you should see extra files in your override directory.
+
Now click ok.
 +
 
 +
11. Your new parameter should read: '''#duck:music,1000,0,5000,-30 (Primary)'''
  
From there, just open up the toolset (or hit refresh from within the toolset) and your project and event sounds should show up in the listing of sounds.
+
12. Now click '''"Build"'''  and do '''"build project"'''.
  
You can then drag and drop them into the game or cutscene and they will play.
+
13. Note the new files in the directory where you saved the project.
  
== Adding music to cutscenes ==
+
14. Copy the '''FEV & FSB''' files from your FMOD project folder '''INTO YOUR OVERRIDE folder'''.  I made a folder called music to be organized.
  
The way we have been doing the music changes is via placed sound objects. These sound objects are generally created in [[FMOD]], and in FMOD you can say if the music will persist after the cutscene or end when the cutscene ends.
+
    FMODProjectFolder/whatever.fev
 +
    FMODProjectFolder/whatever.fsb
  
We are just using other sounds to switch music tracks. Designers can add music switch parameter to any sound in Fmod Designer, usually this is just VO line to change music track, for example:
+
COPY TO
  
[[Image:FMOD music switch.jpg]]
+
    Dragon Age\modules\Single Player\override\toolsetexport\music
  
If there are no other sounds, designers can create empty sound event and add #music parameter there and place this sound on cutscene timeline.
+
Or, for a custom module, COPY TO
Music track has to be defined in the same group as music in current area in “music.fdp” to work.
+
  
[[Image:FMOD music switch 2.jpg]]
+
    %My Documents%\BioWare\Dragon Age\addins\%Module Name%\core\override\music
  
<pre>
+
15. Now open up '''toolset''' and navigate to '''sound palette''' and you should see your new sound file.  Type the name of your sound file in the filter to find it faster. (Do not type the folder name in the filter. The filter works by filenames and not folders).
  #music:name,1 – non looping, for stingers
+
 
  #music:name – for looping music
+
16. Open a '''cutscene''', then left click your new sound file in the right hand sound palette window to select and highlight it. (just a simple left click on it).
</pre>
+
 
 +
17. Now '''left click anywhere in your cutscene''' and a sound icon will be added which is your sound file.
  
== Delete resources ==
+
'''Congrats''', 17 steps and now you've added a simple music file to your project and ready for your cutscene. *Sweats*
  
Resource deletion can sometimes be a bit complicated. Check the following:
+
== External Tutorials ==
 +
[http://bg2redux.student.utwente.nl/trac/wiki/How%20to%3A%20Add%20New%20Music%20and%20Sounds How to: Add New Music and Sounds] by Cuvieronius of the [http://www.gamersnexus.net/bgr-home Baldur's Gate Redux] Team.
  
*Resources must be checked in when deleted. This is so that the toolset can be sure that all dependencies have been properly resolved.
+
[http://social.bioware.com/forum/Dragon-Age-Toolset/Toolset---Cutscenes/Cutscene-Music-to-replace-in-game-vanilla-question-Solved-2847712-1.html How to: Insert Original Edited Music into a Cutscene] by DahliaLynn.
*If other resources reference the resource it can't be deleted. This means that sometimes you'll need to delete resources in a specific order. For example, you can't delete a creature that's being used in an area, but you could delete the area and then delete the creature. Occasionally there may be circular references that you'll need to break by editing the resources before deleting them. For example:
+
[[Category:Tutorials]]
**A stage can reference an area, which can then reference the stage.
+
**A plot file can have an associated event script, which will almost certainly include the plot file.
+
**A stage can reference a creature, which references a dialogue, which references the original stage.
+

Latest revision as of 17:18, 1 February 2022

This article contains links to the BioWare Social Network (BSN), which is now closed.

These links should be replaced with working links where possible, and tutorials edited to remove reliance on BSN.

This page lists how to accomplish tasks that are relatively simple and commonly needed, but that touch on multiple areas of the toolset or are difficult to figure out intuitively how to do.

See also Useful Scripts for "how-tos" that specifically involve scripting.

See compiling 2DAs for methods of converting Excel source files into GDAs.


Add new music

Open up FMOD

It creates a project - set the build directory to your DA override directory - with project highlighted, it is over on the top right about half way down the project settings. You can set a default resource directory but that will just set where the file browser defaults to so it is optional. I'd also define a name in those parameters while you are there.

From there, you need a new event !!(not sure whether a blank default is generated or whether you have to right click and make a default blank event)!!. After you have an event, highlight it and change to the event tab (2nd tab). Here you need to import your file to link to that event.

On that tab I think it creates a empty row for your new event - right click and add wavetable or something like that - I think I use the top option. (Again, might be wrong but the basic goal is getting a audio file in that screen that plays when you hit the play button at the top)

Browse to your wav file or whatever you have.

From there you should be able to play the sound both in the pop-up box and (once that is closed) back in the event tab. You'll see the name of the wave in that once empty row (IIRC).

If you want, you can add layers of sounds to this event using the same process over and over, but keeping it simple; we'll just move along.

Now you have a project and an event. You can set various parameters on the first tab that alter pitch etc on the first tab. (When you import the sound, you set whether it is a one shot or looping).

Once you have that done, go to the top drop down and find build. Build the files and you should see extra files in your override directory.

From there, just open up the toolset (or hit refresh from within the toolset) and your project and event sounds should show up in the listing of sounds.

You can then drag and drop them into the game or cutscene and they will play.

Adding music to cutscenes

The way we have been doing the music changes is via placed sound objects. These sound objects are generally created in FMOD, and in FMOD you can say if the music will persist after the cutscene or end when the cutscene ends.

We are just using other sounds to switch music tracks. Designers can add music switch parameter to any sound in Fmod Designer, usually this is just VO line to change music track, for example:

FMOD music switch.jpg

If there are no other sounds, designers can create empty sound event and add #music parameter there and place this sound on cutscene timeline. Music track has to be defined in the same group as music in current area in “music.fdp” to work.

FMOD music switch 2.jpg

 #music:name,1 – non looping, for stingers
 #music:name – for looping music

Another way


1. Open up FMOD (fmod comes with dragon age, do a search for fmod in dragon age directory)

2. File ---> New Project --> and call the project whatever you want and place it in whatever folder you want.

3. Double click the folder under Hierarchy (purple icon folder) and an event will appear beneath it. Name this event whatever you want. (If there is no event for some reason right click and add one).

4. Now click "Event Editor" Tab. (Make sure your event was selected before you do this).

5. Right click one of the open sound fields (find it) and click "Add Sound". (just right click all over until you see the option).

6. In this window you will see "LOOPING" and "ONE SHOT" on the right hand side. Looping will be selected by default. If you want your music to loop over & over again even after a cutscene is over leave it there. If you want your music to play ONE TIME then select "One Shot".

7. Now it's time to pick your music file by clicking "new wavetable". Browse to your music file (wav), select it and press ok.

8. VERY VERY IMPORTANT.. YOU MUST DO THIS STEP....... Right click slightly above the timeline and click "ADD PARAMETER".

9. Now right click your new blank parameter, look at the bottom and click "PARAMETER PROPERTIES". Another new window will pop up.

10. VERY IMPORTANT..... Name this parameter:

  #duck:music,1000,0,5000,-30      

Now click ok.

11. Your new parameter should read: #duck:music,1000,0,5000,-30 (Primary)

12. Now click "Build" and do "build project".

13. Note the new files in the directory where you saved the project.

14. Copy the FEV & FSB files from your FMOD project folder INTO YOUR OVERRIDE folder. I made a folder called music to be organized.

   FMODProjectFolder/whatever.fev
   FMODProjectFolder/whatever.fsb

COPY TO

   Dragon Age\modules\Single Player\override\toolsetexport\music

Or, for a custom module, COPY TO

   %My Documents%\BioWare\Dragon Age\addins\%Module Name%\core\override\music

15. Now open up toolset and navigate to sound palette and you should see your new sound file. Type the name of your sound file in the filter to find it faster. (Do not type the folder name in the filter. The filter works by filenames and not folders).

16. Open a cutscene, then left click your new sound file in the right hand sound palette window to select and highlight it. (just a simple left click on it).

17. Now left click anywhere in your cutscene and a sound icon will be added which is your sound file.

Congrats, 17 steps and now you've added a simple music file to your project and ready for your cutscene. *Sweats*

External Tutorials

How to: Add New Music and Sounds by Cuvieronius of the Baldur's Gate Redux Team.

How to: Insert Original Edited Music into a Cutscene by DahliaLynn.