Difference between revisions of "PRCSCR Script Templates/ru"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (Edit)
m (Небольшие правки)
Line 1: Line 1:
{{rupage|Шаблоны скриптов PRCSCR|Скрипты|Требуется перевод}}
+
{{rupage|Шаблоны скриптов PRCSCR|Система PRCSCR|Скрипты}}
This page serves as a repository for ready to use M2DA's and Scripts to use in conjunction with [[PRCSCR]] M2DA's when adding custom content to the game.  
+
На этой странице собираются скрипты, готовые к использованию в {{ulink|PRCSCR|системе PRCSCR}} в сочетании с {{ulink|PRCSCR.xls|M2DA-файлом PRCSCR}}.
  
References:
+
'''Ссылки:'''
*See Main Article: ''[[PRCSCR]]''
+
* {{ulink|PRCSCR|Система PRCSCR}}.
*See ''[[PRCSCR.xls]]'' for details about that M2DA, or ''[[2DA]]'' for an explanation of 2DA's as a whole
+
* {{ulink|PRCSCR.xls|PRCSCR-файл.}}
*To create a Script, right click in the Resourcepalette and select "New/Script" , or see ''[[Designer Resources]]'' for such Resources as a whole.
+
* {{ulink|2DA|Таблицы 2DA}}.
 +
* {{ulink|Script|работа со скриптами}}.
  
 
{{ExTOC start}}
 
{{ExTOC start}}
{{ExTOC column|Adding an Item to an existing Vendor or Container|This Script serves to add any Item into a existing Vendors Inventory, as long the Vendor exists}}
+
{{ExTOC column|Размещение предмета на локации|Этот скрипт позволяет разместить предмет на загружаемой локации.}}
 +
{{ExTOC column|Размещение НПС на локации|Этот скрипт позволяет разместить НПС на загружаемой локации.}}
 +
{{ExTOC column|Активация локации на карте мира|Этот скрипт позволяет активировать иконку локации на карте мира.}}
 +
{{ExTOC column|Добавление вещей в инвентарь|Этот скрипт позволяет добавить любую вещь в инвентарь игрока.}}
 +
{{ExTOC column|Добавление вещей торговцу или в контейнер|Этот скрипт позволяет добавлять предметы существующим на локации торговцам или в контейнеры.}}
 +
{{ExTOC column|Adding a Working Door into an existing Area|This Script serves to add a custom Door into a existing Area, that the Player can enter into a custom Area.}}
 +
{{ExTOC column|Adding a Quest to an existing Chanters Board|This Script serves to add a new Quest to a existing Chanters Board, at any chosen time into the Game.}}
 
{{ExTOC end}}
 
{{ExTOC end}}
  
<!-- No Table of contents... but a neat custom one -->
 
 
__NOTOC__
 
__NOTOC__
'''Contents:'''
 
