Difference between revisions of "PRCSCR Script Templates"

From Dragon Age Toolset Wiki
Jump to: navigation, search
Line 17: Line 17:
 
|-
 
|-
 
| [[PRCSCR Script Templates#Activating a Waypoint on the Worldmap|3. Activating a Waypoint on the Worldmap]]
 
| [[PRCSCR Script Templates#Activating a Waypoint on the Worldmap|3. Activating a Waypoint on the Worldmap]]
| This Script serves to activate a custom Waypoint (Map Pin) of choice ,at any time into the Game.
+
| This Script serves to activate a custom Waypoint (Map Pin) of choice ,when leaving Lothering or at any other time into the Game.
 
|-
 
|-
 
| 4...
 
| 4...

Revision as of 21:45, 1 February 2010

This page serves as a repository for ready to use M2DA's and Scripts to use with PRCSCR M2DA's when adding custom content to the game.

References:

  • See Main Article: PRCSCR
  • See PRCSCR.xls for details about that M2DA, or 2DA for an explanation of 2DA's as a whole
  • To create a Script, right click in the Resourcepalette and select "New/Script" , or see Designer Resources for such Resources as a whole.


Contents:

1. Adding a placeable into an existing Area This Script serves to add a placeable of your choice into an Area of choice.
2. Adding a Vendor into an existing Area This Script serves to any custom Vendor to a Area of choice.
3. Activating a Waypoint on the Worldmap This Script serves to activate a custom Waypoint (Map Pin) of choice ,when leaving Lothering or at any other time into the Game.
4... ....


Adding a placeable into an existing Area

M2DA Setup:

  1. AreaListName must not be "any". Chose a specific one.
  2. Copy the GDA into your modules override folder.

Script: (As taken from the Storage Chest mod a kind Bioware employee made :o)

//const string TAL_STORAGE_CHEST_SPAWNED = "TAL_STORAGE_CHEST_SPAWNED";
const string TAL_IP_STORAGE_CHEST = "tal_ip_storage_chest";
const resource TAL_RESOURCE_IP_STORAGE_CHEST = R"tal_ip_storage_chest.utp";
 
void main()
{
    object oMainControlled = GetMainControlled();
    object oChest = UT_GetNearestObjectByTag(oMainControlled, TAL_IP_STORAGE_CHEST);
 
 
    //DisplayFloatyMessage(oMainControlled, "storage script working", FLOATY_MESSAGE, 16777215, 30.0);
 
    if (!IsObjectValid(oChest))
    {
        location lSpawn = Location(GetArea(oMainControlled), Vector(148.77, 117.68, -0.94), 0.0);
        CreateObject(OBJECT_TYPE_PLACEABLE, TAL_RESOURCE_IP_STORAGE_CHEST, lSpawn);          
 
        //DisplayFloatyMessage(oMainControlled, "storage chest created", FLOATY_MESSAGE, 16777215, 30.0);
    }
}
  1. Replace "tal_ip_storage_chest" in the 2nd line with the "Tag" of your own placeable. (only small letters allowed)
  2. Replace "tal_ip_storage_chest.utp" in 3rd line with the Resources Filename of your placable.
  3. Exchange the (4) numbers after it sais "Vector" ,which should be the location of your placable. How to determine?
  4. Create a temporary duplicate of the specific Area, and add the placeable until you see fit. (delete this Area afterwards, do not export)
  5. Note down the numbers in the Object Inspector, and get the first 3 numbers of Position, and the 4rth Number from Rotation. (someone please confirm, my piece works except for rotation) [Undocumented]

Export the script, the placeable ,and start the game. When you arrive at the specific Area in game, the Placeable will be there.

Adding a Vendor into an existing Area

[Undocumented]

Activating a Waypoint on the Worldmap

Requirements: Your module must extend Single Player.

M2DA Setup:

  1. AreaListName must be "any". Because Waypoint activation should be universal and it is Plot driven.
  2. Copy the GDA into your modules override folder.

Script:

const string WML_WOW_Custom = "eshmeswp";
#include "plt_mnp000pt_main_events"
#include "wrappers_h"
void main()
{
    if(WR_GetPlotFlag( PLT_MNP000PT_MAIN_EVENTS, ARCHDEMON_EVENT_ONE) == TRUE )
    {
        WR_SetWorldMapLocationStatus(GetObjectByTag(WML_WOW_Custom), WM_LOCATION_ACTIVE);
    }
}
  1. Replace "eshmeswp" in the 1st line with the "Tag" of your Waypoint (Map Pin) which u created. That Map Pin can be greyed out or inactive or so. See Map for details.

Export the script, the Map ,and start the game. The Waypoint will now be activated once you leave Lothering, just like the other main Waypoints. This is to get in line with the Story. However to change the time of it happening..

  1. Find which Plot should activate the Waypoint. The above example uses the Archdemon quest, when your nightmare triggers for example.
  2. Exchange "mnp000pt_main_events" in the 2nd and 6th line with another Plot. Leaving the "plt_" there.
  3. Exchange "ARCHDEMON_EVENT_ONE" with a "Flag" of your choice from that Plot.

This "should" work for any plot. Additionally, waypoints in itself dont need all this PRCSCR stuff and can be set "Active" in the first place. But the above example is to get in line with the Main Campaign, and potential Plot conflicts if able to leave Lothering too early.