Difference between revisions of "PRCSCR Script Templates"

From Dragon Age Toolset Wiki
Jump to: navigation, search
Line 1: Line 1:
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.
+
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 ''[[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.
  
 
__NOTOC__
 
__NOTOC__

Revision as of 14:11, 31 January 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 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 Area This Script serves to add a placeable of your choice into an Area of choice.
2. ... ...


Adding a placeable into an 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.
  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.

...