{| style="background-color:#eeeeee; border:2px #999999 solid; padding:4px; margin:4px" border="3"
 
| width=300 |[[PRCSCR Script Templates#Adding a placeable into an existing Area|1. Adding a placeable into an existing Area]]
 
| width=800 |This Script serves to add a placeable of your choice into an Area of choice. ''(non removable)''
 
|-
 
| [[PRCSCR Script Templates#Adding a NPC into an existing Area|2. Adding a NPC into an existing Area]]
 
| This Script serves to any custom NPC or Creature to a Area of choice. ''(removable)''
 
|-
 
| [[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 ,when leaving Lothering or at any other time into the Game.
 
|-
 
| [[PRCSCR Script Templates#Adding an Item into the Players Inventory|4. Adding an Item into the Players Inventory]]
 
| This Script serves to instantly add an Item into the Players Inventory.
 
|-
 
| [[PRCSCR Script Templates#Adding an Item to an existing Vendor or Container|5. Adding an Item to an existing Vendor or Container]]
 
| This Script serves to add any Item into a existing Vendors Inventory, as long the Vendor exists.
 
|-
 
| 6. Adding a Working Door into an existing Area
 
| This Script serves to add a custom Door into a existing Area, that the Player can enter into a custom Area.
 
|-
 
| 7. Adding a Quest to an existing Chanters Board
 
| This Script serves to add a new Quest to a existing Chanters Board, at any chosen time into the Game.
 
|-
 
| 8. ...
 
| ...
 
|}
 
  
 
+
== Размещение предмета на локации ==
== Adding a placeable into an existing Area ==
+
  
 
'''M2DA Setup:'''
 
'''M2DA Setup:'''
Line 84: Line 63:
 
'''Note:''' This method prevents removal of the placable. Check out a Plot driven method.
 
'''Note:''' This method prevents removal of the placable. Check out a Plot driven method.
  
== Adding a NPC into an existing Area ==
+
== Размещение НПС на локации ==
  
 
'''M2DA Setup:'''
 
'''M2DA Setup:'''
Line 129: Line 108:
 
Export the script, the creature ,and start the game. When you arrive at the specific Area in game, the [[Creature]] (Monsters or NPCs alike) will be there.
 
Export the script, the creature ,and start the game. When you arrive at the specific Area in game, the [[Creature]] (Monsters or NPCs alike) will be there.
  
== Activating a Waypoint on the Worldmap ==
+
== Активация локации на карте мира ==
  
 
'''Requirements:''' Your module must extend Single Player.  
 
'''Requirements:''' Your module must extend Single Player.  
Line 162: Line 141:
 
This "should" work for any plot. Actually, waypoints 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 gamebreaking Plot conflicts if able to leave Lothering too early.
 
This "should" work for any plot. Actually, waypoints 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 gamebreaking Plot conflicts if able to leave Lothering too early.
  
== Adding an Item into the Players Inventory ==
+
== Добавление вещей в инвентарь ==
  
 
'''Requirements:'''
 
'''Requirements:'''

Revision as of 06:15, 4 June 2012

Шаблоны скриптов PRCSCR
Начало / Русская DA Builder Wiki / Поделиться ВКонтакте

На этой странице собираются скрипты, готовые к использованию в системе PRCSCR в сочетании с M2DA-файлом PRCSCR.

Ссылки:


Содержание:

- Размещение предмета на локации - Этот скрипт позволяет разместить предмет на загружаемой локации.
- Размещение НПС на локации - Этот скрипт позволяет разместить НПС на загружаемой локации.
- Активация локации на карте мира - Этот скрипт позволяет активировать иконку локации на карте мира.
- Добавление вещей в инвентарь - Этот скрипт позволяет добавить любую вещь в инвентарь игрока.
- Добавление вещей торговцу или в контейнер - Этот скрипт позволяет добавлять предметы существующим на локации торговцам или в контейнеры.
- Adding a Working Door into an existing Area - This Script serves to add a custom Door into a existing Area, that the Player can enter into a custom Area.
- Adding a Quest to an existing Chanters Board - This Script serves to add a new Quest to a existing Chanters Board, at any chosen time into the Game.


Размещение предмета на локации

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. (only 1 number, the first)
  6. Rotation needs to be recalculated before entering it into the script. For positive angles do (180-angle). For negative angles do (-180-(-angle)).

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

Note: This method prevents removal of the placable. Check out a Plot driven method.

Размещение НПС на локации

M2DA Setup:

  1. AreaListName must be "any". This Script is Plot driven.
  2. Copy the GDA into your modules override folder.

Script:

// this is the name of a precreated plot file "joblos_quest" prefixed with the special "plt_"
// "plt_" + quest name allows you to reference the flag names as constants.
#include "plt_joblos_quest" 
#include "wrappers_h"
 
void main()
{
    //Check whether we've added Joblo already.
    if (WR_GetPlotFlag(PLT_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,
            R"joblo.utc",
            Location(oTown, vJobloLocation, 180.0f) //See below for how to get the value for orientation
        ); //this semicolom was missing and caused errors 
 
        WR_SetPlotFlag("joblos_quest", JOBLO_ADDED_TO_TOWN, TRUE);
    }
}
  1. Replace "joblos_quest" (3x) with the name of your Plot.
  2. Replace "JOBLO_ADDED_TO_TOWN" (2x) with a custom Flag you create in your Plot.
  3. Replace "lot100ar_lothering" with the Tag of an Area ,the NPC should spawn in.
  4. Replace "joblo.utc" with the filename of your Creature.
  5. Exchange the (4) numbers ,which should be the location of your placable. How to determine?
  6. Create a temporary duplicate of the specific Area, and add the NPC until you see fit. (delete this Area afterwards, do not export)
  7. Note down the numbers in the Object Inspector, and get the first 3 numbers of Position, and the 4rth Number from Rotation. (only 1 number, the first)
  8. Rotation needs to be recalculated before entering it into the script. For positive angles do (180-angle). For negative angles do (-180-(-angle)).

Export the script, the creature ,and start the game. When you arrive at the specific Area in game, the Creature (Monsters or NPCs alike) will be there.

Активация локации на карте мира

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. Map Pin information can be found at: Map.

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. Choose 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 the name of that other 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. Actually, waypoints 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 gamebreaking Plot conflicts if able to leave Lothering too early.

Добавление вещей в инвентарь

Requirements:

M2DA Setup:

  1. AreaListName is "any".
  2. Copy the GDA into your modules override folder.

Script:

//include utility_h for the UT_AddItemToInventory() function.
#include "utility_h"
//include the custom made plot file
#include "plt_$plot_file_name$"
 
void main()
{
    // If plot flag is TRUE then item already given.
    // Otherwise add item to inventory.
    if ( WR_GetPlotFlag( PLT_$plot_file_name$, $check_flag_name$ ) == FALSE )
    {
        UT_AddItemToInventory(R"$item_file_name$.uti");
        //Set the plot flag to TRUE to indicate that the item was given.
        WR_SetPlotFlag( PLT_$plot_file_name$, $check_flag_name$, TRUE );
    }
}
  1. Replace everything between and including the $ signs with appropriate names (without the file extensions).

Adding an Item to an existing Vendor or Container

Requirements:

M2DA Setup:

Campaign Container ContainerTag AreaListName
Origins Bodahn store_camp_bodahn cam100ar_camp_plains
Origins daytime King's Camp quartermaster pre100sr_quartermaster pre01al_kings_camp
Awakening Yuriah store_vgk100cr_merchant vgk210ar_throne_room
Awakening Party Chest in Vigil's Keep vgk210ip_party_chest vgk210ar_throne_room
Leliana's Song first Lem encounter store_lel00cr_lem lel100ar_market
  1. Create a PRCSCR M2DA override using the desired AreaListName from the above table
  2. Copy this new PRCSCR M2DA into your module's override folder (AddIns\{YourMod}\core\override)

Script:

#include "wrappers_h"
#include "plt_$plot_file_name$"  // include your custom plot
 
void main()
{
  if ( WR_GetPlotFlag( PLT_$plot_file_name$, $check_flag_name$ ) == TRUE ) return;
 
  object oContainer = GetObjectByTag($ContainerTag$);
 
  if (IsObjectValid(oContainer))
  {
    CreateItemOnObject(R"$resource_name$.uti", oContainer, 1, "", TRUE); // repeat this for each item
 
    WR_SetPlotFlag( PLT_$plot_file_name$, $check_flag_name$, TRUE );
  }
}
  1. Replace "$plot_file_name$" and "$check_flag_name$" with the custom plot and plot flags you create for your module.
  2. Replace "$resource_name$" with the resource name of your custom item.
  3. Replace "$ContainerTag$" with the desired container tag from the table in the M2DA setup section.
  4. The very first time you go to the party camp in Origins (after leaving Lothering) and view the Archdemon cutscene, this script will NOT run when using "cam100ar_camp_plains" as the AreaListName. This is because the cutscene version of the camp is actually a different area. In this case you must exit and return to the "normal" (non-cutscene) party camp for the script to run for the first time.

Adding a Working Door into an existing Area

Requirements:

M2DA Setup:

Script: [Undocumented]

Adding a Quest to an existing Chanters Board

Requirements:

M2DA Setup:

Script: [Undocumented]


Язык: English  • русский