Pocket Plane Group

BG1 Completed Mods => BG1 Unfinished Business => Topic started by: plainab on February 03, 2012, 01:38:31 PM

Title: Offering new component for UB
Post by: plainab on February 03, 2012, 01:38:31 PM
Miloch doesn't want this in the fixpack.

it fixes the exploit of being able to turn in Prism's emeralds one at a time by making them unique items
it provides new options to obtain the emeralds.
it provides split rewards if the player is only able to obtain one of the emeralds.

it's designed to reverse the changes made by the fixpacks inadequate non-tweak fix by overwriting Oublek's dialog file with the original so this component would need be installed prior to any other mods which affect Oublek's dialog file.

to add into UB uncomment and modified the opening component type lines (i.e. BEGIN, REQUIRE_COMPONENT & INCLUDE)  you can drop the fixpack's print statement for processing the specific tph file

Note: This was coded several years ago, at the time I used WAPT.tph which was based off of Qwinn's area patching tools and modified by myself and Ardanis.  if there is something better to use these days, feel free tho you'll need to determine what changes are made....

the patch code:
Code: [Select]
//ISSUES-OublekEmeraldBountyExploitTWEAK.tph
PRINT ~Processing ISSUES-OublekEmeraldBountyExploitTWEAK.tph~
// ----------------------------------------------------------------------------
//BEGIN @7 //~Optional: Oublek & Prism - No Exploit & Multiple Ways to Solve Quest~
//REQUIRE_COMPONENT ~Setup-BGFixPack.tp2~ ~0~ @3 //~SKIPPING Required Component not installed~
//INCLUDE ~bgfixpack\tph\wapt.tph~ //definitions for the various Weidu Area Patching Tool macros and functions
LAUNCH_ACTION_FUNCTION ~wapt_add_container~
INT_VAR //integer variables
wapt_num_new_Conta = 2
//data for container 1
wapt_use_point_x_1 = 641 wapt_use_point_y_1 = 2713 wapt_type_1 = 6 wapt_lock_diff_1 = 30 wapt_flags_1 = 0b00000001 wapt_trap_detect_diff_1 = 100 wapt_trap_disarm_diff_1 = 100 wapt_trap_launch_x_1 = 641 wapt_trap_launch_y_1 = 2713 wapt_num_items_1 = 1 wapt_vertices_1 = 6
//data for container 2
wapt_use_point_x_2 = 641 wapt_use_point_y_2 = 2713 wapt_type_2 = 6 wapt_lock_diff_2 = 70 wapt_flags_2 = 0b00000001 wapt_trap_detect_diff_2 = 100 wapt_trap_disarm_diff_2 = 100 wapt_trap_launch_x_2 = 641 wapt_trap_launch_y_2 = 2713 wapt_num_items_2 = 1 wapt_vertices_2 = 6
//Vertex points for container 1:
wapt_vx_1 = 564 wapt_vy_1 = 2559 wapt_vx_2 = 578 wapt_vy_2 = 2552 wapt_vx_3 = 590 wapt_vy_3 = 2556 wapt_vx_4 = 586 wapt_vy_4 = 2561 wapt_vx_5 = 580 wapt_vy_5 = 2563 wapt_vx_6 = 570 wapt_vy_6 = 2562
//Vertex points for container 2:
wapt_vx_7 = 638 wapt_vy_7 = 2544 wapt_vx_8 = 635 wapt_vy_8 = 2550 wapt_vx_9 = 627 wapt_vy_9 = 2554 wapt_vx_10 = 614 wapt_vy_10 = 2555 wapt_vx_11 = 626 wapt_vy_11 = 2543 wapt_vx_12 = 635 wapt_vy_12 = 2541
STR_VAR //string variables
wapt_area = ~ar5400~ wapt_object_name_1 = ~A6StatueRightEye~ wapt_object_name_2 = ~A6StatueLeftEye~
END //end launch command
//create left eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeL.itm~
 SAY UNIDENTIFIED_DESC ~An Emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An Emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//create right eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeR.itm~
 SAY UNIDENTIFIED_DESC ~An Emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An Emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//change the emeralds that prism carries
COPY_EXISTING ~prism.cre~ ~override~
 REMOVE_CRE_ITEM ~misc43~
 REPLACE_CRE_ITEM ~abgfEyeL~ #1 #0 #0 ~identified~ ~qitem1~
 REPLACE_CRE_ITEM ~abgfEyeR~ #1 #0 #0 ~identified~ ~qitem2~
BUT_ONLY_IF_IT_CHANGES
//compile the dialog changes to oublek and prism
COPY ~bgfixpack/files/oublek/oublek.dlg~ ~override~ //replace earlier 'fixed' file with original cause it is easier than trying to undo the changes made to all versions
COMPILE ~bgfixpack/files/oublek/oublek.d~
//check existance of area script and add rep penalty for taking gems from statue
COPY_EXISTING ~ar5400.are~ ~override~
 LAUNCH_PATCH_MACRO ~wapt_header_initvars~
 INNER_ACTION BEGIN
  EXTEND_BOTTOM ~%wapt_h_AreBS%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
 END
BUT_ONLY_IF_IT_CHANGES
//check existance of area script and add global sets to complete quest
COPY_EXISTING ~ar4800.are~ ~override~
 LAUNCH_PATCH_MACRO ~wapt_header_initvars~
 INNER_ACTION BEGIN
  EXTEND_BOTTOM ~%wapt_h_AreBS%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
 END
BUT_ONLY_IF_IT_CHANGES

the required macro/function code:
Code: [Select]
//////////////////////////////////////////////

// Note by Ardanis:
// As you can tell by the prefix, it originally was a Qwinn's macro. I compressed it
// into a more accessible format. A fair example of how to make a good use of arrays.

// Bigg, Weidu's readme says it needs a real example of array usage. Does this pass for one?

DEFINE_PATCH_MACRO ~wapt_Q_ARE_InitVars~ BEGIN

PATCH_IF (GAME_IS ~pst~)                     BEGIN Q_Game=1 END
PATCH_IF (GAME_IS ~bg2 tob tutu tutu_totsc~) BEGIN Q_Game=2 END
PATCH_IF (GAME_IS ~bg1 totsc iwd how~)       BEGIN Q_Game=3 END

DEFINE_ARRAY object BEGIN Actor Trigg Spawn Entra Conta Items Ambie Varia Doors Tiled Vertx Explo Anima Songs RestS MapNo ProTr END
DEFINE_ARRAY Siz    BEGIN 0x110 0xc4  0xc8  0x68  0xc0  0x14  0xd4  0x54  0xc8  0x6c  0x4   0x0   0x4c  0x90  0xe4  0x34  0x1A  END
DEFINE_ARRAY OoN    BEGIN 0x58  0x5a  0x64  0x6c  0x74  0x76  0x82  0x8c  0xa4  0xb4  0x80  0x0   0xac  0x0   0x0   0xc8  0xd0  END
DEFINE_ARRAY OoO    BEGIN 0x54  0x5c  0x60  0x68  0x70  0x78  0x84  0x88  0xa8  0xb8  0x7c  0xa0  0xb0  0xbc  0xc0  0xc4  0xcc  END
DEFINE_ARRAY SoL    BEGIN 2     2     4     4     2     2     2     4     4     4     2     0     4     0     0     4     4     END

FOR (i=0;i<17;i+=1) BEGIN
  SET $Q_Siz($object("%i%"))=$Siz("%i%")     // size of object's section
  SET $Q_OoN($object("%i%"))=$OoN("%i%")     // offset of number of objects
  SET $Q_OoO($object("%i%"))=$OoO("%i%")     // offset of offset of objects
  SET $Q_SoL($object("%i%"))=$SoL("%i%")     // SHORT or LONG offset of number of objects
  PATCH_IF i=15 & Q_Game=1 BEGIN                                 // PST uses different values
    Q_OoN_MapNo=0xcc Q_OoO_MapNo=0xc8 END
  PATCH_IF $SoL("%i%")=2 BEGIN               // number of objects
    READ_SHORT $Q_OoN($object("%i%")) $Q_Num($object("%i%")) END // if SoL = 2 = SHORT, then READ_SHORT
  PATCH_IF $SoL("%i%")=4 & ( i!=16 | Q_Game=2) BEGIN             // non-BG2 games can't have projectiles
    READ_LONG  $Q_OoN($object("%i%")) $Q_Num($object("%i%")) END // if SoL = 4 = LONG, then READ_LONG
  PATCH_IF $SoL("%i%")=0 BEGIN                                   // if SoL = 0 = not needed, don't READ, instead
    SET $Q_Num($object("%i%"))=1 END                             //   SET it to 1, as this can't be any other
  PATCH_IF i!=16 | Q_Game=2 BEGIN            // offset of objects
    READ_LONG  $Q_OoO($object("%i%")) $Q_Off($object("%i%")) END // offsets' READs always LONG
END

PATCH_IF Q_Game!=2 BEGIN                                         // if it's non-BG2 then set everything
  Q_OoN_ProTr=0 Q_OoO_ProTr=0 Q_Num_ProTr=0 Q_Off_ProTr=0 END    // related to projectiles to zero

END

/////////////////////////////////////////////////

// Note by Ardanis:
// Again, Qwinn's stuff that was revamped.

DEFINE_PATCH_MACRO ~wapt_Q_AREAdd_InitVars~ BEGIN
FOR (i=0;i<17;i+=1) BEGIN
  SET $Q_New($object("%i%"))=0        // number of new objects
  SET $Q_NewOffset($object("%i%"))=0  // writing offset for new objects
END
Q_ManualInsert=0  // unnecessary, but may be required for RESHAPE_AREA_POLYGON, should it be added later (unlikely)
END

//////////////////////////////////////////

// Note by Ardanis:
// Unlike the other two Qwinn's macros, this one is almost untouched, except of adding the 'wapt_' prefix to
// it's name and correcting the name of the macro LAUNCHed at the very end, which now has that prefix as well

DEFINE_PATCH_MACRO ~wapt_Q_AREAdd_Process~
BEGIN

// DO NOT use this macro without first running Q_AREAdd_InitVars.
// Documentation for the use of this macro is contained within that macro definition.

PATCH_FOR_EACH "S1" IN
  ~Actor~ ~Trigg~ ~Spawn~ ~Entra~ ~Conta~ ~Items~ ~Ambie~ ~Varia~ ~Doors~
  ~Tiled~ ~Vertx~ ~Anima~ ~MapNo~ ~ProTr~
BEGIN
  SET "Q_NewSect" = $Q_New("%S1%") // How many new sections user has asked for
  PATCH_IF !("Q_NewSect" = 0) THEN
  BEGIN
// WRITE_ASCII 0x33c ~%S1%~ #32 // DEBUG
SET "Q_OoNSect" = $Q_OoN("%S1%") // Offset where count of each section is stored
SET "Q_NumSect" = $Q_Num("%S1%") // Original count for that section
SET "Q_SoLSect" = $Q_SoL("%S1%")  // Whether original count is stored as long or short
SET "Q_OoOSect1" = $Q_OoO("%S1%") // Offset of offset for the section
SET "Q_Offset1" = $Q_Off("%S1%") // Offset of the section being added to
SET "Q_SizSect" = $Q_Siz("%S1%") // The size of one new section
PATCH_FOR_EACH "S2" IN
  ~Actor~ ~Trigg~ ~Spawn~ ~Entra~ ~Conta~ ~Items~ ~Ambie~ ~Varia~ ~Doors~
  ~Tiled~ ~Vertx~ ~Explo~ ~Anima~ ~Songs~ ~RestS~ ~MapNo~ ~ProTr~
BEGIN
  // WRITE_ASCII 0x33c ~%S1% %S2%~ #32 // DEBUG
  SET "Q_Offset2" = $Q_Off("%S2%") // Offset of each other section
  SET "Q_OoOSect2" = $Q_OoO("%S2%") // Offset of that offset
  SET "Q_OldInsert" = $Q_NewOffset("%S2%") // Previous insert offsets need to be updated too

  PATCH_IF ("Q_Offset2" >= "Q_Offset1") AND NOT ("%S1%" STRING_EQUAL "%S2%") THEN
  BEGIN
WRITE_LONG "Q_OoOSect2" ("Q_Offset2" + ("Q_NewSect" * "Q_SizSect"))
  END
  PATCH_IF ("Q_OldInsert" >= "Q_Offset1") AND NOT ("%S1%" STRING_EQUAL "%S2%") THEN
  BEGIN
SET $Q_NewOffset("%S2%") = $Q_NewOffset("%S2%") + ("Q_NewSect" * "Q_SizSect")
  END
END
SET $Q_NewOffset("%S1%") = "Q_Offset1" + ("Q_NumSect" * "Q_SizSect")
SET "Q_InsertOffset" = $Q_NewOffset("%S1%")
PATCH_IF "Q_ManualInsert" = 0 THEN
BEGIN
  INSERT_BYTES "Q_InsertOffset" ("Q_NewSect" * "Q_SizSect")
END
        PATCH_IF "Q_SoLSect" = 2 THEN BEGIN WRITE_SHORT "Q_OoNSect" ("Q_NumSect" + "Q_NewSect") END
                                 ELSE BEGIN WRITE_LONG  "Q_OoNSect" ("Q_NumSect" + "Q_NewSect") END
LAUNCH_PATCH_MACRO ~wapt_Q_ARE_InitVars~  // Reset all our variables to their new values
  END
END

END

////////////////////////////////////////////////////
//////////////////////////////////////

// This macro does the following:
//   sets 'bbox' to 1, which is the starting value for all ADD_AREA_STUFF functions
//   calculates the total amount of new vertices
//   inserts new objects using Qwinn's algorithm
//   writes new vertices
//   sets 'vert_entry' - the starting index of newly added vertices

DEFINE_PATCH_MACRO wapt_inserter BEGIN
  bbox=1 // vertex index for bounding box calculation
  vert=0                               //calculating the number of new
  FOR (i=1;i<wapt_object+1;i+=1) BEGIN //vertices, to save modder the
    vert+= $wapt_vertices("%i%")       //trouble of doing it manually
  END
  LAUNCH_PATCH_MACRO ~wapt_Q_ARE_InitVars~    //launch variable initiation macro
  LAUNCH_PATCH_MACRO ~wapt_Q_AREAdd_InitVars~ //launch variable initiation macro for adding new sections
  Q_New_Vertx = vert
  PATCH_FOR_EACH ob_type IN ~Conta~ ~Entra~ ~Trigg~ BEGIN         //which type of object we're adding
    PATCH_IF ~%wapt_ob_type%~ STRING_EQUAL_CASE ~%ob_type%~ BEGIN //wapt_ob_type is preset by STR_VAR
      SET $Q_New("%ob_type%") = wapt_object
    END ELSE BEGIN
      SET $Q_New("%ob_type%") = 0
    END
    PATCH_IF (~%ob_type%~ STRING_EQUAL_CASE ~Conta~) AND (VARIABLE_IS_SET wapt_num_new_Items ) BEGIN  //if user is adding items to new containers
     Q_New_Items = %wapt_item%                                                                        //update variable to get proper space installed
     wapt_idx_items = %Q_Num_Items%                                                                   //assign index value for item(s) in first container
    END
  END
  LAUNCH_PATCH_MACRO ~wapt_Q_AREAdd_Process~  //launch macro that adds new space for above listed entries
  vert_entry = Q_Num_Vertx - Q_New_Vertx      //starting index for new vertices, used by the main FUNCTION
  FOR (i=1;i<vert+1;i+=1) BEGIN                             //
    WRITE_SHORT (Q_NewOffset_Vertx+i*4 - 4) $wapt_vx("%i%") //writing new vertices
    WRITE_SHORT (Q_NewOffset_Vertx+i*4 - 2) $wapt_vy("%i%") //
  END
END

/////////////////////////////////////

// This macro does the following:
//   sets 'new_loc' - the starting offset for writing down the new object
//   writes the object's name, which is 32 char long
//   calculates and writes the bounding box for the object

DEFINE_PATCH_MACRO wapt_routine BEGIN // vars used for bbox math: a b c c1 c2 bbox_off
  new_loc = $Q_NewOffset("%wapt_ob_type%") + (i - 1)*$Q_Siz("%wapt_ob_type%") // from where we'll do writing
  WRITE_EVALUATED_ASCII new_loc $wapt_object_name("%i%") (32)                 // object's name
  bbox_off=new_loc+wapt_bbox                                 //offset for this object's bbox, wapt_bbox is preset by INT_VAR
  FOR (a=0;a<4;a+=1) BEGIN                                   //0=X_low - left, 1=Y_low - down, 2=X_high - right, 3=Y_high - top
    PATCH_IF a=0 OR a=2 BEGIN SPRINT xy ~wapt_vx_~ END ELSE BEGIN SPRINT xy ~wapt_vy_~ END //X or Y coordinate of the vertex
    c=bbox                                                   //we assume that the extreme vertex is the 1st one of the object
    c1=EVALUATE_BUFFER ~%%xy%%c%%~                           //coord_value_1=(X/Y)_%vert_index%, coord of object's the 1st vertex
    FOR (b=bbox+1;b<$wapt_vertices("%i%")+bbox;b+=1) BEGIN   //start with 2nd vertex of the object, finish with the last
      c2=EVALUATE_BUFFER ~%%xy%%b%%~                         //coord_value_2=(X/Y)_%counter%, other vertices of the object
      PATCH_IF (a<2&c2<c1)|(a>1&c2>c1) BEGIN //compare the 1st vertex's value with that of the others, if some exceeds then...
        c=b                                  //...mark it as the new extreme and...
        c1=c2                                //...use it's value to check against the remaining
      END
      WRITE_SHORT (bbox_off+a*2) EVALUATE_BUFFER ~%%xy%%c%%~ //precisely the box's values for the object, writing that down
    END
  END
  bbox+=$wapt_vertices("%i%") // update the bbox index so it matches the 1st vertex of the next object
END // should ADD_DOOR (it has 3 polygons instead of 1) be introduced, this macro will have to be revamped

////////////////////////////////////////////////////
DEFINE_ACTION_FUNCTION wapt_add_container
  INT_VAR
    wapt_object=1
    wapt_item=0
    wapt_bbox=0x38
  STR_VAR
    wapt_ob_type= ~Conta~
  BEGIN
COPY_EXISTING ~%wapt_area%.are~ ~override~
  PATCH_IF (VARIABLE_IS_SET wapt_num_new_Conta) BEGIN   //if user choose to add more than one container -- uses a more user friendly variable name
   wapt_object = %wapt_num_new_Conta%
  END
  PATCH_IF (VARIABLE_IS_SET wapt_num_new_Items) BEGIN   //if user choose to add one or more items to a container -- uses a more user friendly variable name
   wapt_item = %wapt_num_new_Items%
  END
  LAUNCH_PATCH_MACRO wapt_inserter
  FOR (i=1;i<wapt_object+1;i+=1) BEGIN
    LAUNCH_PATCH_MACRO wapt_routine
DEFINE_ARRAY field BEGIN use_point_x use_point_y type lock_diff flags trap_detect_diff trap_disarm_diff trap_trapped trap_detected trap_launch_x trap_launch_y script key_item string vertices END
DEFINE_ARRAY Off   BEGIN 0x20        0x22        0x24 0x26      0x28  0x2c             0x2e             0x30         0x32          0x34          0x36          0x48   0x78     0x84   0x54     END
DEFINE_ARRAY SoL   BEGIN 2           2           2    2         4     2                2                2            2             2             2             8      8        4      4        END
    FOR(i2=0;i2<15;i2+=1)BEGIN
     PATCH_IF ($SoL("%i2%")=2) AND (VARIABLE_IS_SET $wapt($field("%i2%")"%i%") ) BEGIN
      WRITE_SHORT (%new_loc%+ $Off("%i2%")) $wapt($field("%i2%")"%i%")
     END
     PATCH_IF ($SoL("%i2%")=4) AND (VARIABLE_IS_SET $wapt($field("%i2%")"%i%") ) BEGIN
      WRITE_LONG (%new_loc%+ $Off("%i2%")) $wapt($field("%i2%")"%i%")
     END
     PATCH_IF ($SoL("%i2%")=8) AND (VARIABLE_IS_SET $wapt($field("%i2%")"%i%") ) BEGIN
      WRITE_ASCIIE (%new_loc%+ $Off("%i2%")) $wapt($field("%i2%")"%i%") (8)
     END
    END
    PATCH_IF (%wapt_item% >0) BEGIN
     WRITE_LONG (new_loc+0x40) %wapt_idx_items%                 // index value for first new item in current container
     WRITE_LONG (new_loc+0x44) $wapt_num_items("%i%")           // won't write for some reason within the array system
     wapt_idx_items += $wapt_num_items("%i%")                   // update item index for the next container
    END
    WRITE_LONG (new_loc + 0x50)  vert_entry                    // vertex index
    vert_entry += $wapt_vertices("%i%")                        // update vertex index for the next object
  END
DEFINE_ARRAY ifield BEGIN itm_name exp_time qc1 qc2 qc3 itm_flags END
DEFINE_ARRAY i_off  BEGIN 0x0      0x8      0xa 0xc 0xe 0x10      END
DEFINE_ARRAY i_sol  BEGIN 8        2        2   2   2   4         END
  FOR (i4=1;i4<%wapt_item%+1;i4+=1)BEGIN
    FOR(i3=0;i3<6;i3+=1)BEGIN
     PATCH_IF ($i_sol("%i3%")=8) AND (VARIABLE_IS_SET $wapt($ifield("%i3%")"%i4%") ) BEGIN
      WRITE_ASCIIE (%Q_NewOffset_Items% + (%Q_Siz_Items% * (%i4%-1))) $wapt($ifield("%i3%")"%i4%") (8)
     END
     PATCH_IF ($i_sol("%i3%")=4) AND (VARIABLE_IS_SET $wapt($ifield("%i3%")"%i4%") ) BEGIN
      WRITE_LONG (%Q_NewOffset_Items% + (%Q_Siz_Items% * (%i4%-1))) $wapt($ifield("%i3%")"%i4%")
     END
     PATCH_IF ($i_sol("%i3%")=2) AND (VARIABLE_IS_SET $wapt($ifield("%i3%")"%i4%") ) BEGIN
      WRITE_SHORT (%Q_NewOffset_Items% + (%Q_Siz_Items% * (%i4%-1))) $wapt($ifield("%i3%")"%i4%")
     END
    END
  END
BUT_ONLY_IF_IT_CHANGES
END

//////////////////////////////////////
DEFINE_PATCH_MACRO ~wapt_header_initvars~ BEGIN
 PATCH_IF (GAME_IS ~pst~)                     BEGIN Q_Game=1 END
 PATCH_IF (GAME_IS ~bg2 tob tutu tutu_totsc~) BEGIN Q_Game=2 END
 PATCH_IF (GAME_IS ~bg1 totsc iwd how~)       BEGIN Q_Game=3 END
 DEFINE_ARRAY Entry BEGIN Signa WedFi LSave AFlag North East South West AType RainP SnowP FogPr LiteP AreBS RMDay RMNit END
 DEFINE_ARRAY OoEnt BEGIN 0x0   0x8   0x10  0x14  0x18  0x24 0x30  0x3c 0x48  0x4a  0x4c  0x4e  0x50  0x94  0xd4  0xdc  END
 DEFINE_ARRAY SoEnt BEGIN 8     8     4     4     8     8    8     8    2     2     2     2     2     8     8     8     END
 FOR(i=0;i<16;i+=1)BEGIN
  PATCH_IF ($SoEnt("%i%")=8) BEGIN
   READ_ASCII $OoEnt("%i%") $wapt_h($Entry("%i%"))
  END
  PATCH_IF ($SoEnt("%i%")=4) BEGIN
   READ_LONG $OoEnt("%i%") $wapt_h($Entry("%i%"))
  END
  PATCH_IF ($SoEnt("%i%")=2) BEGIN
   READ_SHORT $OoEnt("%i%") $wapt_h($Entry("%i%"))
  END
 END
END
Title: Re: Offering new component for UB
Post by: Salk on February 04, 2012, 12:50:26 AM
This is great stuff!

I remembered suggesting it to Ascension64 quite some many years ago and here it is in full shine!  ;)

I sincerely hope it will find a home here at BG1 UB because it truly deserves it.
Title: Re: Offering new component for UB
Post by: Miloch on February 05, 2012, 08:21:23 AM
Ascension64 actually did code it (the container-adding bit anyway) originally. I'm guessing plainab recoded that. The fj_are_structure (http://weidu.org/~thebigg/README-WeiDU.html#htoc49) function is the preferred way to add things like containers nowadays. As you can see if you scroll down a bit, it's fairly simple to use (example from the WeiDU doc).
Code: [Select]
  LPF fj_are_structure
    INT_VAR
    fj_type        = 8 //nonvisible
    fj_loc_x       = 4388
    fj_loc_y       = 2876
    fj_box_left    = 4372
    fj_box_top     = 2826
    fj_box_right   = 4420
    fj_box_bottom  = 2858
    fj_trap_loc_x  = 4380
    fj_trap_loc_y  = 2870
    fj_vertex_0    = 4411 + (2858 << 16)
    fj_vertex_1    = 4372 + (2845 << 16)
    fj_vertex_2    = 4382 + (2826 << 16)
    fj_vertex_3    = 4420 + (2839 << 16)
    STR_VAR
    fj_structure_type = container
    fj_name           = ~Cornerstone~
  END
"Emerald" should be lowercase in the description (unless it's at the beginning of a sentence).
Title: Re: Offering new component for UB
Post by: jastey on February 07, 2012, 07:29:17 AM
The code kind fo scares me off - I'll have to look at this with more time at hand.
Title: Re: Offering new component for UB
Post by: plainab on February 07, 2012, 10:07:27 AM
The code kind fo scares me off - I'll have to look at this with more time at hand.
if i can figure out the thing built into weidu now, it'll reduce the code i'm sure.

i have a lot of stuff in the fixpack that's like this.... so i have to learn how to modify it all anyway....
Title: Re: Offering new component for UB
Post by: jastey on February 07, 2012, 11:36:07 AM
Great. Let me know then.  ;D  ;)
Title: Re: Offering new component for UB
Post by: plainab on February 07, 2012, 12:19:37 PM
ok... think i got the built in function figured out...  AND it installs without giving errors...  could use in game testing to be sure everything works
also didn't include all the necessary files earlier

modified tph/tp2 code:
Code: [Select]
// ----------------------------------------------------------------------------
//BEGIN @7 //~Optional: Oublek & Prism - No Exploit & Multiple Ways to Solve Quest~
//first container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 30
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 564
        fj_box_top = 2552
        fj_box_right = 590
        fj_box_bottom = 2563
        fj_vertex_0 = (564 + (2559 << 16))
        fj_vertex_1 = (578 + (2552 << 16))
        fj_vertex_2 = (590 + (2556 << 16))
        fj_vertex_3 = (586 + (2561 << 16))
        fj_vertex_4 = (580 + (2563 << 16))
        fj_vertex_5 = (570 + (2562 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueRightEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END

//second container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 70
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 614
        fj_box_top = 2541
        fj_box_right = 638
        fj_box_bottom = 2555
        fj_vertex_0 = (638 + (2544 << 16))
        fj_vertex_1 = (635 + (2550 << 16))
        fj_vertex_2 = (627 + (2554 << 16))
        fj_vertex_3 = (614 + (2555 << 16))
        fj_vertex_4 = (626 + (2543 << 16))
        fj_vertex_5 = (635 + (2541 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueLeftEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END

//create left eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeL.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES

//create right eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeR.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES

//change the emeralds that prism carries
COPY_EXISTING ~prism.cre~ ~override~
 REMOVE_CRE_ITEM ~misc43~
 REPLACE_CRE_ITEM ~abgfEyeL~ #1 #0 #0 ~identified~ ~qitem1~
 REPLACE_CRE_ITEM ~abgfEyeR~ #1 #0 #0 ~identified~ ~qitem2~
BUT_ONLY_IF_IT_CHANGES

//compile the dialog changes to oublek and prism
COMPILE ~bgfixpack/files/oublek/oublek.d~

//check existance of area script and add rep penalty for taking gems from statue
COPY_EXISTING ~ar5400.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES

//check existance of area script and add global sets to complete quest
COPY_EXISTING ~ar4800.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES
Dialog changes
Code: [Select]
//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")~
ALTER_TRANS oublek BEGIN 4 END BEGIN 0 END BEGIN
 ACTION ~AddexperienceParty(200)
GivePartyGold(300)
TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
SetGlobal("OublekBounty2","GLOBAL",1)~
END

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_RightEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)~
REPLACE_TRANS_ACTION ~PRISM~ BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL")
DestroyItem("abgfEyeR")
ActionOverride("A6StatueRightEye",CreateItem("abgfEyeL",1,0,0))
ActionOverride("A6StatueLeftEye",CreateItem("abgfEyeR",1,0,0))
SetGlobal("abgf_GemInEyeL","GLOBAL",1)
SetGlobal("abgf_GemInEyeR","GLOBAL",1)~ //1 means they are in the container and penalties for taking them out of 'statue' apply
REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF")
GiveItem("abgfEyeR","GREYWOLF")
SetGlobal("abgf_GemInEyeL","GLOBAL",2)
SetGlobal("abgf_GemInEyeR","GLOBAL",2)~ //anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.
APPEND prism
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStole
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
CreateCreature("GREYWO",[1267.2579],0)
ClearAllActions()
StartCutSceneMode()
StartCutScene("Prismcut")~ EXIT
END
IF ~NumTimesTalkedTo(0)
HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStoleButGone
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
END
END//end the append
Script changes
ar5400
Code: [Select]
IF
PartyHasItem("abgfEyeL")
Global("abgf_GemInEyeL","GLOBAL",1)
THEN
RESPONSE #100
  SetGlobal("abgf_GemInEyeL","GLOBAL",2)
  ReputationInc(-1)
  AddJournalEntry(~Perhaps it was wrong, but we took the emerald from the left eye of the late Prism's final masterpiece. It should bring a hefty price at the right place or a decent reward...~)
END

IF
PartyHasItem("abgfEyeR")
Global("abgf_GemInEyeR","GLOBAL",1)
THEN
RESPONSE #100
  SetGlobal("abgf_GemInEyeR","GLOBAL",2)
  ReputationInc(-1)
  AddJournalEntry(~Perhaps it was wrong, but we took the emerald from the right eye of the late Prism's final masterpiece. It should bring a hefty price at the right place or a decent reward...~)
END
ar4800
Code: [Select]
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Prism's story was a sad tale indeed.  A shame it could not have had a better ending.  Ah well, I profit in the end.  300 gold bounty for the emeralds he stole.~)
END

that should be everything (I hope)
empty containers made,
2 unique items made,
adjustments to Oublek to recognize the 2 items. can turn in just one and get half the reward (if you claimed to be greywolf in the beginning and turn in just one, well you may be screwed on turning in the 2nd)
adjustment to Prism to have him transfer the gems to the statue if you let him finish, he responds if you talk to him after stealing the gems from him
script blocks to add journal entry and rep reduction for taking the gems out of the statue after having let Prism finish.
script block in nashkel area to add journal entry once both emeralds have been turned in.
AND fixpack was adjusted to only prevent the exploit despite how many of the original item the player has so... no need to revert/replace the oublek.dlg file

EDIT: one state for changing the original single item to the unique 2 items was missed.  proper code added above into the dialog change file
Title: Re: Offering new component for UB
Post by: jastey on February 13, 2012, 01:33:53 AM
Great, thanks! Would this code work for Tutu and BGT, too? Because BG1UB requires compatibility with all platforms.
Title: Re: Offering new component for UB
Post by: plainab on February 13, 2012, 10:33:16 AM
Great, thanks! Would this code work for Tutu and BGT, too? Because BG1UB requires compatibility with all platforms.
not in its current state no

the methods of making things compatible between the 3 set ups has always confused and eluded me plus I'm sure those methods have evolved since this was originally developed.

while i have some EasyTutu installs that I could perhaps work with, BGT is another story.  I'm not even sure if what I managed to get to go works or is even considered BGT.  Its all unclear to me, BGT, BWP, BWS, MegaMod.  SHS has it all kind of blending together.  *confusing*

so feel free to adapt it to other platforms
Title: Re: Offering new component for UB
Post by: Salk on February 13, 2012, 11:09:12 PM
I wish I could be of help with you in this, jastey but I simply can't.

This code in the present state is useless for BG1 UB because it is a mod that cover all three platforms (BG, (Easy)TuTu and BGT). Perhaps Miloch can lend a hand here.
Title: Re: Offering new component for UB
Post by: plainab on February 13, 2012, 11:57:07 PM
If someone can give an example on how to make a simple patch compatible with all the platforms...

and then provide the different file names needed for EasyTutu & BGT

I could probably adapt it  BUT someone else would have to test the install and functionality simply because the BG2 engine does things differently and those conversions could have had adjustments made which would/could affect things.

Game resource files used:
ar4800.bcs
ar5400.bcs
prism.dlg
oublek.dlg
ar4800.are
ar5400.are
prism.cre
misc43.itm (it's only copied not modified -- so if the BG2 version is present & identical then that could used)

Title: Re: Offering new component for UB
Post by: hook71 on February 14, 2012, 12:58:55 AM
I can test the BGT version of the component.

For BGT the files would be:
ar4800.bcs -> AR3700.BCS
ar5400.bcs -> AR4400.BCS
prism.dlg -> PRISM.DLG
oublek.dlg -> OUBLEK.DLG
ar4800.are -> AR3700.ARE
ar5400.are -> AR4400.ARE
prism.cre -> PRISM.CRE
misc43.itm -> MISC43.ITM (present and identical)

The header "Prism, the emerald thief." should be added to the journal entries for BGT. EraseJournalEntries() would need to be added/modified as Oublek hands out the rewards as well.

Looking at the OUBLEK.DLG file in Near Infinity I think BGT works like this currently:
BGT has a SetGlobal("OublekBounty2","GLOBAL",1) set when completing the mission. You only need to have one of the emeralds in your inventory for the reward in BGT but the quest can't be repeated due to the Global.
Title: Re: Offering new component for UB
Post by: Wisp on February 14, 2012, 04:32:40 AM
For Tutu the areas need an s/ar/fw/ substitution and the other resources need an underscore prepended. If the resref is already 8 characters long Tutu overwrites the first character with the underscore.

For BGT you need to look up the BGT area equivalents and make sure none of the other resources are renamed by BGT (none are, in this case).
Title: Re: Offering new component for UB
Post by: Miloch on February 14, 2012, 08:52:18 AM
The BG1, Tutu and BGT area equivalents are all in the IESDP (http://iesdp.gibberlings3.net/appendices/area_lists/bg1aref.htm). Just assign a variable to the area name and use that when you refer to it. UB already does this IIRC, though it uses some pretty long-winded variables for some areas (would be easier to reference if it just used the BG1 area source_res for the variable name or something).
Title: Re: Offering new component for UB
Post by: plainab on February 14, 2012, 10:13:32 AM
Quote
Looking at the OUBLEK.DLG file in Near Infinity I think BGT works like this currently:
BGT has a SetGlobal("OublekBounty2","GLOBAL",1) set when completing the mission. You only need to have one of the emeralds in your inventory for the reward in BGT but the quest can't be repeated due to the Global.
FYI the exploit may have been fixed in BGT.  Original file lacks a check for the global on the state(s) leading up to turning in the emerald, hence being able to get the reward multiple times.


thanks for the file name information...

The big thing needed tho is how one determines which platform is being installed upon.  Would GAME_IS suffice or is there a better method?

EDIT:  This seems to work for BG/BG:ToTSC
Code: [Select]
ACTION_IF (GAME_IS ~bgt~) THEN BEGIN
OUTER_SPRINT area0001 ~ar4400~
OUTER_SPRINT area0002 ~ar3700~
OUTER_SPRINT cre0001  ~prism~
OUTER_SPRINT item0001 ~misc43~
OUTER_SPRINT dia0001  ~oublek~
OUTER_SPRINT dia0002  ~prism~
END
ACTION_IF (GAME_IS ~tutu tutu_totsc~) THEN BEGIN
OUTER_SPRINT area0001 ~fw5400~
OUTER_SPRINT area0002 ~fw4800~
OUTER_SPRINT cre0001  ~_prism~
OUTER_SPRINT item0001 ~_misc43~
OUTER_SPRINT dia0001  ~_oublek~
OUTER_SPRINT dia0002  ~_prism~
END
ACTION_IF (GAME_IS ~bg1 totsc~) THEN BEGIN
OUTER_SPRINT area0001 ~ar5400~
OUTER_SPRINT area0002 ~ar4800~
OUTER_SPRINT cre0001  ~prism~
OUTER_SPRINT item0001 ~misc43~
OUTER_SPRINT dia0001  ~oublek~
OUTER_SPRINT dia0002  ~prism~
END
Title: Re: Offering new component for UB
Post by: plainab on February 14, 2012, 11:11:59 AM
Quote
The header "Prism, the emerald thief." should be added to the journal entries for BGT. EraseJournalEntries() would need to be added/modified as Oublek hands out the rewards as well.
more bg2 funkiness?  why?  that means a whole other file doesn't it?

no.  that's too far.  if it can't be done in BG/BG:ToTSC then its not going to be included by me.  that would have to be something added in by the UB team.
Title: Re: Offering new component for UB
Post by: Miloch on February 14, 2012, 11:18:28 AM
GAME_IS is fine for detecting platforms. It basically does an FILE_EXISTS_IN_GAME ~some_game-specific_area.are~.

You don't need to define variables for each CRE etc., just each area, and UB already has them defined in some library - might as well use those. The underscore (or lack of it) is something like %tutu_var% so %tutu_var%prism will work for all versions of Prism, and so on.

It wouldn't surprise me if Ascension64 fixed all the things he considered actual fixes, since he wrote the code for this originally, and at the time anyway, was providing fixes both ways (from BGT to the BG1 Fixpack and vice-versa).

BG2 (Tutu/BGT) uses labels for journal entries, and separate sections for solved, unsolved and so on. BG1 does not use labels and only has one section for journal entries regardless of their status. But jastey can probably figure that part out as she has a lot of experience there.
Title: Re: Offering new component for UB
Post by: jastey on February 14, 2012, 01:45:42 PM
Sorry, plainab, I know that BG1 is your game. I didn't mean to annoy you with Tutu/BGT compatibilty. I can cover game detection, the different area/script/whatever names, and also the journal entries for all installs.

What I was referring to was the compatibility of the actual area patching. I don't know how to do that and I know I won't in any near future, so that is what someone with experience in area-patching and BGT/Tutu (BGII engine) would be very welcome to provide for me, if it cannot be assuemd to be the same for BG1 and Tutu/BGT.
Title: Re: Offering new component for UB
Post by: plainab on February 14, 2012, 02:42:34 PM
Sorry, plainab, I know that BG1 is your game. I didn't mean to annoy you with Tutu/BGT compatibilty. I can cover game detection, the different area/script/whatever names, and also the journal entries for all installs.

What I was referring to was the compatibility of the actual area patching. I don't know how to do that and I know I won't in any near future, so that is what someone with experience in area-patching and BGT/Tutu (BGII engine) would be very welcome to provide for me, if it cannot be assuemd to be the same for BG1 and Tutu/BGT.
area structure between BG & BG2 is identical with the exception of map notes and those are tacked onto the end of the area file.  So unless the area itself has undergone major changes during the conversion process, simply changing the file name(s) as needed should work.
Title: Re: Offering new component for UB
Post by: jastey on February 14, 2012, 03:02:25 PM
Cool. I hope I will be able to make a package out of this the coming week.

plainab, in case you have an installable package of what you posted above, I would appreciate having it. Thank you for your work!
Title: Re: Offering new component for UB
Post by: jastey on February 19, 2012, 01:59:01 PM
plainab: I don't see why there should be a rep loss of two if the emeralds are taken out of the statue. I would like to stick to the original game where there is no rep loss. Where would it come from? Prism was a lunatic and thief (to the common people). Plus, he is dead at that time.

Also I am considering adding to Prism's dialogue a path for a LG character. All there is in the original game is "yes, I will let you use the stolen emeralds" or "I will let the bounty hunter kill you" or "I want to collect the bounty myself".
Title: Re: Offering new component for UB
Post by: jastey on February 19, 2012, 02:53:59 PM
Unfortunately, what I experienced before with CreateItem for containers is true here, too: In original BG1, the emeralds land on the floor, in front of the statue.

How would a possible solution without the CreateItem look like? Put gemeralds into the eyes of the statue from the start with a lock difficulty of 100% (so the player really cannot get to them since they aren't there yet, officially) and change the lock difficulty via script when Prism puts his gems "in"?
Title: Re: Offering new component for UB
Post by: Salk on February 19, 2012, 11:40:01 PM
As I replied at G3, I do believe the reputation loss makes sense but 1 might be enough.

Taking the emeralds off the statue's eyes is a rather callous action, considering that Prism was not really a lunatic but an artist that devoted his life to the creation of that statue. And this is especially true if the player sided with Prism, whose dying wish was to have his statue completed (and implicitly untouched).

I don't believe any additional dialogue choices are needed instead.
Title: Re: Offering new component for UB
Post by: jastey on February 20, 2012, 06:23:59 AM
(As I pointed out in the (hidden) thread at G3,) I don't see where the rep loss would come from. Reputation increases / losses in BG1 are gained from interaction with people, assuming they talk about it later. It's not a punishment for unmorale behaviour per se. Since Prism is dead ,there is no-one who witnesses and judges the situation. Considering the emeralds were stolen, the PC might rather gain a rep increase upon returning them.

You say that you don't see a need for additional reply options: Do you mean my suggestion to add a line for a LG character who wants to return the emeralds? I don't see how a LG character is to act correctly. Being LG, returning the stolen gems should be his highest interest. Currently, he has only the chance to get them by saying that he wants to collect the bounty, which is most probably not what a paladin would say.

I could even imagine more oprions in this: Tell Oublek where the stolen emeralds are so he can collect them himself (if Prism put them in the statue), OR offer to pay for them, so Prism has his peace (since he is dead after the first meeting, this way they could remain in the statue).
If there will be a rep loss for taking them out, there has to be another way of solving the quest.

Title: Re: Offering new component for UB
Post by: jastey on February 20, 2012, 06:42:27 AM
To the mentioned "CreateItem" problem for BG1: Ascension64 already coded a solution for containers that will be activated during the quest, albeit for BGT (BGII-engine). I have to see whether this could be used for BG1.

The gem handling and container setting as offered by plainab could be used for BGT/Tutu without changes.
Title: Re: Offering new component for UB
Post by: Salk on February 20, 2012, 06:59:28 AM
About reputation loss: Simding0 made the distinction between virtue and reputation in his own mod and it was a very good idea.

But we can not do that here. I think reputation covers also those actions that are morally significant, even if there are no witnesses. Proof is that a good aligned character killing an innocent is punished with reputation loss no matter whether or not there are witnesses to it, not even other party members. This is because the whole alignment system is not really built on how people judge you but on what moral tenets your character follows.

So reputation in vanilla has a dual meaning (internal and external) which Simding0 rightly separated in his own mod. But in the vanilla reputation system I think it is correct to believe that it should raise or lower according to how people judge you but also if your character follows or goes against his alignment.

What do other people think?
Title: Re: Offering new component for UB
Post by: jastey on February 20, 2012, 07:32:48 AM
The code from Ascension64 I mentioned earlier is for the BGII engine. Is there a way to enable/ change the lock difficulty in game for a container in BG1?  :'(

Salk: Yes, I guess we have to agree that our definition in this regard differs. So, other opinions would be welcome, most plainab's, of course.

Title: Re: Offering new component for UB
Post by: plainab on February 20, 2012, 08:10:09 AM
as far s the LG thing...
I don't think ALL quests should be geared to a specific alignment.  There are many quests that an LG can do that to be honest they shouldn't do.
Alignments should be considered an ideology, something they aspire to use as a guide. But allowing Human (and other Faerun races) nature mistakes can happen, one can falter in one's guidelines, sometimes a path taken forces choices that must be made that go against their beliefs.  It's called choosing the 'lesser of two evils' 
If you really want to add an LG version to the quest then I recommend it be part of a "all quests LG friendly" tweak rather than slipping it into here...   You can always write it to determine if this is present or not.

as far as the rep thing...
Salk explained it well.  You can't award/detract .5 rep points.  I was thinking about the fact that maybe the player would only open one container due to lock difficulty and so should get rep loss at each instance of opening containers.  Since player can turn in the gems individually, checking for both at once is not a viable option.  And since OR() does not work in BG/BG:ToTSC cannot include additional checks to see if player turned one in.  Only other option i can think of is a 'trap script' that assigns a global variable when each one is taken out.  when said variable has incremented properly then the master area script can do a single rep loss of 1 for both.

I suppose it also may be better to have individual journal entries for each container.  the first with less lock difficulty could say something about the gem not having been securely fastened due to Prism's haste and practically fell out.  no rep loss for that one since it 'fell out' and taking it to Oublek is the right thing to do.  the harder lock difficulty one could say something about how the player after lots of hard work finally yanked that sucker free, since that was purposeful damage then the rep loss occurs... 

as far as dialog text itself....
I wrote out a rough text to get the ideas across.  I'm not a good writer.  If there is something better to convey the meaning.  I'm ok with adjustments maintaining the spirit of the text.

as far as the container & items being created in it...
never knew of that problem.  my test party was too weak to take on Greywolf when i first tried it.  I got sidetracked by other things and have since adjusted and readjusted the fixpack thus requiring a brand new start.  If you can find something that works....

BUT
all that aside I took an idea and cobbled together stuff to get something sensible that would provide some additional ways of getting the gems (i.e. pickpocketing), to provide a way to turn in one gem at a time and get half reward, to do what Prism says and have the gems actually be in the eyes if you let him finish.  If there is a way that it can be improved upon and made better, so be it.  Just note that I can not in good faith resolve any issues affected by additional changes.


Title: Re: Offering new component for UB
Post by: jastey on February 20, 2012, 08:46:35 AM
I agree that RPG is about choosing the 'lesser of two evils' but I am not very happy if the reduced choice option are due to missing reply options. I think one additional reply option for LG wouldn't be out of place for this component, since the whole component is about tweaking the Prism encounter. It fits into BG1UB since the quest seems "unfinished" concerning Prisms saying that he put the gems into the statue which he doesn't. Everything else is tweaking (making the gems unique, letting Prism react to stealing, adding rep loss for taking them out) or fixing (making Oublek recognizing the gems separately thus disabling one possibility to get the reward two times.)

But I am babbling. You already more or less agreed to the possibility to add more dialogue. I will happily take this on, and hope that you will still like the outcome.

I am still very unhappy about the rep loss, though. Totally messes with my understanding of the rep system in BG(1).  :-[
Title: Re: Offering new component for UB
Post by: plainab on February 20, 2012, 08:58:22 AM
as far as the rep loss  A64 originally intended a rep loss of 3 since guarding Prism and letting him finish gives a rep increase of 1
I dropped that to 2. 1 rep loss per container.
as I suggested it could be reduced to 1 rep loss with one container having the lock difficulty reduced from 30 to say 10 or even 0 with a match journal entry to say that it fell out and so you'll return it for a reward.  but the 2 gem has to be worked at to get out and so a rep loss should incur.

cause if you get rep for letting him finish and then you take it out, you should get that rep taken away at the very least  AND other than party members no one is present to see you help prism other than him and he kills himself so he can't tell anyone about what the player did.


now corrected codes since i missed the container enabling disabling stuff
only providing affected files
tph code
Code: [Select]
//ISSUES-OublekEmeraldBountyExploitTWEAK.tph
PRINT ~Processing ISSUES-OublekEmeraldBountyExploitTWEAK.tph~
SILENT
// ----------------------------------------------------------------------------
//BEGIN @7 //~Optional: Oublek & Prism - No Exploit & Multiple Ways to Solve Quest~
//first container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 30
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00100001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 564
        fj_box_top = 2552
        fj_box_right = 590
        fj_box_bottom = 2563
        fj_vertex_0 = (564 + (2559 << 16))
        fj_vertex_1 = (578 + (2552 << 16))
        fj_vertex_2 = (590 + (2556 << 16))
        fj_vertex_3 = (586 + (2561 << 16))
        fj_vertex_4 = (580 + (2563 << 16))
        fj_vertex_5 = (570 + (2562 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueRightEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END
//second container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 70
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00100001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 614
        fj_box_top = 2541
        fj_box_right = 638
        fj_box_bottom = 2555
        fj_vertex_0 = (638 + (2544 << 16))
        fj_vertex_1 = (635 + (2550 << 16))
        fj_vertex_2 = (627 + (2554 << 16))
        fj_vertex_3 = (614 + (2555 << 16))
        fj_vertex_4 = (626 + (2543 << 16))
        fj_vertex_5 = (635 + (2541 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueLeftEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END
//add the items to the new disabled containers
//item 1 right eye (of statue -- i.e. left on screen)
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_con_itm_idx = 0
        fj_charge0 = 1
STR_VAR fj_name = ~abgfEyeR~
END
BUT_ONLY
//item 2 left eye (of statue -- i.e. right on screen)
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_con_itm_idx = 1
        fj_charge0 = 1
STR_VAR fj_name = ~abgfEyeL~
END
BUT_ONLY

//create left eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeL.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//create right eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeR.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//change the emeralds that prism carries
COPY_EXISTING ~prism.cre~ ~override~
 REMOVE_CRE_ITEM ~%item0001%~
 REPLACE_CRE_ITEM ~abgfEyeL~ #1 #0 #0 ~identified~ ~qitem1~
 REPLACE_CRE_ITEM ~abgfEyeR~ #1 #0 #0 ~identified~ ~qitem2~
BUT_ONLY_IF_IT_CHANGES
//compile the dialog changes to oublek and prism
COMPILE ~bgfixpack/files/oublek/oublek.d~ EVALUATE_BUFFER
//check existance of area script and add rep penalty for taking gems from statue
COPY_EXISTING ~ar5400.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES
//check existance of area script and add global sets to complete quest
COPY_EXISTING ~ar4800.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES
.d code
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)
Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")~
//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_RightEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom
//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom
//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)~
REPLACE_TRANS_ACTION ~PRISM~ BEGIN 7 END BEGIN 0 END ~DropInventory()~
~ContainerEnable("A6StatueRightEye",TRUE)
ContainerEnable("A6StatueLeftEye",TRUE)
DestroyItem("abgfEyeL")
DestroyItem("abgfEyeR")
SetGlobal("abgf_GemInEyeL","GLOBAL",1)
SetGlobal("abgf_GemInEyeR","GLOBAL",1)~ //1 means they are in the container and penalties for taking them out of 'statue' apply
REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF")
GiveItem("abgfEyeR","GREYWOLF")
SetGlobal("abgf_GemInEyeL","GLOBAL",2)
SetGlobal("abgf_GemInEyeR","GLOBAL",2)~ //anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.
APPEND prism
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStole
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
CreateCreature("GREYWO",[1267.2579],0)
ClearAllActions()
StartCutSceneMode()
StartCutScene("Prismcut")~ EXIT
END
IF ~NumTimesTalkedTo(0)
HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStoleButGone
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
END
END//end the append
Title: Re: Offering new component for UB
Post by: Salk on February 20, 2012, 09:20:11 AM
jastey,

please do not feel bad about your perception of the reputation concept. You are very right when you say that the party's reputation should increase or decrease according to how they publicly acted. But if it was only so, then what would be the meaning of having an alignment?

In our present case, plainab tells me (I didn't remember) that the party gains reputation for letting Prism finish his job. I don't think this is right either! The party should gain reputation when they deliver the gems back to Oublek instead! Letting Prism finish is not necessarily a good-hearted choice because it could be kindness but also convenience (the player thinks that after he's done, it's easier to take the emeralds, for example). My suggestion is that the party takes a loss of 1 point (not 2 and not certainly 3) as soon as one emerald is taken from the statue (it shouldn't matter if they take 1 or 2, it is the action that counts). Of course only if the protagonist is good aligned because otherwise there should be no reputation loss at all (neutral and evil aligned should not get any reputation loss).

This example is actually very good to show how reputation should work: it increases because of an act of renown (the delivery of the gems). And it decreases because of a disloyalty to one's (good) principles.

When it comes instead to tweaking the dialogue, I am still against it. You speak of a new, needed option for LG character. But what about CN characters then? CN are usually... unstable in their minds. If we follow your path, we should add one new line to every dialogue covering choices only to make them suit a CN character. And what about TN ones? A TN might even think that the right place for those emeralds is back into a mine (neither to be left there and not to be returned to Oublek). So in short, as plainab rightly stated, it is impossible to cover all the angles through dialogue. Most of the time, it is a matter of a compromise.

But you are the one in charge of BG1 UB now (and thanks a lot for that!) so the final decision rests on you.  ;)
Title: Re: Offering new component for UB
Post by: jastey on February 20, 2012, 01:26:22 PM
Thank you for the discussion!
The party gains +1 rep indeed if letting Prism finish. I didn't remember this! You are right about the reputation changes. It will decrease then if removing the gem(s).

Salk: What I had in mind as additional reply option to Prism would have been something along the lines of "These emeralds are stolen and you need to return them", probably making Prism hostile as all other attempts to get the gems does. Nothing spectacular, just for the feel of choice even if there is none. You are right, of course, that there also could be a line saying "I couldn't care less about what you are doing here" and "how about I just kill you" etcpp. The line would be easily added, though. Any lines to Oublek concerning the emeralds in the statue are more work, as there would have to be script blocks destroying them etc. Maybe I don't add any lines at all.

plainab: ContainerEnable doesn't work in BG1, unfortunately. At least it gives an install error saying that it is not included in the action.IDS. I lay my hopes on "unlock()" then. Making the lock difficulty 100% at the beginning should lead to an unpickable lock?
Thank you for the code, I will try to use it with "unlock()" instead of enable.
Title: Re: Offering new component for UB
Post by: Hurricane on February 20, 2012, 03:35:48 PM
This is all quite interesting. I never thought of such a "completion" of the Prism/Oublek encounter, but after reading this thread I'm sure it will make for a very neat new component.

I have nothing to add to the discussion about reputation, as I realize that your views about the whole concept are way more elaborate than mine. :P With respect to the additional reply, regardless of whether it will merely be another option for LG characters, I think both sides make a compelling case about it (I know, what a laaame position ;D). Indeed, adding one LG option to the dialogue won't make much of a difference and almost seems at odds with the rest of the game. Therefore I understand the concern that such an option could be considered spurious, given the absence of fitting reply options for the other alignments. Ultimately though, I am slighly in favor of the LG reply option, because in the end it doesn't do any harm but adds at least a little bit of depth. If the quest is being tweaked now, then why not have the option for a more fitting choice of words thrown in as well? And quite honestly, I believe it would work because I know that jastey has the right sensibility to pull it off. I've seen her additional reply options for the Scar component - they make the talk feel more natural and they add merit to the dialogue, even without a full set of options for every alignment. I am confident that letting jastey do the same with the Prism encounter will be for the better.
Title: Re: Offering new component for UB
Post by: jastey on February 21, 2012, 04:16:04 AM
Thanks for the words of confidence, Hurricane!

The component titel sais "(...)& Multiple Ways to Solve Quest", so I think adding any reply options I had in mind is not out of range. I am definitely considering adding the possibility to tell Oublek where the gems are, instead of removing and bringing them. I have to see how much work that makes, though.

plainab: I copied the code you provided last and it gives me an error message: ERROR: cannot convert fj_structure_type or %fj_structure_type% to an integer

I assume it's the part where the emeralds are added to the newly created containers via tp2. Since I have no clue about tp2 coding, I put all code in there (not the baf and d, of course). Could you or someone else tell me what I am doing wrong?
Title: Re: Offering new component for UB
Post by: jastey on February 21, 2012, 05:38:35 AM
Status of the item in container issue: Using unlock(), I can unlock (duh!) the eyes in BG1. Having a lock difficulty of 100% before, they cannot be emptied before Prism finishes his masterpiece. The default "this lock needs special bla" playes if clicked on, though. Disadvantages:
-After that, the containers are open and any lock difficulty is gone.
-If the player lets Prism not finish, the eyes remain two non-openable containers, possibly misleading players to look for some kind of key or something.

Could the lock difficulty be altered via script, maybe?

Still, that is, so far, all I can offer for BG1: At least the emeralds would be in the eyes of the statue.
That is, if the tp2 code for putting them in is debugged. :)
Title: Re: Offering new component for UB
Post by: plainab on February 21, 2012, 12:53:18 PM
-.-

weidu readme instructions for the function don't explain EVERYTHING
for each thing you add, you have to tell it what type of thing you are adding BUT unlike all the structure offsets it doesn't list what you are supposed to use...

after some trial and error got something that installs without error.

tho i think weidu should give an error when it compiles a dialog or script in BG/BG:ToTSC that has BG2 only code in it...

@Jastey  add the following in the STR_VAR section of the two copy blocks where the item(s) are added
Code: [Select]
        fj_structure_type = ~itm~
Title: Re: Offering new component for UB
Post by: jastey on February 21, 2012, 02:10:57 PM
Yes, now the item placement works. Thank you! I had to change the "fj_con_itm_idx" to "1" for the left eye and "2" for the right eye, btw. (I tested with adjusted names for the emeralds, so I am sure the "L" was in the left eye of the statue, from the statue PoV, and the "R" in the right one, too).

Quote
tho i think weidu should give an error when it compiles a dialog or script in BG/BG:ToTSC that has BG2 only code in it...
The ContainerEnable gave an error message upon install, at least for me. Could you install the code above on vanilla BG1 (TotSC) without an error message?

EDIT: The containers are enabled and "clickable" from the start, although the tp2 code reads:

Code: [Select]
fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00100001
which should disable them. I think the diabling of containers really doesn't work in BG1..
Title: Re: Offering new component for UB
Post by: jastey on February 21, 2012, 03:32:51 PM
The disabling / enabling of the containers work like a charm in Tutu.  :)


plainab: I don't understand one thing in the dialogue changes:

Quote
//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM %tutu_var%oublek 10
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

In the quoted code, a PC that lied about his identity gets the reward of state 14 (500 XP, 150 gold) for every emerald he returns separately.

A "good" PC that reveals his true identity gets 2x 100 XP and 2x 150 gold. Meaning, the lying PC can still get the reward double (I thought you wanted to prevent this) for taking the emeralds one by one to Oublek, and he gets 5 times more XP?  :o

Or I don't understand this correctly.
Title: Re: Offering new component for UB
Post by: plainab on February 21, 2012, 06:04:28 PM
Quote
The ContainerEnable gave an error message upon install, at least for me. Could you install the code above on vanilla BG1 (TotSC) without an error message?
I got no error on a BG1 ToTSC install (actually Original Saga) with or without MODDER

Quote
EDIT: The containers are enabled and "clickable" from the start, although the tp2 code reads:

Code: [Select]
fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00100001
which should disable them. I think the diabling of containers really doesn't work in BG1..
Quote
The disabling / enabling of the containers work like a charm in Tutu.
so... the disable bit is BG2 specific then.  makes sense since the ContainerEnable action is BG2 specific as well.

I'm trying something with Deactive() and Activate() actions.  will let you know the results

Quote
I had to change the "fj_con_itm_idx" to "1" for the left eye and "2" for the right eye, btw.
again, lack of documentation in the readme info of Weidu.  Weidu itself typically counts indexes starting at 0 so that's why i used 0 and 1.

Quote
(I tested with adjusted names for the emeralds, so I am sure the "L" was in the left eye of the statue, from the statue PoV, and the "R" in the right one, too).
O.o  they were already in statue point of view....  why change them?

Quote
Or I don't understand this correctly.
you are correct, you don't understand correctly :P

It is confusing at first glance, BUT in the original file those who claim to be greywolf get these actions performed:
Code: [Select]
AddexperienceParty(500)
GivePartyGold(150)
TakePartyItem("MISC65")
TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
SetGlobal("OublekBounty1","GLOBAL",1)
SetGlobal("OublekBounty2","GLOBAL",1)
Note the global variables.  these are checked to be 0 at the states where the player wants to turn in the reward.  SO a greywolf claimer can only turn in ONCE any and all rewards.  Best they save all the Prism and Brage stuff and turn it in all together else they'll miss out and be punished further....
Title: Re: Offering new component for UB
Post by: jastey on February 22, 2012, 03:48:36 AM
Quote
(I tested with adjusted names for the emeralds, so I am sure the "L" was in the left eye of the statue, from the statue PoV, and the "R" in the right one, too).
O.o  they were already in statue point of view....  why change them?
As I wrote: For testing purposes only. I wanted to be sure the correct emeralds are assigned. Name is changed back now. ;)

Quote
Or I don't understand this correctly.
you are correct, you don't understand correctly :P

It is confusing at first glance, BUT in the original file those who claim to be greywolf get these actions performed:
Code: [Select]
AddexperienceParty(500)
GivePartyGold(150)
TakePartyItem("MISC65")
TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
SetGlobal("OublekBounty1","GLOBAL",1)
SetGlobal("OublekBounty2","GLOBAL",1)
Note the global variables.  these are checked to be 0 at the states where the player wants to turn in the reward.  SO a greywolf claimer can only turn in ONCE any and all rewards.  Best they save all the Prism and Brage stuff and turn it in all together else they'll miss out and be punished further....
No, the dialogue for the other bounties does not get disabled by this: No check variable in the reply trigger. The OublekBountyX variables only prevent the inquiring after open bounties. They are not used for the reply options leading to the bounty. I tested it: After going the "lying to Oublek" path, I could hand in the two emeralds one after the other. And as far as I recall there is no trigger variable preventing the asking for Brage's body bounty, either.
Title: Re: Offering new component for UB
Post by: plainab on February 22, 2012, 02:26:29 PM
Code: [Select]
No, the dialogue for the other bounties does not get disabled by this: No check variable in the reply trigger. The OublekBountyX variables only prevent the inquiring after open bounties. They are not used for the reply options leading to the bounty. I tested it: After going the "lying to Oublek" path, I could hand in the two emeralds one after the other. And as far as I recall there is no trigger variable preventing the asking for Brage's body bounty, either. my bad, the variable is there for turning in both at once
Code: [Select]
  IF ~  Global("OublekBounty2","GLOBAL",0)
PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("BroughtBounty","GLOBAL",1)
~ THEN REPLY #19717 /* ~I've come to turn in a bounty, and collect the reward that is duly mine.~ */ GOTO 14
but not for individually...

as a side note it is there for brage too
Code: [Select]
  IF ~  Global("OublekBounty1","GLOBAL",0)
PartyHasItem("MISC65")
Global("BroughtBounty","GLOBAL",1)
~ THEN REPLY #4649 /* ~I've come to turn in a bounty, and collect the reward that is duly mine.~ */ GOTO 14

so to fix this find in the .d file where I EXTEND_BOTTOM to oublek's state 10
add in the Global("OublekBounty2","GLOBAL",0) check to the two added states.

also found a better way to add the items to the containers since the previous code would allow for possible screwups if the # of containers was modified.

so replace both the container creation & the item addition segments with this:
Code: [Select]
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 30
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
//        fj_flags = 0b00100001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 564
        fj_box_top = 2552
        fj_box_right = 590
        fj_box_bottom = 2563
        fj_vertex_0 = (564 + (2559 << 16))
        fj_vertex_1 = (578 + (2552 << 16))
        fj_vertex_2 = (590 + (2556 << 16))
        fj_vertex_3 = (586 + (2561 << 16))
        fj_vertex_4 = (580 + (2563 << 16))
        fj_vertex_5 = (570 + (2562 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueRightEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END
 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
    INT_VAR fj_charge0 = 1
            fj_con_itm_idx    = SHORT_AT 0x74 - 1
    STR_VAR fj_name = ~abgfEyeR~
            fj_structure_type = ~itm~
 END
BUT_ONLY
//second container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 70
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
//        fj_flags = 0b00100001
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
//        fj_trap_active to whether the container is trapped (0=no, 1=yes);
//        fj_trap_status to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 614
        fj_box_top = 2541
        fj_box_right = 638
        fj_box_bottom = 2555
        fj_vertex_0 = (638 + (2544 << 16))
        fj_vertex_1 = (635 + (2550 << 16))
        fj_vertex_2 = (627 + (2554 << 16))
        fj_vertex_3 = (614 + (2555 << 16))
        fj_vertex_4 = (626 + (2543 << 16))
        fj_vertex_5 = (635 + (2541 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueLeftEye~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END
 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
    INT_VAR fj_charge0 = 1
            fj_con_itm_idx    = SHORT_AT 0x74 - 1
    STR_VAR fj_name = ~abgfEyeL~
            fj_structure_type = ~itm~
 END
BUT_ONLY

this should make it workable for TuTu & BGT versions   LOL  BG still doesn't work.  Activate & Deactivate actions don't seem to work for containers....
Title: Re: Offering new component for UB
Post by: Miloch on February 22, 2012, 02:54:02 PM
Coding for BG1 really sucks - I can't even find anything that will display an animation like an explosion, short of putting it in an actual area file. In BG2 we have CreateVisualEffect() as an action and opcode #215 Play 3D Effect. Nor can one seem to activate/deactivate trigger regions or containers, as you say.

Can you use TriggerActivation() in conjuction with a trap script around the containers to prevent the character from reaching them until the proper time? Failing that, Unlock() combined with an unpickable lock should be a grudgingly acceptable workaround for BG1, no?
Title: Re: Offering new component for UB
Post by: plainab on February 22, 2012, 03:04:40 PM
at least the nice thing about BG is that the containers don't highlight with TAB key, player has to put their mouse over them.  For at least the first run, they won't know to look there  LOL

Only solution I could think of for BG is to make Prism initiate the conversation.  Since the access point to the containers is where Prism is standing, the player would get interrupted by Prism talking. He could have a limiting range say only initiate if the player is within 10.  that's close enough for an npc who is talking aloud to themselves to realize someone is approaching
 ...  thoughts?

his initial dialog
Quote
Ahh, beauteous creature!  Never should I have stolen these emeralds, but there was nothing else that would capture the majesty of thine yes!  I did what must be done, for I have left my shop, forgotten all my commissions, and spent all that I had.  I must complete thee!  Wait, there is someone here!  Who are you?  'Twas that relentless Greywolf who sent you, wasn't it?


Quote
Can you use TriggerActivation() in conjuction with a trap script around the containers to prevent the character from reaching them until the proper time? Failing that, Unlock() combined with an unpickable lock should be a grudgingly acceptable workaround for BG1, no?
not tried TriggerActivation etc... yet   Now that I've got a save from just before entering the area I'm trying all sorts of combinations of stuff :P    the unpickable lock thing, if it has to be that way, but  then there is no effort required (i.e. getting a thief with high enough skill) to get them out of the statue.
But see above for my thoughts on making Prism initiate dialog as a solution.
Title: Re: Offering new component for UB
Post by: plainab on February 22, 2012, 05:43:32 PM
a range of 1 on Prism initiating dialog allows the player to arrange their party to protect Prism if they plan to protect him from Greywolf.
he does initiate dialog properly should any PC character approach his spot (which they must if trying to open the container)
player can click on Prism and he will talk as normal
Only drawback so far is when picking his pocket even tho the player pulled out quick, Prism will follow after... tho Prism will use the proper lines at that point too
Solved that by using variables and interrupting and clearing Prism's actions and making him move back to point IF he had moved.


Also, in BG/ToTSC scripted reputation loss does not work.  I think the reputation action works only in dialog.
so maybe the rep gain for allowing him to finish should be removed.  thus there is no worry about rep loss or gain  :P
Title: Re: Offering new component for UB
Post by: plainab on February 22, 2012, 07:08:19 PM
Alright Jastey

I've something that I'm happy with for BG  plus I found a few other things that needed corrected etc.  Here are the BG files.  You may wish to use this as the base for the Tutu/BGT versions instead.  Since BG2 variants can handle the ContainerEnable you don't need the talk initiation stuff for Prism on those versions but you do need some of the other corrections etc...

tph/tp2 code
Code: [Select]
//ISSUES-OublekEmeraldBountyExploitTWEAK.tph
PRINT ~Processing ISSUES-OublekEmeraldBountyExploitTWEAK.tph~
SILENT
// ----------------------------------------------------------------------------
//BEGIN @7 //~Optional: Oublek & Prism - No Exploit & Multiple Ways to Solve Quest~
//first container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 30
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
//        fj_flags = 0b00100001  //for tutu & bgt (i hope)
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
        fj_trap_active = 1 //to whether the container is trapped (0=no, 1=yes);
        fj_trap_status = 0 // to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 564
        fj_box_top = 2552
        fj_box_right = 590
        fj_box_bottom = 2563
        fj_vertex_0 = (564 + (2559 << 16))
        fj_vertex_1 = (578 + (2552 << 16))
        fj_vertex_2 = (590 + (2556 << 16))
        fj_vertex_3 = (586 + (2561 << 16))
        fj_vertex_4 = (580 + (2563 << 16))
        fj_vertex_5 = (570 + (2562 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueRightEye~
        fj_trap_script = ~abitrp~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END

 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
    INT_VAR fj_charge0 = 1
            fj_con_itm_idx    = SHORT_AT 0x74 - 1
    STR_VAR fj_name = ~abgfEyeR~
            fj_structure_type = ~itm~
 END

BUT_ONLY
//second container
COPY_EXISTING ~ar5400.are~ override
LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_loc_x = 641
        fj_loc_y = 2713
        fj_type = 6
        fj_lock_diff = 70
//        fj_flags to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);
        fj_flags = 0b00000001
//        fj_flags = 0b00100001  //for tutu & bgt (i hope)
        fj_trap_detect = 100
        fj_trap_remove_diff = 100
        fj_trap_active = 1 //to whether the container is trapped (0=no, 1=yes);
        fj_trap_status = 0 // to whether the trap is detected (0=no, 1=yes);
        fj_trap_loc_x = 641
        fj_trap_loc_y = 2713
        fj_box_left = 614
        fj_box_top = 2541
        fj_box_right = 638
        fj_box_bottom = 2555
        fj_vertex_0 = (638 + (2544 << 16))
        fj_vertex_1 = (635 + (2550 << 16))
        fj_vertex_2 = (627 + (2554 << 16))
        fj_vertex_3 = (614 + (2555 << 16))
        fj_vertex_4 = (626 + (2543 << 16))
        fj_vertex_5 = (635 + (2541 << 16))
//        fj_lockpick_strref to the lockpick string reference (default -1);
STR_VAR fj_structure_type = ~container~
        fj_name = ~A6StatueLeftEye~
        fj_trap_script = ~abitrp~
//        fj_trap_script to the trap’s script;
//        fj_key_resref to the filename of the container’s key;
END

 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
    INT_VAR fj_charge0 = 1
            fj_con_itm_idx    = SHORT_AT 0x74 - 1
    STR_VAR fj_name = ~abgfEyeL~
            fj_structure_type = ~itm~
 END

BUT_ONLY

//create left eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeL.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'L'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the left eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//create right eye emerald
COPY_EXISTING ~misc43.itm~ ~override/abgfEyeR.itm~
 SAY UNIDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
 SAY IDENTIFIED_DESC ~An emerald is a brilliant green beryl, cleaved along straight box like lines, with rectangular cutting in the finished gem.  Emeralds are often connected with health, and so are used ornamentally for such a purpose. This emerald is marked with a small 'R'. It had been stolen by Prism for his use in a statue of his lady love, Ellesime. It is surmised that this gem was intended to be used as the right eye. Whether or not it was used in the statue, there is a bounty for returning it to the proper authorities.~
BUT_ONLY_IF_IT_CHANGES
//change the emeralds that prism carries
COPY_EXISTING ~prism.cre~ ~override~
 REMOVE_CRE_ITEM ~misc43~
 REPLACE_CRE_ITEM ~abgfEyeL~ #1 #0 #0 ~identified~ ~qitem1~
 REPLACE_CRE_ITEM ~abgfEyeR~ #1 #0 #0 ~identified~ ~qitem2~
 READ_ASCII 0x0248 ~overridescript~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%overridescript%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%overridescript%.bcs~ ~bgfixpack/files/oublek/abgfprsm.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x0248 ~abgfprsm~
  READ_ASCII 0x0248 ~overridescript~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%overridescript%.bcs~ ~bgfixpack/files/oublek/abgfprsm.baf~ //add our stuff -- creates new if doesn't exist
  END
 END

BUT_ONLY_IF_IT_CHANGES
//compile the dialog changes to oublek and prism
COMPILE ~bgfixpack/files/oublek/oublek.d~ EVALUATE_BUFFER
COMPILE ~bgfixpack/files/oublek/abitrp.baf~ EVALUATE_BUFFER
//check existance of area script and add rep penalty for taking gems from statue
/*
COPY_EXISTING ~ar5400.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar5400.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES
*/
//check existance of area script and add global sets to complete quest
COPY_EXISTING ~ar4800.are~ ~override~
 READ_ASCII 0x94 ~script~
 PATCH_IF (FILE_EXISTS_IN_GAME ~%script%~) BEGIN
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END ELSE BEGIN
  WRITE_EVALUATED_ASCII 0x94 ~%SOURCE_RES%~
  READ_ASCII 0x94 ~script~
  INNER_ACTION BEGIN
   EXTEND_BOTTOM ~%script%.bcs~ ~bgfixpack/files/oublek/ar4800.baf~ //add our stuff -- creates new if doesn't exist
  END
 END
BUT_ONLY_IF_IT_CHANGES
Prism's initiation script
Code: [Select]
IF
  See([PC])
  !Range(LastSeenBy,1)
  Global("abgf_PrismTalk","LOCALS",1)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
    SetGlobal("abgf_PrismTalk","LOCALS",0)
END

IF
  See([PC])
  Range(LastSeenBy,1)
  !StateCheck(LastSeenBy,STATE_INVISIBLE)
  !StateCheck(LastSeenBy,STATE_IMPROVEDINVISIBILITY)
  NumTimesTalkedTo(0)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Wait(3)
    Dialogue([PC])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,1)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END
the dialog changes (some more things were adjusted/corrected in here)
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~Global("OublekBounty2","GLOBAL",0) PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0) !PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself)~
//REPLACE_TRANS_ACTION ~prism~ BEGIN 7 END BEGIN 0 END ~ReputationInc(1)~ ~~
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~
REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.
APPEND prism
IF ~NumTimesTalkedTo(0) !HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("ab_GemStoleResolve","GLOBAL",0)~
THEN BEGIN abBothStole
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") CreateCreature("GREYWO",[1267.2579],0) ClearAllActions() StartCutSceneMode() StartCutScene("Prismcut")~ EXIT
END
IF ~NumTimesTalkedTo(0) HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR") Global("ab_GemStoleResolve","GLOBAL",0)~
THEN BEGIN abRightStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0) !HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") Global("ab_GemStoleResolve","GLOBAL",0)~
THEN BEGIN abLeftStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~NumTimesTalkedTo(0) !HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("ab_GemStoleResolve","GLOBAL",0)~
THEN BEGIN abBothStoleButGone
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
END
END//end the append
the trap script for the two containers
Code: [Select]
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",1)
THEN
  RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",2) //2 is only 1 gem taken from statue
  ReputationInc(-1) //only one rep point loss in total cause it reverts the rep point gain given by letting him finish the work
  AddJournalEntry(~Perhaps it was wrong, but after allowing Prism to complete his final masterpiece we've taken one of the emeralds he had stolen to use in the statue's eyes. It should bring a hefty price at the right place or a decent reward...~)
END
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",2)
THEN
RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",3)
  AddJournalEntry(~After a bit of hard work, we finally removed the second emerald which Prism had stolen to use in one of the eyes of his 'final masterpiece'.~)
END
the script addition to ar4800
Code: [Select]
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Prism's story was a sad tale indeed.  A shame it could not have had a better ending.  Ah well, I profit in the end.  300 gold bounty for the emeralds he stole.~)
END

note i dropped the script from ar5400 and applied a modified version of it to the containers.  only a rep loss of 1 occurs (basically a removal of the rep increase for letting him complete the task).
You can easily provide an option for PC to tell Oublek where the emeralds are if you wish
Title: Re: Offering new component for UB
Post by: jastey_guest on February 23, 2012, 01:40:22 AM
Thank you for the new version, plainab.

Only thing: I know that you want to have rep loss or at least not so much rep increase in the Prism encounter, but removing the rep increase after letting Prism finish seems like a rather arbitrary tweak. If you'd start a poll, there would be players voting for removing it just as many as for keeping to the original. Removing it is your opinion, keeping it (and changing from the original game as little as possible) would be mine. ;) There might be players who leave the emeralds in the eyes, after all.

Maybe we could use a self-initiated player1 dialogue for triggering a rep loss. I'll have a look at it tonight.
Title: Re: Offering new component for UB
Post by: jastey_guest on February 23, 2012, 02:13:36 AM
I had a completely new idea concerning the removement of the emeralds from the eyes: Why put them in at all? It could be done completely via script. The idea of destroying the sculpture the PC just defended at risk of his own life would be much clearer, too. What I had in mind:

before Prism finishes (or if he never finishes): Upon clicking on the eyes, the text sais "The sculpture has an empty hole where the eye should be".

After letting Prism finish, clicking on an eye the text would say something like "You take a close look at one of the emeralds Prism used as an eye. You could remove it with some force, but it would destroy the sculpture you just helped Prism to finish."

Maybe this could be done as a dialogue to leave the choice to the player. Clicking on "take the emrald" would give "with some force, you remove the emeralds" and -1 rep is applied. The emerald is created in the inventory.

This would be, in my opinion, a more elegant solution than the making a container with different lock difficulty: I have to admit that when I saw it first, I didn't undertand the lock difficulty was referring to the difficulty to remove the gem.
It would solve a lot of problems in one go, too, I think.
Title: Re: Offering new component for UB
Post by: Salk on February 23, 2012, 02:52:04 AM
I like your idea, jastey!  ;)

About reputation (again), I have already tried to explain why a +1 for letting Prism finish does not make much sense. If the party does not gain reputation returning the emeralds to Oublek THEN we should introduce a +1 there instead.
Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 06:21:35 AM
Thank you for the new version, plainab.

Only thing: I know that you want to have rep loss or at least not so much rep increase in the Prism encounter, but removing the rep increase after letting Prism finish seems like a rather arbitrary tweak. If you'd start a poll, there would be players voting for removing it just as many as for keeping to the original. Removing it is your opinion, keeping it (and changing from the original game as little as possible) would be mine. ;) There might be players who leave the emeralds in the eyes, after all.

Maybe we could use a self-initiated player1 dialogue for triggering a rep loss. I'll have a look at it tonight.
actually it was an idea, but the scripting worked after tweaking some settings regarding traps on the containers so rep loss/gain was left alone except that you only lose 1 point for taking out 1 or both gems
Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 06:26:16 AM
I had a completely new idea concerning the removement of the emeralds from the eyes: Why put them in at all? It could be done completely via script. The idea of destroying the sculpture the PC just defended at risk of his own life would be much clearer, too. What I had in mind:

before Prism finishes (or if he never finishes): Upon clicking on the eyes, the text sais "The sculpture has an empty hole where the eye should be".

After letting Prism finish, clicking on an eye the text would say something like "You take a close look at one of the emeralds Prism used as an eye. You could remove it with some force, but it would destroy the sculpture you just helped Prism to finish."

Maybe this could be done as a dialogue to leave the choice to the player. Clicking on "take the emrald" would give "with some force, you remove the emeralds" and -1 rep is applied. The emerald is created in the inventory.

This would be, in my opinion, a more elegant solution than the making a container with different lock difficulty: I have to admit that when I saw it first, I didn't undertand the lock difficulty was referring to the difficulty to remove the gem.
It would solve a lot of problems in one go, too, I think.
if you really wish to change it to that, i can't really stop you but now that there is a working BG version, why bother....  at least play the BG version and decide for yourself before making decisions on changing the whole fundamental background of the component.
Title: Re: Offering new component for UB
Post by: jastey_guest on February 23, 2012, 06:51:38 AM
plainab: I understood from your posts that rep loss via script doesn't work in BG1, that's why I posted the idea about the script-based handling.
If that works as intended, then indeed there is no need to turn the whole code over.

Salk: I am aware of your suggestion to move the +1 rep from Prism to Oublek, but I am not sure it would really fit. Upon returning the emeralds, the PC is just another bounty hunter, returning a stolen good to a city authority. I don't really see a rep increase justified here. It is not a troubled individual or a city in need the PC helps heroically, if you know what I mean. But of course, this is open to discussion. But my thoughts are the reason I didn't propose a rework of the rep gain for the Prism encounter.

What would you say to a reply option added to Oublek to tell him about the emeralds in the sculpture (possibly leading to a rep loss of 1, too, since it will lead to the statue being damaged), and also the offer to pay the emeralds so they can stay in the eyes (no rep loss, 200 gold loss, and a warm glowing feeling as reward). This would be a nice, official ending to the Prism encounter for the path "let him finish", imho.
Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 08:07:03 AM
Quote
What would you say to a reply option added to Oublek to tell him about the emeralds in the sculpture (possibly leading to a rep loss of 1, too, since it will lead to the statue being damaged), and also the offer to pay the emeralds so they can stay in the eyes (no rep loss, 200 gold loss, and a warm glowing feeling as reward). This would be a nice, official ending to the Prism encounter for the path "let him finish", imho.
the added state to tell Oublek where the emeralds are at is acceptable to me.  I think a small reward 50 - 100 gold for giving the information should be acceptable, rep loss at that point no because the player isn't going to be the one defacing the statue.  If the player wants to pay to keep the gems in place, i don't see why they should not be allowed to do so.

you may want to consider fleshing out Oublek and what happens when the player should steal the gems from Prism.  As it is now, Prism will plead to have them back if the player has them, but if the player got rid of them he is only told of the fact and nothing happens.  I'm thinking that the player could tell Oublek that Prism is still out at the statue south of the Nashkel mines entrance if Oublek wants to send the guard after him (if this is the case then, Prism can be removed by script on area reload).  Else when spoken to and the player either refuses to return the stolen gem(s) or no longer has the stolen gem(s), he should bemoan that he'll never finish the statue and commit suicide then and there.
What you think?


side note:  i also disagree with Oublek giving rep gain. it doesn't make any sense at that point.
Title: Re: Offering new component for UB
Post by: Salk on February 23, 2012, 08:30:36 AM
I have a different opinion about the reputation gain from returning the emeralds being unreasonable (a bounty hunter gains fame pretty quickly, I'd say) but it's okay to leave it like that.

About the other dialogue possibilities, I personally wouldn't add any. Paying for the Emeralds do not seem a solution because those gems may have a special background and meaning for the person from whom they were stolen (we don't know anything about it): that's why we want to avoid the possibility where the PC might deliver any kind of emeralds to Oublek and complete the quest.

I don't like the "tell Oublek where the emeralds are" either. We were hired to produce a result (delivery of the emeralds), not to spy on Prism.

In short: it seems to me we are making things more and more complicated and convoluted. It's a tweak, true (it was actually me that suggested this tweak to Ascension64 some years ago, as he could easily confirm) but extra changes should be introduced only when there is really a need/purpose.
Title: Re: Offering new component for UB
Post by: jastey_guest on February 23, 2012, 08:43:27 AM
Salk: I tend to make quests paths and possibilities very complicted and it's good if someone stops me in time.

Still, after reading plainab's ideas for the stolen emeralds: What happens to Greywolf, actually, if the PC kills Prism (or, for the UB component, steals the gems)? Does he even appear? Wouldn't / shouldn't he meet the PC to complain about the PC taking away his reward? Shouldn't be Oublek rather scared about Greywolf's anger, if the PC gets the emeralds from Prism without facing Greywolf, since he hired him for this and seems to fear him quite a lot?

Salk: Adding the reply options wouldn't necessarily mean new quest endings. Maybe Oublek would reply "I don't have time to fetch these things myself, or I wouldn't be standing here. Now you scared away Greywolf I hired for this, you bring the gems to you get the reward." - especially after Greywolf is dead.

It's just that currently, leaving the gems in the eyes makes this quest an "unsolved" one. Leaving the statue untouched is a new "ending" introduced by the component, because in the original game, the gems could just be collected from prism's corpse. Therefore, I think the mod should introduce a proper ending for this path, as well. What I suggested is such an official ending. I am not saying the outcome has to be what I wrote, though, if we want to leave things simple, but it could all melt down to "PC has to bring emeralds to Oublek or forget about it".
Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 11:13:46 AM
Oublek may only be concerned about the emeralds and if thats the case then no matter what combination of possibilities we can contrive about the status of Prism & Greywolf, Oublek will just tell the PC "get the emeralds or get lost"

I think the original intent was...

1) do nothing 
2) talk to Prism & decide to do nothing
3) talk to Prism & kill him taking the gems
4) talk to Prism, agree to let him finish, decide to let Greywolf take the gems
5) talk to Prism, agree to let him finish, decide to defend against Greywolf, get gems from Prism's corpse

paths 1, 2 & 4 give nothing to player for their part
path 3 only gives the player the reward from Oublek
path 5 is the most lucrative, player not only gets Oublek's reward, but 1400 exp for killing Greywolf, 1000 exp and rep gain for letting Prism finish the statue

the mod idea does 2 things
1) allows gems to be stolen from Prism's person (the original could have been stolen too) and recognized by him that they were gone.
2) allows the gems to be placed into the eyes of the statue rather than dropping to the ground at Prism's death

the states where he notices they are stolen, give the player a chance to relent and let him finish the statue else they take them for reward or cash. Prism turns hostile as of right now, but he could easily be made to bemoan the loss and commit suicide. tho attacking a well armed party is basically the same as suicide.

Once the gems are placed into the eyes tho, the player now has another choice. instead of just picking up the gems and turning them in or cashing them in, the player can choose to leave them behind. 

*****************
All that said, Jastey has a point that something COULD be said to Oublek about where the gems are at.
Oublek could decide to tell the PC that they must bring the gems or forget about it.
Oublek could also accept any money the PC gives to keep the gems there BUT nothing is stopping him from telling the original owners where their gems are located.

Those options were not written in by me as I never thought about them, but they are valid and it does give some ways out for those who want to role play with a bit more depth to the side quest.

I will say that it is easier to not mess with any of it.  After all the tweak is about having the gems in the statue's eyes, the options about Prism recognizing the pick pocket is an extra that just made sense since before he'd do nothing and still follow his dialog and act like nothing ever happened.

I'm trying to be middle ground here LOL  cause I can see validity in wanting to examine what happens with the characters under different circumstances, but also simplicity is best especially where BG is concerned (there is less that can be coded compared to BG2).  that said, I don't see Greywolf as a character who would begrudge another bounty hunter for beating him to the reward.  He'd take 'em on if they stood in the way of his goal, but if they already got the reward... I think he'd move on and we wouldn't hear from him again.
Title: Re: Offering new component for UB
Post by: jastey on February 23, 2012, 01:49:39 PM
How about we take the component as it is now, and decide about adding more content later.  :P

Closing the open ends is what interest me most, thus:
For the players wanting to leave the emeralds in the statue, maybe the journal entry after prism is finished could be a "solved journal" one. For BG1, it is all the same anyway. And for BGT/Tutu, I think entries from the solved journal section can be removed, too. Thus, the "solved" entry would be removed once the player takes out the gems, and the new ones according to above will be put into the unsolved section of the journal. Once the gems are brought to Oublek, the case will be closed again.

For the players stealing the gems and not returning them to Prism, Prism could initiate a comment and make suicide (or die of a heart attack) next time the player sees him.


Not saying that I wouldn't love to have all the reply options and possibilities mentioned, but the component is fine the way it is (and will be perfect with all endings closed).

Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 01:57:55 PM
sounds like a good idea

depending upon player feedback more could be added later.

I look forward to seeing the component with your dialog adjustments.  dialog is not my strong point :P
Title: Re: Offering new component for UB
Post by: jastey on February 23, 2012, 02:11:50 PM
Dialogue is all I can! :) But I don't think there is much need for dialogue adjustments. The line for Prism is already there. Do we add a kill(myself) to state 8, or make it a new state? Or we let Prism live, and he stands in front of the statue, mourning (e.g. make state 8 the "true()" trigger after the quest is finished if talked to). I think I like this best, actually.

The journal entries are already there, just have to adjust the solved / unsolved category.
Title: Re: Offering new component for UB
Post by: plainab on February 23, 2012, 03:50:07 PM
well you might want to make the wording sound better, that is what i meant by dialog... :P

state 8 was pre-existing and is only used if after all is said and done and Prism is still alive...  not even sure how that is possible in the original..

I guess i used it as a transition out when the gems were pick pocketed and the player refused to return them...   But yeah if it can be used for whenever Prism is alive and the gems have already been dealt with, it would make sense.


side note:  state 0 of greywo.dlg is of interest, never seen that one at all in game.  not sure when or if it is used.  BUT you were wondering whether Greywolf should make an appearance in some of the scenarios.  looks like a possibility for something if it isn't already being used...
Title: Re: Offering new component for UB
Post by: jastey on February 23, 2012, 07:02:15 PM
Seems to be unfinished business alright. Maybe the component could include an angry Greywolf's return, after all. :)
Title: Re: Offering new component for UB
Post by: Salk on February 23, 2012, 10:47:26 PM
I agree.

We'd better keep things the way they are and elaborate further in the future. I believe in fact that the new version should be soon ready and there is no reason to delay it further.
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 06:05:18 AM
Unnecessary delay is never good. :)

This is the unused state from greywo.dlg. What do you think, is it because of the 200 gold the PC received after telling the wrong name toOublek, or would this happen after the PC got the bounty for the emeralds?

Quote
IF ~~ THEN BEGIN 0 // from:
  SAY #667 /* ~I don't take kindly to those who snag another man's wage.  I've a whack of my own to split between ye!  200 gold has bought ye a box of the finest pine!  It's my trade to deal with the likes of you, but this I do for free!~ */
  IF ~~ THEN EXIT
END

(...)

IF ~~ THEN BEGIN 8 // from:
  SAY #9028 /* ~I'll take your head for what you've done!~ */
  IF ~~ THEN EXIT
END

Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 06:45:38 AM
Something else in the original quest that I think is bad. If the player first denies to be Greywolf, but then choses the reply option:
Quote
  IF ~~ THEN REPLY #4728 /* ~Your safety is no concern of mine.  I don't fancy trying to get between a bounty hunter and his bounty.~ */ GOTO 5

Prism just gives a reply:
Quote
IF ~~ THEN BEGIN 5 // from: 1.1
  SAY #679 /* ~Then begone, for I've much work to do.  She will be done this day!  ~ */
  IF ~~ THEN EXIT
END

and the quest remains broken: He cannot be talked to again. The only "solution" now is to kill him and take the emeralds. That is a bit inconveniet, I think.

It also collides with how the mod deals with the container handling in BG1 (Prism initiates dialogue to prevent [PC] to open containers.

Should this state lead to Greywolfs appearing instead? Then all first dialogues with Prism would "end" the quest, mostly by his death.
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 06:48:48 AM
Unnecessary delay is never good. :)

This is the unused state from greywo.dlg. What do you think, is it because of the 200 gold the PC received after telling the wrong name toOublek, or would this happen after the PC got the bounty for the emeralds?

Quote
IF ~~ THEN BEGIN 0 // from:
  SAY #667 /* ~I don't take kindly to those who snag another man's wage.  I've a whack of my own to split between ye!  200 gold has bought ye a box of the finest pine!  It's my trade to deal with the likes of you, but this I do for free!~ */
  IF ~~ THEN EXIT
END

(...)

IF ~~ THEN BEGIN 8 // from:
  SAY #9028 /* ~I'll take your head for what you've done!~ */
  IF ~~ THEN EXIT
END

it's in regards to the gold the PC got from Oublek so technically nothing to do with Prism specifically. tho there are some other transitions and such in Greywolf's dialog in the Prism encounter where he does recognize that the PC was the one who took the gold that was meant for him.
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 06:58:18 AM
Should this state lead to Greywolfs appearing instead? Then all first dialogues with Prism would "end" the quest, mostly by his death.
I never turned him down so i never noticed it LOL

Its cause of the NumTimesTalkedTo in the first state most likely.

but if you turn him down once you shouldn't get the chance to do it again.  so either Greywolf enters, or Prism is left to finish the statue in his own sweet time.  which i think the latter was the intent.  you back out of the quest at that point and it's screw you  :P

tho the player could still come back and pick Prism's pocket for the gems...

Just need to make sure that Prism spouts a line about leaving him alone to work on the statue etc... if he's been "turned down"
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 07:09:52 AM
I think I will introduce a loop for this. If the path I posted is chosen, Prism will say something like "I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!" when talked to again. There all the reply options from the state 1 will be present, either leading to PC protecting Prism against Greywolf, killing Prism himself or, again, doing nothing. This dialogue will show (BG1: Prism will trigger himself if [PC] approaches) until other path is chosen.

In case of stealing an emerald in the meantime: I removed the "NumTimesTalkedTo(0)" trigger from the custom dialogue states. This way, Prism will react to the stolen emeralds no matter how often he was talked to before.
Title: Re: Offering new component for UB
Post by: Salk on February 24, 2012, 07:15:35 AM
The loop sounds good to me...
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 07:17:22 AM
The loop sounds good to me...
seconded  o.ob
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 07:22:38 AM
I added as last state to prism.dlg:
Code: [Select]
IF ~HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)~ THEN stillworking
SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
COPY_TRANS %tutu_var%prism 1
END

I also added a trigger variabe to PRISM 8 (after the gems are lost) which will play then every time Prism will be talked to (not 100% sure about the code, but I will test the install soon)

Code: [Select]
ADD_STATE_TRIGGER %tutu_var%prism 8 ~Global("ab_GemStoleResolve","GLOBAL",1)~

And this I think should be added to the BG1 install: in case Prism dies or cannot finish his masterpiece, the containers should be emptied:
Code: [Select]
ADD_TRANS_ACTION prism BEGIN 3 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

ADD_TRANS_ACTION prism BEGIN 8 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 07:29:38 AM
you can shorten that last part.  if the code is identical and the transition #s the same then you can do a state list
making it
Code: [Select]
ADD_TRANS_ACTION prism BEGIN 3 8 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

EDIT:  you test your changes and if they work, post the adjustments to the BG version and i'll test it out...
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 08:28:57 AM
BG1:
I have a weird behaviour. If I make a quick save before talking to Prism the first time, and then load the save, Prism doesn't have the custom emeralds. I know he had them for the game I saved, because I played the quest. When I load that save, he gives his "You! You took my emerlads" speech. This is really weird.

The "Prism initiates dialogue to prevent the player to open container" doesn't work 100% for me. Sometimes, the party thief remains in a greater distance ("hangs") but the container still opens. I tried adding a "Clicked([ANYONE])" ot the container script but either I did it wrong or it doesn't work:
Code: [Select]
IF Clicked([Anyone])
  Range([PC],15)
!Global("abgf_GemInEye","GLOBAL",1)
!Global("abgf_GemInEye","GLOBAL",2)
THEN
  RESPONSE #100
ActionOverride("prism",Dialogue([PC]))
END

I have the following:

oublek.d
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~%tutu_var%oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~%tutu_var%oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

ADD_TRANS_TRIGGER ~%tutu_var%oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~%tutu_var%oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~%tutu_var%oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER %tutu_var%oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("%tutu_var%MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER %tutu_var%oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("%tutu_var%MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER %tutu_var%oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("%tutu_var%MISC43")~ ~PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER %tutu_var%oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("%tutu_var%MISC43")~ ~!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION %tutu_var%oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("%tutu_var%MISC43")~ ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND %tutu_var%oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeL")
SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100)
GivePartyGold(150)
TakePartyItem("abgfEyeR")
SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM %tutu_var%oublek 9
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",0)
Global("abgf_RightEyeBounty","GLOBAL",0)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("abgf_RightEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom


//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM %tutu_var%oublek 10
IF ~Global("OublekBounty2","GLOBAL",0)
PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("BroughtBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0)
!PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("BroughtBounty","GLOBAL",1)~ THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom


//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER %tutu_var%prism 0 ~HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG

ADD_STATE_TRIGGER %tutu_var%prism 8 ~Global("ab_GemStoleResolve","GLOBAL",1)~

REPLACE_TRANS_ACTION %tutu_var%prism BEGIN 9 END BEGIN 0 END ~GiveItem("%tutu_var%MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF")
GiveItem("abgfEyeR","GREYWOLF")
SetGlobal("abgf_GemInEye","GLOBAL",3)~ //anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

APPEND %tutu_var%prism
IF ~NumTimesTalkedTo(0)
!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStole
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL")
TakePartyItem("abgfEyeR")
CreateCreature("GREYWO",[1267.2579],0)
ClearAllActions()
StartCutSceneMode()
StartCutScene("Prismcut")~ EXIT
END
IF ~HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~!HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)
PartyHasItem("abgfEyeL")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftStole
 SAY ~My Emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END
IF ~!HasItem("abgfEyeL",Myself)
!HasItem("abgfEyeR",Myself)
!PartyHasItem("abgfEyeL")
!PartyHasItem("abgfEyeR")
Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothStoleButGone
 SAY ~My Emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 8
END

IF ~HasItem("abgfEyeL",Myself)
HasItem("abgfEyeR",Myself)~ THEN stillworking
SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
COPY_TRANS %tutu_var%prism 1
END
END//end the append

oublek_addBG.d (can be out into oublek.d for a BG-only install):
Code: [Select]
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism

ADD_TRANS_ACTION prism BEGIN 3 8 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 12:32:49 PM
Quote
BG1:
I have a weird behaviour. If I make a quick save before talking to Prism the first time, and then load the save, Prism doesn't have the custom emeralds. I know he had them for the game I saved, because I played the quest. When I load that save, he gives his "You! You took my emerlads" speech. This is really weird.

The "Prism initiates dialogue to prevent the player to open container" doesn't work 100% for me. Sometimes, the party thief remains in a greater distance ("hangs") but the container still opens. I tried adding a "Clicked([ANYONE])" ot the container script but either I did it wrong or it doesn't work:
For the first part, make a save prior to entering the area for the first time.  That can save some hassle from any wonkiness that might go on due to changes in the component between tests.

for the second part, i know that can happen...
we could try increasing the range that Prism sees.  He's got the code to move him back to spot if the party member moves out of range.  Just don't increase it too much.  Just enough that it would seem like he's noticed you approaching his work area.  Otherwise he's oblivious to whats going on cause he is focused on getting the statue done.

stupid me decided to clean up my drive a bit.  uninstalled bunch of the IE games etc... (do i really need to have 3 versions of BG installed?  no, just keep one for standard work and only install a vanilla version to test with after major changes :P ) i saved the fixpack but forgot to keep the game saves so i gotta replay from the beginning  :(

side note:  if you have 5521 version and 'downgrade' to 5512 to use the widescreen mod your mission pack save file becomes incompatible.
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 12:51:42 PM
To the save wonkiness: After every new install, I start with a save where I haven't been to AR5400 yet, then I cheat there (and walk and walk and walk...) to Prism.
Once reaching him, I do a quicksave I want to use for several test runs.
If continuing directly, he has the emeralds. If I load that quicksave, they are gone.

Maybe give them to him via his or the area script?

Btw: I don't have saves, either. I am cheating my way through to the places I want to be. It's tedious if the opponents are rather strong and my PC keeps dying.
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 01:15:16 PM
Quote
Btw: I don't have saves, either. I am cheating my way through to the places I want to be. It's tedious if the opponents are rather strong and my PC keeps dying.
SwordCoast Keeper FTW  or for BG2 variants  Shadow Keeper  ^^
I load the start save up in that, give max exp and better gear if i want, then just go thru the areas till i'm there. ^^

Quote
If continuing directly, he has the emeralds. If I load that quicksave, they are gone.
THAT is odd and should not happen at all. The items are on his cre file after the mod is installed, a quick  save should not remove them.  I'll test that out too and see if it repeats for me
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 04:03:29 PM
I de-tutu-ified the code you provided above, installed it, hurried protagonist and imoen to nashkel, spoke with oublek (tho that isn't necessary), went to edge of map & saved
used swordcoast keeper to max exp on the party members. loaded the modified save, leveled them up, and saved again.
went into mines area, walked down to prism, quick saved with him in sight.
imoen managed to unlock both containers AND i had try to move her closer before prism 'saw' her
spoke with prism and refused him, spoke again and accepted this to guard him, killed greywolf, got gems from eyes.
went back to oublek and turned them in one at a time.

loaded the quick save, and had imoen pick prism's pockets.  she got both gems.

loaded quick save again, spoke with prism and agreed to let him finish the statue, killed greywolf and got gems from the eyes.



I can not repeat the issue that you were having with your quick save not having the gems present with prism....


what i can do tho is tweak the dialog initiation stuff a bit so that he'll interrupt a player trying to open the containers
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 04:12:16 PM
I know it's weird thing but I had the gem disappearing for two individual quick-saves where they were there first and then after reloading Prism's first dialogue was about that they are stolen, or the message upon pick-pocketing that there were no objects of value.

Well, I guess it's good you don't have that problem although that makes it an individual glitch of my install I am not sure I like those.  :P

EDIT or maybe I am just too stupid to actually load the quicksave and not another real save also in front of Prism but appearently without any gems because in BG1 the quicksave is not at the bottom but at the top - OK, please forget about that report, I think that was rather stupidity on my side. everything is working now.

Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 04:44:49 PM
well okay then  :P

one possible scenario needs to be addressed:

pickpocket prism, stash the gems somewhere, forget about 'em, talk to prism again, he bemoans the loss and that the statue won't be done, remember the gems, go get them, talk to prism again, all he'll say is that the statue won't be done...


tweaked prism's initiation a bit:
I changed the range check value to 4.  seems to work much better.  more likely to get him to walk after the player, but his script will force him to go back to his location if the player moves far enough away.
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 05:00:56 PM
For the case you mentioned: Easy fixable for tutu/BGT by making a new dialogue state. etcpp.
For BG: The eyes have to be "protected" until it is clear the gems are gone forever. The only way to know is to check for Oublek's variables, I guess. Until then, the containers cannot be emptied, thus Prism has to block the containers. And additional state is necessary for Prism to recognize and beg for the gems. You are aware of the fact that probably 0.000007% of the players will see this, though. Not saying that's a reason to skip it, I am all for closing possible loose ends.

Another nice to have: If Prism gets hotile due to other reaons than dialogue (e.g. failure of pickpocketing) the container need to be closed for BG1.
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 05:12:10 PM
For the case you mentioned: Easy fixable for tutu/BGT by making a new dialogue state. etcpp.
For BG: The eyes have to be "protected" until it is clear the gems are gone forever. The only way to know is to check for Oublek's variables, I guess. Until then, the containers cannot be emptied, thus Prism has to block the containers. And additional state is necessary for Prism to recognize and beg for the gems. You are aware of the fact that probably 0.000007% of the players will see this, though. Not saying that's a reason to skip it, I am all for closing possible loose ends.
thought it would be easy for tutu/bgt
already trying it for BG, but i keep hitting snags.  checking for oublek's variables isn't feasible as the player could actually sell the gems.

I'm thinking BG needs to just leave it as is.  leave a note in the readme that if the player steals the gems and stashes 'em that if they talk to prism again without the gems then it'll be impossible to give the gems back for prism to finish the statue. at that point they'll just have to sell them or turn them in and miss out on the 1400 exp and that magic sword.
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 05:17:39 PM
Sounds good. I really think that not much would put them somewhere with the will of retrieving them again later, actually.

In case you didn't see my edit above:
Quote
Another nice to have: If Prism gets hotile due to other reaons than dialogue (e.g. failure of pickpocketing) the container need to be closed for BG1.
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 05:18:26 PM
oh i forgot...

I tweaked the journal entries in the trap script to read from player view using 'I' instead of party view with 'we'  figured it'll help with those who solo, plus it is supposed to be the protagonists journal rather than the parties.

so here it is:  (of course you'll traify it later on)
Code: [Select]
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",1)
THEN
  RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",2) //2 is only 1 gem taken from statue
  ReputationInc(-1) //only one rep point loss in total cause it reverts the rep point gain given by letting him finish the work
  AddJournalEntry(~Perhaps it was wrong, but after allowing Prism to complete his 'final masterpiece' I've taken one of the emeralds out of the statue's eyes. It should bring a hefty price at the right place or a decent reward...~)
END
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",2)
THEN
RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",3)
  AddJournalEntry(~After a bit of hard work, I finally removed the second emerald which Prism had stolen to use in one of the eyes of his 'final masterpiece'.~)
END
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 05:29:08 PM
cross posting FTW  \o/

Quote
Another nice to have: If Prism gets hotile due to other reaons than dialogue (e.g. failure of pickpocketing) the container need to be closed for BG1.
that's easily doable by adding a block to prism's initiation script.  Tho i think that (and you can test it) there can't ever be a failed pick pocket that turns hostile.

Why?
player has to move within 4 to pick his pocket.  prism will see them. he has a wait of 3 before going to talk BUT the variable was already set.
so
if player stays in place, Prism will talk to them
if player moves out of range, the first script block kicks in clears Prism's actions (his attempt to talk, his turning hostile, etc) and makes him move back to starting point if he moved.

I've had several failed attempts with Imoen picking his pockets and not once did he turn hostile.

Still to be safe, we can put a block in there
not tested, but it should work if you can get him to turn hostile ^^
Code: [Select]
IF
  See([PC])
  !Range(LastSeenBy,4)
  Global("abgf_PrismTalk","LOCALS",1)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
    SetGlobal("abgf_PrismTalk","LOCALS",0)
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !StateCheck(LastSeenBy,STATE_INVISIBLE)
  !StateCheck(LastSeenBy,STATE_IMPROVEDINVISIBILITY)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Wait(3)
    Dialogue([PC])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

IF
  Allegiance(Myself,ENEMY)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
Title: Re: Offering new component for UB
Post by: jastey on February 24, 2012, 05:32:37 PM
Ah, I had him turn hostile but of course it was for the older version with Range(1). Will try this tomorrow!
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 05:45:20 PM
Ah, I had him turn hostile but of course it was for the older version with Range(1). Will try this tomorrow!
you can always just attack him ^^  but why would your LG character do that  :P
Title: Re: Offering new component for UB
Post by: plainab on February 24, 2012, 06:25:36 PM
aside from closing off the containers if prism is turned hostile before player lets him put the gems in the statue, need to close 'em off if prism is attacked and dies while still a blue circle.  so prism's script is modified further (needs testing, but should work)
Code: [Select]
IF
  See([PC])
  !Range(LastSeenBy,4)
  Global("abgf_PrismTalk","LOCALS",1)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
    SetGlobal("abgf_PrismTalk","LOCALS",0)
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !StateCheck(LastSeenBy,STATE_INVISIBLE)
  !StateCheck(LastSeenBy,STATE_IMPROVEDINVISIBILITY)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Wait(3)
    Dialogue([PC])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

//if turned hostile
IF
  Allegiance(Myself,ENEMY)
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
//if died while blue circle
IF
  Die()
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
the use of global variable allows these blocks to only be valid when the player has not gone thru the process of letting prism complete the statue (variable set to 1 when prism kills himself)

EDIT:  I installed with the above script.  killed prism right off the bat.  he had the gems and so they dropped.  tried to open the containers, they were still locked.  But after imoen unlocked them, they were empty and the trap script did not trigger.
my guess  Unlock() does not work on containers in BG.  might want to try PickLock() instead  (i know that works from my work with thieving actions in party scripts)

EDIT.2:  PickLock() doesn't work either presumably because Prism doesn't have the skill.  shouldn't hurt to give him enough points in the skill...

EDIT.3: even giving prism 100 in lockpicking the container locks still did not get unlocked.  unless you can figure something out, BG is just gonna have to deal with empty but locked eye containers when prism dies but hasn't put the gems into the eyes...
Title: Re: Offering new component for UB
Post by: jastey on February 25, 2012, 12:45:23 AM
unlock() worked in my BG when applied via dialogue. I will try your script extention and let you know.
Title: Re: Offering new component for UB
Post by: jastey on February 25, 2012, 01:32:42 AM
but why would your LG character do that  :P
With all my mods I spent minimum of 70% of the time to cover reactions my PC would never do (they were usually CG, btw. ;) ). Implementing the idea and the path I had in mind is usually quick. And then it takes another 4 weeks to implement all the "what if the player"s. (The last page of this thread is a good example for this.)
Title: Re: Offering new component for UB
Post by: jastey on February 25, 2012, 07:37:43 AM
We need something that hinders Prism to follow the party members around. Or, if he did, something that makes him return to his place once the dialogue triggered. Because once he triggered the dialogue with walking to a party member, he is in range and keeps on initiating dialogue instead of returning to his spot. I made him trigger his dialogue several times always chosing the reply option that leads to no action, and Prism turned out to be a bit persisting following my PC around..
Title: Re: Offering new component for UB
Post by: plainab on February 25, 2012, 07:57:11 AM
We need something that hinders Prism to follow the party members around. Or, if he did, something that makes him return to his place once the dialogue triggered. Because once he triggered the dialogue with walking to a party member, he is in range and keeps on initiating dialogue instead of returning to his spot. I made him trigger his dialogue several times always chosing the reply option that leads to no action, and Prism turned out to be a bit persisting following my PC around..
really?  I always got him to go back, but then I'd get close or steal from him and then click right at the edge of the screen.  he may have moved a little but always turned around and went right back.

he doesn't differentiate between party members so if you've got several members and he moves towards one and another is suddenly in range that could cause him to keep going with the dialog attempt rather than moving back.

maybe a range check on the statue containers as well...  first have to find the distance he is from them, but after doing so then we could set it up so that if he moves too far away from the containers he will go back...  might be better than dependent upon party member range.  still need party member range to initiate the check but not to make him stop going after 'to talk'

I'll look into that, but we got people coming over today...  so i make no guarantees that anything gets done...
Title: Re: Offering new component for UB
Post by: jastey on February 25, 2012, 08:08:14 AM
It's not so much that he follows, it's more that he is away from the statue and keeps on initiating dialogue, instead of returning to his place. Range check for the containers would be one solution, or maybe just make him move to his point every time after he initiated dialogue, before initiating the next.
Title: Re: Offering new component for UB
Post by: plainab on February 25, 2012, 08:17:14 AM
It's not so much that he follows, it's more that he is away from the statue and keeps on initiating dialogue, instead of returning to his place. Range check for the containers would be one solution, or maybe just make him move to his point every time after he initiated dialogue, before initiating the next.
that's the purpose of the 1st block in his script.  if PC is out of range he should stop and move back to his spot before attempting any further dialogs.   but i suppose if he caught up to you and had the dialog, then he might not go back...
Title: Re: Offering new component for UB
Post by: plainab on February 25, 2012, 11:11:36 AM
got some time to work on it a bit today.

realized that if the player managed to steal a gem without prism noticing that they could go and sell or turn in that gem, yet there wouldn't be anything that would specifically address such situation.  So I added a layer of text that should allow branching out to different statuses of the gems.  and as such needed to make a new state that would be the "if the gems are gone and he is still alive" state.  because state 8 would still be true but under other circumstances as well, I needed to put in weighting.

not got time to test it at the moment but will do so later to day. if everything works well, I'll pass it along for your testing

EDIT ^^
Here we go:
First off some adjustments
1) an additional set of statements by prism when player steals the gems.  since he wasn't to have noticed, he asks the player if they've seen 'em.  player will fess up, but depending upon the status of the gem player either gets to give them back or kill prism for the other or player tells him tough luck they are gone.
2) a journal entry is added when the player tells prism the 'tough luck' reply
3) prism kept trying to talk at all times the player is in range. not good for the fight with greywolf or after they were stolen and the gems removed from the eyes.  so the initiation script block now checks against the global variable that is set when the gems were stolen and not returned.  so state 8 doesn't get spammed to the player.  Not yet figured out how to keep prism from talking during the greywolf fight yet....
4) even tho prism will initiate talk while the player has yet to open the container, the player's action is still there and if the player chooses 2nd option then 2nd option again and gets out of the dialog with Prism still alive, the container will still open up for the player.  So additional states added to check for Prism still having the gems AND the player having either one.  Prism again will interrupt the player opening the 2nd container and be so mad at the destruction of the statue that he'll attack the player outright.  in the end player gets the 1st gem from the container and the 2nd gem from off of Prism's body
5) state reordering to help with which calls up when... &  script block reordering as well
6) Unlock works in dialog but not in script it seems  :(   I think most cases of prism going hostile are covered in dialog with the container clearing codes but a blue circle death is gonna leave the containers locked for sure.

the modified codes
prism's script
Code: [Select]
IF
  See([PC])
  !Range(LastSeenBy,4)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(2)
    Dialogue([PC])
END

//if turned hostile
IF
  Allegiance(Myself,ENEMY)
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
    Attack(NearestEnemyOf(Myself))
END
//if died while blue circle
IF
  Die()
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
the dialog changes
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~Global("OublekBounty2","GLOBAL",0) PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0) !PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemStoleResolve","GLOBAL",1) Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkR
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~They're gone! They're missing! My emeralds are missing! You! You there did you take them? Do you know where they went?~
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole them when you weren't looking.~ GOTO abBothStoleButGone
 IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole them when you weren't looking.~ GOTO abBothStole
END

//prism initiates if left gem is missing and asks where it went
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeL")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeL")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abLeftStole
END

//prism initiates if right gem is missing and asks where it went
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abRightStole
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStole
 SAY ~My emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR")~ THEN BEGIN abRightStole
 SAY ~My emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL")~ THEN BEGIN abLeftStole
 SAY ~My emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") CreateCreature("GREYWO",[1267.2579],0) ClearAllActions() StartCutSceneMode() StartCutScene("Prismcut")~ EXIT
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStoleButGone
 SAY ~My emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN REPLY ~Not possible. I gave it to the authorities.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN REPLY ~Not possible. I gave it to the authorities.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
END

END//end the append

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~
//gives a journal entry to prism and the emeralds when they've been pickpocketed
ALTER_TRANS prism BEGIN 8 END BEGIN 0 END BEGIN "Journal" ~That fool Prism really should keep better watch over his work area. I snagged some gems while he wasn't looking. Loss for him. Profit for me.~ END
test all that out, see what you think...
Title: Re: Offering new component for UB
Post by: jastey on February 26, 2012, 07:43:21 AM
to 3): Maybe add a Range(Greywolf) !Dead(Greywolf) (or the opposite of it) to prevent triggering during the fight.
Title: Re: Offering new component for UB
Post by: plainab on February 26, 2012, 10:17:10 AM
I tried !Exists("Greywo")  but that didn't work.

I set a new global variable for when Greywolf is created and check against that in the offending dialog state that Prism was using.

technically Prism still initiates dialog but only spouts his sound file (no interruption of combat etc).  Is that ok?  Or should I move that variable check to the initiation script itself and prevent the audio file from being played too?   

hmm  seems better to have him silent during the fight than possibly spamming sounds :P  so we'll do that then ^^

also added a rep loss for when the player gets caught taking gems from the eye.  player does not get a rep loss if they somehow manage to not get caught (which isn't possible cause he interrupts both attempts to take from the eyes)

i wondered about when prism is charmed... he's got not charmed state so his dialog should still flow normally right?

anywho...  updated files
dialog changes
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~Global("OublekBounty2","GLOBAL",0) PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0) !PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemStoleResolve","GLOBAL",1) Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~

ADD_TRANS_ACTION prism BEGIN 4 END BEGIN 0 END ~SetGlobal("abCalledGreywolf","GLOBAL",1)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
//rep loss of 1 if you take a gem from the statue and get caught by prism.
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkR
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeR") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abCalledGreywolf","GLOBAL",0)~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~They're gone! They're missing! My emeralds are missing! You! You there did you take them? Do you know where they went?~
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole them when you weren't looking.~ GOTO abBothStoleButGone
 IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole them when you weren't looking.~ GOTO abBothStole
END

//prism initiates if left gem is missing and asks where it went
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeL")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeL")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abLeftStole
END

//prism initiates if right gem is missing and asks where it went
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abRightStole
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStole
 SAY ~My emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY #4750 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY #4751 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR")~ THEN BEGIN abRightStole
 SAY ~My emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL")~ THEN BEGIN abLeftStole
 SAY ~My emerald! You! You took it! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 3
END

IF ~~ THEN BEGIN abRelent
  SAY #678
  IF ~~ THEN DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") SetGlobal("abCalledGreywolf","GLOBAL",1) CreateCreature("GREYWO",[1267.2579],0) ClearAllActions() StartCutSceneMode() StartCutScene("Prismcut")~ EXIT
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStoleButGone
 SAY ~My emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN REPLY ~Not possible. I gave it to the authorities.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN REPLY ~Not possible. I gave it to the authorities.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~ GOTO 8
END

END//end the append

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~
//gives a journal entry to prism and the emeralds when they've been pickpocketed
ALTER_TRANS prism BEGIN 8 END BEGIN 0 END BEGIN "Journal" ~That fool Prism really should keep better watch over his work area. I snagged some gems while he wasn't looking. Loss for him. Profit for me.~ END
had a copy paste error where if player took the right gem from the eye then got caught, prism would destroy the left gem from his person rather than the right gem...

prism's script for talk initiation etc...
Code: [Select]
IF
  See([PC])
  !Range(LastSeenBy,4)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
  !Global("abCalledGreywolf","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(2)
    Dialogue([PC])
END

//if turned hostile
IF
  Allegiance(Myself,ENEMY)
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
    Attack(NearestEnemyOf(Myself))
END
//if died while blue circle
IF
  Die()
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
everything else should still be the same (i think)  let me know if there are any further issues after your rounds of testing
Title: Re: Offering new component for UB
Post by: jastey on February 26, 2012, 01:58:18 PM
Instead of custom state "abRelent" the original state 4 could be used if the transfer of the gems is done in the transition from the reply option? Just a thought for compatibility reasons (in case another mod wants to change the Greywolf creation or something).
Title: Re: Offering new component for UB
Post by: jastey on February 26, 2012, 02:18:18 PM
Made a quick run and let Imoen retrieve one of the gems out of the eye. Prism initiated dialogue as intended with turning hostile.

Prism once walked up to my PC to initiate a dialogue, but returned to his spot after that.

Looks good so far!
Title: Re: Offering new component for UB
Post by: plainab on February 26, 2012, 02:26:56 PM
Instead of custom state "abRelent" the original state 4 could be used if the transfer of the gems is done in the transition from the reply option? Just a thought for compatibility reasons (in case another mod wants to change the Greywolf creation or something).

reason i made it separate is that the player has the gems taken back from them as well...  so the actions are slightly different
I don't know how to do COPY_TRANS and add in new actions at the same time...  if you know how to do that...
only other thing i could think of is giving Prism something else to say, take the gems and then forward on to state 4....
Title: Re: Offering new component for UB
Post by: jastey on February 27, 2012, 06:29:10 AM
Oh, in principal you can use COPY_TRANS in a custom state to double the original state's actions and then do ADD_TRANS_ACTION to your custom state in the same d to add some more. I don't want to do that here, as it would still double the Greywolf-cutscene, though. What I meant was putting the custom actions in the transition to state 4 and get rid of the custom state, i.e. instead of

Quote
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO abRelent

it is

Quote
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN REPLY ~All that is yours, eh?  So be it.~ DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") SetGlobal("abCalledGreywolf","GLOBAL",1) SetGlobal("ab_GemStoleResolve","GLOBAL",1)~ GOTO 4

and the state "abRelent" can be deleted. I think this should work with all the actions being transformed properly. I will try it out, though, to be sure the engine doesn't eat the TakePartyItem when starting the cutscene or something like that. EDIT: And whether TakePartyItem works the way I think it does - meaning it's the non-party member that gets the items. I will test.
Title: Re: Offering new component for UB
Post by: jastey on February 27, 2012, 07:10:33 AM
The transition works as intended (at least in my test). The only thing I have (not strong) objections to is the "only one reply option" reply here:

Quote
//prism initiates if right gem is missing and asks where it went
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeR")~ THEN REPLY ~Why yes, I stole it when you weren't looking.~ GOTO abRightStole
END
If there is no choice, don't make a reply option, as it feels forced. Either add a "choice" like "Yes, I took it", "Who, me?", "Oh, that was yours?", etc. Or I would suggest a direct transition to the following state, i.e:

Quote
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeR")~ THEN GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeR")~ THEN GOTO abRightStole
END

Maybe tweak the line a bit, too, as Prism currently kind of repeats the "~My emerald! You! You took it!".
Title: Re: Offering new component for UB
Post by: plainab on February 27, 2012, 08:08:00 AM
as i said dialog is not my strong point

when the player picks prism's pockets:
prism needs to cover the following possibilities
left gem taken, right gem in hand -- player has left gem
left gem taken, right gem in hand -- player stashed/sold left gem
left gem taken, right gem in hand -- player turned in left gem for bounty
right gem taken, left gem in hand -- player has left gem
right gem taken, left gem in hand -- player stashed/sold left gem
right gem taken, left gem in hand -- player turned in left gem for bounty
left gem taken, right gem taken -- player has both gems
left gem taken, right gem taken -- player stashed/sold both gems
left gem taken, right gem taken -- player turned them in for bounty
and i suppose out of fullness sake he should notice the following tho the statements don't have to be the same.
left gem taken, right gem taken -- player has left gem, stashed/sold right gem
left gem taken, right gem taken -- player has left gem, turned in right gem for bounty
left gem taken, right gem taken -- player has right gem, stashed/sold left gem
left gem taken, right gem taken -- player has right gem, turned in left gem for bounty

I didn't like the idea of using
~My emeralds! You! You took them! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
(and similar) as an initiation string because it assumes that Prism saw them take them.  Since there is a wait in place before the dialog and it is totally possible for the player to move out of talking range and swing by later, I need Prism to be worried about the gem(s) being gone and so ask the player if they know anything about what happened.  that's why I put in the other state.
They're gone! They're missing! My emeralds are missing! You! You there did you take them? Do you know where they went?~
sounds much better as an initiation string.  but there isn't enough information from Prism at this point to direct the player to deciding to give them back to let him finish the statue.

I had to have the player reply with something to get to the proper states since i didn't know that you can do direct goto's without a reply to choose which way you wanted to go

i'll see what i can do....  maybe hopefully come up with something simpler.

Title: Re: Offering new component for UB
Post by: jastey on February 27, 2012, 10:11:48 AM
If the code syntax was the main reason for you to put reply options then I say skip them. I wouldn't mind Prism to jump to conclusions: His world consist of his emeralds, his statue and Greywolf. He assumes the PC to be Greywolf in the original game, so I think he would assume anyone being there has taken his gems.
Title: Re: Offering new component for UB
Post by: plainab on February 27, 2012, 10:44:25 AM
ok took your suggestion with the transition to state 4.
added some additional options and adjusted text a bit.

Also prism's script is set to notice that the gems are gone and if both are gone add a journal entry about the player having stolen the gems.

needs testing but everything should work.
the dialog changes
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~Global("OublekBounty2","GLOBAL",0) PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0) !PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemStoleResolve","GLOBAL",1) Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~

ADD_TRANS_ACTION prism BEGIN 4 END BEGIN 0 END ~SetGlobal("abCalledGreywolf","GLOBAL",1)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
//rep loss of 1 if you take a gem from the statue and get caught by prism.
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR") Global("ab_GemsTrulyGone","GLOBAL",0)~ THEN BEGIN abMidWorkR
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeR") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems & player never tried to loot the eyes
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abCalledGreywolf","GLOBAL",0)~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~They're gone! They're missing! My emeralds are missing! You! You there did you take them? Do you know where they went?~
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 REPLY ~You sure are slow on the uptake. Took those things some time ago.~
 GOTO abBothStoleButGone
 IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Would these be what you are looking for?~
 GOTO abBothStole
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~~ THEN
 REPLY ~I have no clue what you are talking about.~
 GOTO 8
END

//prism initiates if left gem is missing and asks where it went
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeL")~ THEN
 REPLY ~You sure are slow on the uptake. Took that thing some time ago.~
 GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeL")~ THEN
 REPLY ~Would this be what you are looking for?~
 GOTO abLeftStole
 IF ~~ THEN
 REPLY ~I have no clue what you are talking about.~
 GOTO 8
END

//prism initiates if right gem is missing and asks where it went
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~It's missing! It's missing! My emerald is missing! You! You there did you take it? Do you know where it went?~
 IF ~!PartyHasItem("abgfEyeR")~ THEN
 REPLY ~You sure are slow on the uptake. Took that thing some time ago.~
 GOTO abNotGetBackEver
 IF ~PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Would this be what you are looking for?~
 GOTO abRightStole
 IF ~~ THEN
 REPLY ~I have no clue what you are talking about.~
 GOTO 8
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStole
 SAY ~My emeralds! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4750
  DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 4
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4751
  DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 3
END

IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeR")~ THEN BEGIN abRightStole
 SAY ~My emerald! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeR") SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 4
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 3
END

IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) PartyHasItem("abgfEyeL")~ THEN BEGIN abLeftStole
 SAY ~My emerald! I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeL") SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 4
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1)~
  GOTO 3
END

IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN BEGIN abBothStoleButGone
 SAY ~My emeralds! I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~Global("OublekBounty2","GLOBAL",1)~ THEN
  REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~
  DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~
  DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~~ THEN
  REPLY ~The gems may be gone, but I'll gladly take all else that is yours. Prepare to die.~
  DO ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") Enemy()~
  EXIT
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 DO ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") Enemy()~
 EXIT
END

IF ~~ THEN BEGIN abBothStoleButOneGone
 SAY ~Give me the one you have. Go get the other and bring it back. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemStoleResolve","GLOBAL",1) SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 DO ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") Enemy()~
 EXIT
END

END//end the append
prism's script
Code: [Select]
IF
  !HasItem("abgfEyeL",Myself)
  Global("abPrismLEyeGone","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("abPrismLEyeGone","GLOBAL",1)
END

IF
  !HasItem("abgfEyeR",Myself)
  Global("abPrismREyeGone","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("abPrismREyeGone","GLOBAL",1)
END

IF
  Global("abPrismLEyeGone","GLOBAL",1)
  Global("abPrismREyeGone","GLOBAL",1)
THEN
  RESPONSE #100
    AddJournalEntry(~That fool Prism really should keep better watch over his work area. I snagged some gems while he wasn't looking. Loss for him. Profit for me.~)
END

IF
  See([PC])
  !Range(LastSeenBy,4)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
END

IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
  !Global("abCalledGreywolf","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(2)
    Dialogue([PC])
END

//if turned hostile
IF
  Allegiance(Myself,ENEMY)
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
    Attack(NearestEnemyOf(Myself))
END
//if died while blue circle
IF
  Die()
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
and you posted while i was working on all this  LOL  takes up time when you are watching Doctor Who in the middle of composing a post :P   If you can shorten it but make sure all angles of prism & player having/not having gems are covered that would be great.  otherwise I think this will do.

reason i did the global checks in the script was i had originally thought to use them in the dialog file, but realized that doing so was the same as using combinations of hasitem and partyhasitem checks.  i suppose it could be shorted down to the hasitem checks rather than the global...
Title: Re: Offering new component for UB
Post by: jastey on February 27, 2012, 11:09:56 AM
Having different reply options is fine. Thank you for adding those! I will make a quick test run myself. (I should stop Tutu-ing the whole thing until you call it final..)

What did you men with the globals? Do you mean there are variables set that aren't really needed? In that case it would be great to "clean" the code again.
Title: Re: Offering new component for UB
Post by: plainab on February 27, 2012, 12:01:58 PM
Quote
What did you men with the globals? Do you mean there are variables set that aren't really needed? In that case it would be great to "clean" the code again.
ok ok i'll go 'clean' it and test it a little (at least the installation of it).
Title: Re: Offering new component for UB
Post by: plainab on February 27, 2012, 02:04:34 PM
ok cleaned it up.
you were right that the dialog was kinda redundant in places
the container now forces prism to initiate dialog.
prism's script will cause him to initiate dialog with a wait of 1 and range of 4 if either or both gems are taken off his person.
else he will not initiate if you approach him.
it is possible to pickpocket and run out of range.

give it a try and see what you think.  i hope this can make it done...
dialog changes
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~Global("OublekBounty2","GLOBAL",0) PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
IF ~Global("OublekBounty2","GLOBAL",0) !PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("BroughtBounty","GLOBAL",1)~
THEN REPLY ~I've come to turn in a bounty, and collect the reward that is duly mine.~ GOTO 14
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~

ADD_TRANS_ACTION prism BEGIN 4 END BEGIN 0 END ~SetGlobal("abCalledGreywolf","GLOBAL",1)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
//rep loss of 1 if you take a gem from the statue and get caught by prism.
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",1)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeR") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems & player never tried to loot the eyes
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_BrokeInto","GLOBAL",0) Global("abCalledGreywolf","GLOBAL",0)~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~Hold! You took my emeralds. I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",1)~ THEN
  REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4750
  DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4751
  GOTO 3
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~~ THEN
 REPLY ~What is this? Some madman accusing me of thievery? Die for your insults.~
 GOTO 3
END

//prism initiates if left gem is missing
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeL")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeL")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

//prism initiates if right gem is missing
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeR")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

IF ~~ THEN BEGIN abBothStoleButOneGone
 SAY ~Give me the one you have. Go get the other and bring it back. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SeSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

END//end the append
prism's  script
Code: [Select]
IF
  See([PC])
  Range(LastSeenBy,4)
  !HasItem("abgfEyeL",Myself)
  !HasItem("abgfEyeR",Myself)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(1)
    Dialogue([PC])
END
IF
  See([PC])
  Range(LastSeenBy,4)
  !HasItem("abgfEyeL",Myself)
  HasItem("abgfEyeR",Myself)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(1)
    Dialogue([PC])
END
IF
  See([PC])
  Range(LastSeenBy,4)
  HasItem("abgfEyeL",Myself)
  !HasItem("abgfEyeR",Myself)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(1)
    Dialogue([PC])
END
IF
  See([PC])
  !Range(LastSeenBy,4)
  !HasItem("abgfEyeL",Myself)
  !HasItem("abgfEyeR",Myself)
  Global("abgf_BrokeInto","GLOBAL",0)
  Global("abgf_StolenJEntry","GLOBAL",0)
THEN
  RESPONSE #100
    AddJournalEntry(~That fool Prism really should keep better watch over his work area. I snagged some gems while he wasn't looking. Loss for him. Profit for me.~)
    SetGlobal("abgf_StolenJEntry","GLOBAL",1)
END
IF
  See([PC])
  !Range(LastSeenBy,4)
THEN
  RESPONSE #100
    ClearActions(Myself)
    MoveToPoint([641.2713])
END
/*
IF
  Dead("Greywolf")
  See([PC])
  Range(LastSeenBy,4)
THEN
  RESPONSE #100
    SetGlobal("abgf_PrismTalk","LOCALS",1)
    Dialogue([PC])
END

IF
  See([PC])
  Range(LastSeenBy,4)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
  !Global("abCalledGreywolf","GLOBAL",1)
THEN
  RESPONSE #100
    Wait(2)
    Dialogue([PC])
END
*/
//if turned hostile
IF
  Allegiance(Myself,ENEMY)
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
    Attack(NearestEnemyOf(Myself))
END
//if died while blue circle
IF
  Die()
  Global("abgf_GemInEye","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("A6StatueRightEye")
    Unlock("A6StatueLeftEye")
    ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR"))
    ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))
END
the trap script
Code: [Select]
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",0)
  !Global("ab_GemsTrulyGone","GLOBAL",1)
THEN
  RESPONSE #100
    SetGlobal("abgf_BrokeInto","GLOBAL",1)
    ActionOverride("Prism",Dialogue([PC])
END
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",1)
THEN
  RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",2) //2 is only 1 gem taken from statue
  ReputationInc(-1) //only one rep point loss in total cause it reverts the rep point gain given by letting him finish the work
  AddJournalEntry(~Perhaps it was wrong, but after allowing Prism to complete his 'final masterpiece' I've taken one of the emeralds out of the statue's eyes. It should bring a hefty price at the right place or a decent reward...~)
END
IF
  Opened([ANYONE])
  Global("abgf_GemInEye","GLOBAL",2)
THEN
RESPONSE #100
  SetGlobal("abgf_GemInEye","GLOBAL",3)
  AddJournalEntry(~After a bit of hard work, I finally removed the second emerald which Prism had stolen to use in one of the eyes of his 'final masterpiece'.~)
END
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 07:20:29 AM
Cool changes. I'll test it out.

BGT compatibility will be a bit of work: oublek.dlg is changed slightly. State 14 is only for handing in Brage's body (no TakePartyItem("misc43")), and for the gems there is a new state 30. States 10 checks for OublekBounty1/2 in the appropriate states. Do you want me to post the dlg?
Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 08:59:03 AM
Cool changes. I'll test it out.

BGT compatibility will be a bit of work: oublek.dlg is changed slightly. State 14 is only for handing in Brage's body (no TakePartyItem("misc43")), and for the gems there is a new state 30. States 10 checks for OublekBounty1/2 in the appropriate states. Do you want me to post the dlg?
no i trust once the BG version is settled that you'll be able to convert to TuTu and BGT as needed including separating necessary pieces of code into 2-3 parts if need be.  The Tutu & BGT versions are fully yours to tweak and adjust within the spirit of the mod. the BG version you can always ask me to look into, tho its not that big of a deal if you need to make minor adjustments.

BGT & probably Tutu too won't need the 'exploit fix' at the top of the dialog file. you'll have to check on that.  as for the state changes that BGT does.  it wouldn't be so hard to pull this line out:
Code: [Select]
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
and put it into either a separate .d file for each platform OR put it into the .tp2/.tph file within the file brackets for each platform
Code: [Select]
<<<<<<<<
>>>>>>>>
BGT's (based on what you said) line should be:
Code: [Select]
REPLACE_TRANS_ACTION oublek BEGIN 30 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 09:17:00 AM
OK; I'll deal with the BGT version then, later.

plainab: I understand that you want to cut the reward for players that played "not nice" with Oublek, but the way it is now seems rather unstisfactory imho. I don't want to annoy you with more criticizm, but now it goes: Turn in one gem, and the whole quest is dead. Second gem cannot be handed in, it cannot even be presented to Oublek. No final journal entry. That's a bit, well. Not perfect. I would be more in favor of Oublek recognizing and taking the missing gem, but maybe not giving any reward. If you insist on him not taking Brage's body, at least some line as to why would be nice, too. Can the dead Brage be brought somewhere else in the original game? If not, Oublek should definitely react to that.

My point is: I can understand Oublek doesn't want to reward the player after he lied to him, but the bounties are open (and it is not up to Oublek to decide about skipping them, is it?), and the cases have to be resolved. I don't think Oublek would just ignore this because he has a grudge against the PC (how would he explain this to the authorities).
Also the quests should be solvable (not saying there has to be a reward.) for the player.
Last and least: Oublek sais "(...) We shall store the extra in case you decide to...alter the facts in any further dealings." which sounds like an invitation to bring more open bounties. Currently, the component makes the quest seem somewhat unfinished in this regard.
Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 09:43:04 AM
that's due to the exploit fix I'd imagine...  try commenting out the top portion where the OublekBounty1 and OublekBounty2 global checks are added.  then test the mod out and see if all options with Oublek work properly.

it's not my intent to make the player suffer like that, that was Bioware's intent.  tho without the exploit fix in check i think the player could have turned in the gems individually for twice the reward on the 'bad side'  Probably why BGT moved the gems from the brage part....

I put in the ability for the player to turn in just one gem, but go to the same reward state just like all of the other bounty turn in options for the 'bad boy' side.
I wondered if the exploit fix would cause issues....

to be honest, the exploit fix shouldn't be necessary for the mod to work BUT a way has to be figured out to work with it or to reverse it....


Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 11:21:57 AM
i  just checked the original unmodified oublek.dlg

it doesn't have the checks for OublekBounty1 & OublekBounty2 only check for BroughtBounty which is used to signify that the player was denied payment for pretending to be Greywolf.  all states go to the same action and set the OublekBounty1 & 2 globals so Oublek knows which ones are done and which not.  Oublek provides no journal entry for the player who pretended to be Greywolf other than at the first request to claim bounty. 

So the journal resolution thing is an issue in the vanilla game itself.  Since all the bounties on the 'bad boy side' go to the same action, there can't be a journal string.

********************
so
state 10 extended to add for player to get half reward if they had claimed to be greywolf
new script blocks added to ar4800 area script to give basic journal entry that player was rewarded tho at reduced amount if claimed to be greywolf.

as far as what Oublek says in state 14, you can't change that without splitting brage from prism and doing that goes beyond the scope of the mod.
scope of the mod is to be able to get the gems from the eyes, not have any exploits by turning them in individually, and be able to have a believable end if the player manages to pick pocket the gems.

should still work with the exploit fix in place as the half rewards don't set the OublekBounty variable till both have been turned in....

installed without errors at least:
dialog changes:
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END
//half reward states for those pretending to be greywolf
IF ~~ THEN BEGIN abBBLeftEye
  SAY ~One of the Emeralds! It is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting. I shall pay you, though less than the posted amount. Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBRightEye
  SAY ~One of the Emeralds! It is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting. I shall pay you, though less than the posted amount. Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBLeftEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBRightEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY #4656 GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY #4656 GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBRightEyeLast
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~

ADD_TRANS_ACTION prism BEGIN 4 END BEGIN 0 END ~SetGlobal("abCalledGreywolf","GLOBAL",1)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
//rep loss of 1 if you take a gem from the statue and get caught by prism.
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",1)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeR") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems & player never tried to loot the eyes
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_BrokeInto","GLOBAL",0) Global("abCalledGreywolf","GLOBAL",0)~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~Hold! You took my emeralds. I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",1)~ THEN
  REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4750
  DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4751
  GOTO 3
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~~ THEN
 REPLY ~What is this? Some madman accusing me of thievery? Die for your insults.~
 GOTO 3
END

//prism initiates if left gem is missing
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeL")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeL")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

//prism initiates if right gem is missing
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeR")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

IF ~~ THEN BEGIN abBothStoleButOneGone
 SAY ~Give me the one you have. Go get the other and bring it back. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SeSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

END//end the append
area script for 4800:
Code: [Select]
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
Global("Greywolf","GLOBAL",0)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Prism's story was a sad tale indeed.  A shame it could not have had a better ending.  Ah well, I profit in the end.  300 gold bounty for the emeralds he stole.~)
END
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
Global("Greywolf","GLOBAL",1)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded for turning in the emeralds from Prism.~)
END
IF
Global("Greywolf","GLOBAL",1)
Global("OublekBounty1","GLOBAL",1)
THEN
RESPONSE #100
  AddJournalEntry(~Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded for turning in Captain Brage.~)
END
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 01:04:17 PM
Very cool, I think that's what I wanted.
I think the "OublekBounty2" variable should be set here, too:Scrab that i didn't see the area script.

Quote
IF ~~ THEN BEGIN abBBLeftEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBRightEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 01:08:33 PM
area script: I think this would also fire in case the PC (after lying to Oublek) turns in both gems at once (state 14)?
EDIT: Maybe just make one journal entry stating "Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded". Although that would be bad for Tutu/BGT where there are journal entry headers.  (*scratches head*)

Quote
IF
Global("Greywolf","GLOBAL",1)
Global("OublekBounty1","GLOBAL",1)
THEN
RESPONSE #100
  AddJournalEntry(~Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded for turning in Captain Brage.~)
END
Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 02:12:35 PM
Quote
area script: I think this would also fire in case the PC (after lying to Oublek) turns in both gems at once (state 14)?
that was considered.  that's why there is one block which checks for the greywolf variable to be 0 and the other checks for it to be 1.  the third block gives a journal entry for Brage just so you've got some sort of 'finish' there in the journal.

I'd thought about having just one journal string BUT 1) brage can be resolved in a different manner 2) BGT & Tutu would need them separate so that the journal entries can be moved between journal sections much easier.
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 02:21:26 PM
Quote
the third block gives a journal entry for Brage just so you've got some sort of 'finish' there in the journal.
What I meant is that "OublekBounty1" gets also set if the player hands in both gems at once, in state 14, but didn't turn in Brage. In that case, this journal entry about Brage's reward will be written, too, I think, if the area script block only checks for "OublekBounty1" = 1?
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 03:44:30 PM
OK, finally understood why this is correct. Sorry!No, I tsill think this will also fire for handing in the games only and Greywolf = 1. I am confused.
Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 03:48:55 PM
Quote
the third block gives a journal entry for Brage just so you've got some sort of 'finish' there in the journal.
What I meant is that "OublekBounty1" gets also set if the player hands in both gems at once, in state 14, but didn't turn in Brage. In that case, this journal entry about Brage's reward will be written, too, I think, if the area script block only checks for "OublekBounty1" = 1?
you are right, it would.  i didn't think about that...  simple

add to .d file
Code: [Select]
ADD_TRANS_ACTION oublek BEGIN 10 END BEGIN 1 END ~SetGlobal("abTurnedInBrage","GLOBAL",1)~
add to the script block a trigger check for said variable...  should work


oh before i forget, you don't have to stick with the full prefix on files and stuff if you don't want to (or can't for some reason).  my registered prefix is 'ab'  for the fixpack i combine 'ab' with 'bgf' (bgf = baldurs gate fixpack) to make 'abgf' for new files/variables

edit: left off a ~ in the code line -- fixed
Title: Re: Offering new component for UB
Post by: jastey on February 28, 2012, 03:58:15 PM
Would you post the final files? Just to make sure I don't overlook something.

I might change the prefix to ub, but if it's OK with you I might just leave it - changing file and variable names only introduces new bugs if i overlook something. It is possible, though.
Title: Re: Offering new component for UB
Post by: plainab on February 28, 2012, 04:16:50 PM
Quote
Would you post the final files? Just to make sure I don't overlook something.
not tested install mind you, but should work

dialog file
Code: [Select]
//OublekBounty1 is for brage
//OublekBounty2 is for prism
//the oublekbounty globals will prevent any exploits by dropping a second item and trying to get the full reward again
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0)~ DO 0 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty2","GLOBAL",0)~ DO 1 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 9 ~Global("OublekBounty1","GLOBAL",0) Global("OublekBounty2","GLOBAL",0)~ DO 4 UNLESS ~Global("OublekBounty2","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty1","GLOBAL",0)~ DO 1 5 UNLESS ~Global("OublekBounty1","GLOBAL",0)~
ADD_TRANS_TRIGGER ~oublek~ 10 ~Global("OublekBounty2","GLOBAL",0)~ DO 9 5 UNLESS ~Global("OublekBounty2","GLOBAL",0)~

//changing from one item to two ensures that players can not take advantage of dropping one item and trying to get the full reward twice
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 1 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 9 END BEGIN 4 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 9 END ~PartyHasItem("MISC43")~ ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~
REPLACE_TRANS_TRIGGER oublek BEGIN 10 END BEGIN 5 END ~!PartyHasItem("MISC43")~ ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 14 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~TakePartyItem("MISC43")~ ~~
REPLACE_TRANS_ACTION oublek BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~

//allow journal entries to work around brage in "bad boy" path
ADD_TRANS_ACTION oublek BEGIN 10 END BEGIN 1 END ~SetGlobal("abTurnedInBrage","GLOBAL",1)~

//adding new states that give half the reward when only one item gets turned in
APPEND oublek
IF ~~ THEN BEGIN abLeftEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEye
  SAY ~One of the Emeralds! That will be a 150 gold bounty for you.  Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abLeftEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abRightEyeLast
  SAY ~The last of the Emeralds! That will be another 150 gold bounty for you. Well, you'll make quite a name for yourself among the bounty hunters if you keep this up.  Whether it is for better or worse, I do not know.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(100) GivePartyGold(150) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END
//half reward states for those pretending to be greywolf
IF ~~ THEN BEGIN abBBLeftEye
  SAY ~One of the Emeralds! It is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting. I shall pay you, though less than the posted amount. Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBRightEye
  SAY ~One of the Emeralds! It is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting. I shall pay you, though less than the posted amount. Be sure to bring the other if you should find it.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBLeftEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeL") SetGlobal("abgf_LeftEyeBounty","GLOBAL",1)~ EXIT
END
IF ~~ THEN BEGIN abBBRightEyeLast
  SAY ~The last of the Emeralds! Well, it is good to see you attempting to earn honest gold, even if it is through the unsavory task of bounty hunting.  I shall pay you, though less than the posted amount.  We shall store the extra in case you decide to...alter the facts in any further dealings.~//this is custom text
  IF ~~ THEN DO ~AddexperienceParty(250) GivePartyGold(75) TakePartyItem("abgfEyeR") SetGlobal("abgf_RightEyeBounty","GLOBAL",1) ~ EXIT
END

END //end the append

//adding additional transitions that allow the player to turn in only one of the two required items for good boy
EXTEND_BOTTOM oublek 9
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY #4656 GOTO abLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0)~
THEN REPLY #4656 GOTO abRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abRightEyeLast
END //end the extend bottom

//adding additional transitions that continue to keep 'bad boy' player from getting full reward. If they turn in only one gem, they get rewarded but can't turn in the other or resolve brage issue with oublek. It is an overall punishment when compared to 'good boy' rewards.
EXTEND_BOTTOM oublek 10
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBLeftEye
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",0) Global("abgf_RightEyeBounty","GLOBAL",0) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBRightEye
IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_RightEyeBounty","GLOBAL",1) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBLeftEyeLast
IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("abgf_LeftEyeBounty","GLOBAL",1) Global("BroughtBounty","GLOBAL",1)~
THEN REPLY #4656 GOTO abBBRightEyeLast
END //end the extend bottom

//adjustments needed for prism to work with the rest of the component
ADD_STATE_TRIGGER prism 0 ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~

//REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 moved to separate files for BGT+Tutu / BG
REPLACE_TRANS_ACTION prism BEGIN 7 END BEGIN 0 END ~DropInventory()~
~DestroyItem("abgfEyeL") DestroyItem("abgfEyeR") SetGlobal("abgf_GemInEye","GLOBAL",1)~

//Make sure the containers are empty if Prism can't put in the gems any more.
//ONLY apply if the emeralds really cannot be returned to Prism
//state 3 is where player attacks prism so gems need removed from eyes
//state 8 is where player has previously stolen the gems from off of Prism so gems need removed from eyes
//state 9 is where player backed off and let Greywolf have Prism & the gems so gems need removed from eyes
ADD_TRANS_ACTION prism BEGIN 3 8 9 END BEGIN 0 END ~Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL"))~

//set state 8 to be a repeat state if prism is talked to again after the gems were stolen and no longer retrievable
ADD_STATE_TRIGGER prism 8 ~Global("ab_GemsTrulyGone","GLOBAL",1)~

REPLACE_TRANS_ACTION prism BEGIN 9 END BEGIN 0 END ~GiveItem("MISC43","GREYWOLF")~
~GiveItem("abgfEyeL","GREYWOLF") GiveItem("abgfEyeR","GREYWOLF") SetGlobal("abgf_GemInEye","GLOBAL",3)~

ADD_TRANS_ACTION prism BEGIN 4 END BEGIN 0 END ~SetGlobal("abCalledGreywolf","GLOBAL",1)~
//anything not one means that either the gems were not in container when obtained OR the penalty was applied
//only way to get items if player allowed greywolf to attack prism is to attack greywolf before prism is dead and hopefully kill him before he runs away.

//allow prism to return to correct location after having moved to catch up with player
ADD_TRANS_ACTION prism BEGIN 5 8 END BEGIN 0 END ~ActionOverride("Prism",MoveToPoint([641.2713]))~

APPEND prism
//if prism still has both gems but player managed to get one of them out of the statue before prism initiates dialog
//rep loss of 1 if you take a gem from the statue and get caught by prism.
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",1)~ THEN BEGIN abMidWorkL
 SAY ~How dare you! How dare you take the sparkle from her eyes!~
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeL") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) DestroyItem("abgfEyeR") Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
 IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1) ReputationInc(-1) Unlock("A6StatueRightEye") Unlock("A6StatueLeftEye") ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) Enemy()~
 JOURNAL ~I managed to take some emeralds that the sculptor Prism was using as eyes in a statue. However, he had noticed me. I was forced to put him out of his misery after he lunged at me with a chisel.~
 EXIT
END
//if prism still has both gems & player never tried to loot the eyes
IF ~HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) !PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("abgf_BrokeInto","GLOBAL",0) Global("abCalledGreywolf","GLOBAL",0)~ THEN BEGIN stillworking
 SAY ~I've much work to do. But mayhaps you would help a foolish sculptor finish this epiphany now?  Please, guard this place, for surely Greywolf will come.  I will pay with my last possessions!~
 COPY_TRANS prism 1
END

//prism initiates if both are missing and asks where they went
IF ~!HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0)~ THEN BEGIN abBothGone
 SAY ~Hold! You took my emeralds. I must have them back. I need them to finish this epiphany. Please, please return them. I will give you all else that is mine.~
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",1)~ THEN
  REPLY ~They are gone. Given to the authorities. You will never finish that lump of stone now.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~!PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~They are gone. Sold by now to hang on the neck as some fat woman's trinket.~
  DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
  GOTO 8
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4750
  DO ~TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY #4751
  GOTO 3
 IF ~PartyHasItem("abgfEyeL") !PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~!PartyHasItem("abgfEyeL") PartyHasItem("abgfEyeR")~ THEN
 REPLY ~Aye, I took them. Still have one. The other tho is long gone.~
 GOTO abBothStoleButOneGone
 IF ~~ THEN
 REPLY ~What is this? Some madman accusing me of thievery? Die for your insults.~
 GOTO 3
END

//prism initiates if left gem is missing
IF ~!HasItem("abgfEyeL",Myself) HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abLeftGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeL")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeL") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeL")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

//prism initiates if right gem is missing
IF ~HasItem("abgfEyeL",Myself) !HasItem("abgfEyeR",Myself) Global("abgf_BrokeInto","GLOBAL",0) Global("ab_GemStoleResolve","GLOBAL",0)~ THEN BEGIN abRightGone
 SAY ~Hold! You took my emerald. I must have it back. I need it to finish this epiphany. Please, please return it. I will give you all else that is mine.~
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~All that is yours, eh?  So be it.~
  DO ~TakePartyItem("abgfEyeR")~
  GOTO 4
  IF ~PartyHasItem("abgfEyeR") Global("OublekBounty2","GLOBAL",0)~ THEN
  REPLY ~"All else that is yours" does not concern me.  I'm taking you and the gems to the guard, where I shall get a hefty reward.~
  GOTO 3
  IF ~!PartyHasItem("abgfEyeR")~ THEN
  GOTO abNotGetBackEver
  IF ~~ THEN
  REPLY ~I know not what you are talking about.~
  EXIT
END

IF ~~ THEN BEGIN abBothStoleButOneGone
 SAY ~Give me the one you have. Go get the other and bring it back. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

IF ~~ THEN BEGIN abNotGetBackEver
 SAY ~Give it back please. I must finish this epiphany. I will give you all else that is mine.~
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SeSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",1) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",0)~ THEN
 REPLY ~Not possible. Sold to some forgotten merchant or stashed in some forgotten place.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~I gave it to the authorities. You shall never get it back.~
 DO ~SSetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 8
 IF ~Global("abgf_RightEyeBounty","GLOBAL",0) Global("abgf_LeftEyeBounty","GLOBAL",1)~ THEN
 REPLY ~Not possible. I gave it to the authorities and have come back to claim the other for its bounty.~
 DO ~SetGlobal("ab_GemsTrulyGone","GLOBAL",1)~
 GOTO 3
 IF ~~ THEN
 REPLY ~The gem may be gone, but I'll gladly take all else that is yours. Prepare to die.~
 GOTO 3
END

END//end the append

area script
Code: [Select]
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
Global("Greywolf","GLOBAL",0)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Prism's story was a sad tale indeed.  A shame it could not have had a better ending.  Ah well, I profit in the end.  300 gold bounty for the emeralds he stole.~)
END
IF
Global("abgf_LeftEyeBounty","GLOBAL",1)
Global("abgf_RightEyeBounty","GLOBAL",1)
Global("OublekBounty2","GLOBAL",0)
Global("Greywolf","GLOBAL",1)
THEN
RESPONSE #100
  SetGlobal("OublekBounty2","GLOBAL",1)
  AddJournalEntry(~Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded for turning in the emeralds from Prism.~)
END
IF
Global("Greywolf","GLOBAL",1)
Global("OublekBounty1","GLOBAL",1)
Global("abTurnedInBrage","GLOBAL",1)
THEN
RESPONSE #100
  AddJournalEntry(~Next time I shall have to remind myself not to pretend to be another just for some quick gold. Though Oublek kept part, I was finally rewarded for turning in Captain Brage.~)
END
Title: Re: Offering new component for UB
Post by: plainab on February 29, 2012, 10:06:44 PM
so i installed BG2 and set up an easytutu game.
decided to try this thing over on easytutu. of course i  had to change names etc... but as i was going thru and testing things, I keep running across issues that I don't notice in BG cause filenames aren't different.  so a few .tp2 corrections as well as having to add stuff due to traifying the dialog.

I'll get a finalized tutu version and ensure that the BG works smoothly too especially in those specific situations.  now i'm not good at the tutu var thing, so i just did separate files which is good cause tutu uses the extra journal stuff and that means different script files anyway...

EDIT: having to deal with the solved & unsolved journal entries for tutu has led me to figure out a way to use oublek's dialog file for the journal entries rather than modifying the area script. so yey one less thing to mess with \o/
Title: Re: Offering new component for UB
Post by: plainab on March 01, 2012, 07:09:11 AM
new day, new post \o/  LOL

thanks to dealing with EasyTutu & the solved/unsolved journal strings plus traifying the mod, I found errors and better ways of doing things.

for starters Prism is only forced to initiate if player tries to loot the eyes prior to the greywolf scenario, or if player picks his pocket.
player has options to deny knowing anything about it, if they do after successfully picking the 2nd gem they'll get a journal entry, otherwise they won't.

only journal strings added via script now are the 2 strings when looting the eyes after the greywolf scenario.

this is to be considered finalized as far as i'm concerned.  BGT compatibility i think would just require targets to state 14 being moved to state 30 (or whatever they changed it to). IF you want to play with the container enable/disable stuff that's fine, tho i think if you give it a try you'll like what happens.

here is a packaged 7zip file which contains BG & Tutu support: http://sasha-altherin.webs.com/mods/abPrismEmeralds.7z (http://sasha-altherin.webs.com/mods/abPrismEmeralds.7z)
Title: Re: Offering new component for UB
Post by: Salk on March 01, 2012, 08:23:51 AM
Good job!  ;)
Title: Re: Offering new component for UB
Post by: jastey on March 01, 2012, 12:44:47 PM
Thank you very much! I will have a look at it and make it BGT-compatible.
Title: Re: Offering new component for UB
Post by: jastey on March 03, 2012, 07:57:49 AM
plainab: The journal title for Prism in BGT is "Prism, the emerald thief." so I changed it to that to make it consistent.

Concerning the Tutu/BGT version: I would prefer if the containers are just switched to be disabled / enabled. Your workaround for BG1 is very elegant, but since the BGII engine has this feature I would say we use it. What do you say?
Title: Re: Offering new component for UB
Post by: plainab on March 03, 2012, 04:53:31 PM
plainab: The journal title for Prism in BGT is "Prism, the emerald thief." so I changed it to that to make it consistent.

Concerning the Tutu/BGT version: I would prefer if the containers are just switched to be disabled / enabled. Your workaround for BG1 is very elegant, but since the BGII engine has this feature I would say we use it. What do you say?
I pretty much already gave you permission.
Quote
IF you want to play with the container enable/disable stuff that's fine, tho i think if you give it a try you'll like what happens.

Maybe you could give players an option at install time?
Quote
Install: Prism - Emeralds in the Eyes
1) Lootable at any time 
2) Lootable only after 'complete'
the first would be how i've done it with the BG work around
the 2nd would be your version with the container enable/disable feature

BG games wouldn't get the option only tutu/bgt

feel free to  provide better descriptive component/sub-component names  :P

one other thing...
Is it possible to disable getting exp from opening the containers in tutu/bgt. allowing other containers of course if that's what players want just disabling those two.  doesn't seem right to me to get exp for opening the eyes.


as far as journal title... 
you changed the title for tutu or added in new strings to the tra for bgt with it's title?

BGT's title sounds better than tutu's I'd almost recommend changing tutu's to match, including those already in place from the conversion process.
Title: Re: Offering new component for UB
Post by: jastey on March 04, 2012, 02:52:00 AM
Quote
I pretty much already gave you permission.
If I hadn't ask the idea of a choice wouldn't have come up. :) I will give Tuu/BGT players the choice then.

How do I disable the exp. for opening a specific container? *panic*

And now i feel dumb: The journal title in your package is the EasyTutu title? Then of course I will use that one for the Tutu-install. Changing the ingame-ones would be an idea, but that would be another tweak I am not sure is in the scope of this mod.

Title: Re: Offering new component for UB
Post by: plainab on March 04, 2012, 08:34:57 AM
Quote
I pretty much already gave you permission.
If I hadn't ask the idea of a choice wouldn't have come up. :) I will give Tuu/BGT players the choice then.
touche

Quote
How do I disable the exp. for opening a specific container? *panic*
idk that's why i asked

Quote
And now i feel dumb: The journal title in your package is the EasyTutu title? Then of course I will use that one for the Tutu-install. Changing the ingame-ones would be an idea, but that would be another tweak I am not sure is in the scope of this mod.
yes it is the EasyTutu title.  and changing in game journal titles to match for both versions was just a passing thought, nothing to be acted upon unless you wished to do so.
Title: Re: Offering new component for UB
Post by: Miloch on March 07, 2012, 11:46:38 PM
Either UB or jastey's BGQE (I forget which I looked at) titles all journal entries, and does not bother removing them for BG1 installs (because BG1 typically has no journal entry titles). Personally, I don't think it's worth worrying about for BG1. If anything, the tweak could go the other way (title all journal entries for BG1) - having a few entries with titles in BG1 is no big deal IMO.

Nevermind - didn't read the history for that comment :P. As for disabling Xp for a single container, I don't know if you can, aside from maybe trapping that with a negative XP malus (if even that's possible in BG1). But that's another thing I probably wouldn't worry about.
Title: Re: Offering new component for UB
Post by: jastey on March 11, 2012, 07:44:32 AM
Quote
I will give Tuu/BGT players the choice then.
Argh, I just realized I'd need: two Tutu versions (one with enabling the containers, one using the BG1 version), two BGT versions (as it is slighty different especially regarding oublek.dlg), and the BG1 version..

Sorry for making false promises but I will just stick to the disable/enable case for Tutu/BGT, as it makes implementing and testing a lot easier.  :-[

The XP for opening the eyes for BGT/Tutu we have to live with, I guess. It's the price for having lock difficulties.
Title: Re: Offering new component for UB
Post by: plainab on March 11, 2012, 09:45:54 AM
Quote
I will give Tuu/BGT players the choice then.
Argh, I just realized I'd need: two Tutu versions (one with enabling the containers, one using the BG1 version), two BGT versions (as it is slighty different especially regarding oublek.dlg), and the BG1 version..

Sorry for making false promises but I will just stick to the disable/enable case for Tutu/BGT, as it makes implementing and testing a lot easier.  :-[

The XP for opening the eyes for BGT/Tutu we have to live with, I guess. It's the price for having lock difficulties.
not so hard as you may think...

You already have the BG method & Tutu version of the BG method (I linked them to you in an earlier post). You yourself are converting it into the container/enable method.  So as long as you don't overwrite the Tutu files with the BG2 changes you will already have the two methods available for Tutu.   For BGT, just copy those two Tutu setups and change file names & journal titles as needed.
Title: Re: Offering new component for UB
Post by: jastey on March 11, 2012, 10:21:10 AM
I know, but this is a maintaining catastrophy - I know from experience that my willingness to fix reported bugs is inversely proportional to the number of mostly-similar files I have to keep track of.
Title: Re: Offering new component for UB
Post by: plainab on March 11, 2012, 02:49:34 PM
I know, but this is a maintaining catastrophy - I know from experience that my willingness to fix reported bugs is inversely proportional to the number of mostly-similar files I have to keep track of.
oh I see...

well given my familiarity with the project you could always shoot me a PM if you needed help squashing any bugs should something arise...  tho i'd need exact details as to the reporting players setup and what they did so that I could try replicating the problem.

let me ponder some possibilities that I think may help reduce the # of 'mostly-similar files'
Title: Re: Offering new component for UB
Post by: jastey on March 11, 2012, 03:14:17 PM
Thanks! I didn't mean to imply I am expecting bug reports, though. It is more of a principle thought. And if I wouldn't be so excited about the enabling/disabling feature in the BGII engine, I wouldn't try to have it by all means and just use your version..
Title: Re: Offering new component for UB
Post by: plainab on March 11, 2012, 04:55:51 PM
do you have a library already in place for variable substitution for between the 3 platforms?

something like you have for journal entry stuff as you pointed out to Miloch here (http://forums.gibberlings3.net/index.php?showtopic=24107&view=findpost&p=198880)

If so could you please share?  thanks

EDIT: realized that may not be clear enough...   I'm referring to changes between file names...
Title: Re: Offering new component for UB
Post by: jastey on March 11, 2012, 05:59:51 PM
You mean the crossmod %tutu_var% stuff?  Cannot attach right now (wrong computer). In the current download there is a lib with OUTER_SPRINT for area file names etcpp., I think.
Title: Re: Offering new component for UB
Post by: plainab on March 11, 2012, 06:18:46 PM
yeah I'd read up in the thread (first page) where Miloch had mentioned it was there.  pulled it out and took a look at.  it's been helpful.  I  just hope my little idea works  :P

won't know till I actually get to test the install...
Title: Re: Offering new component for UB
Post by: plainab on March 11, 2012, 09:49:45 PM
I think I've got something that works for all platforms, does both methods and has only 1 copy of each file to be maintained.

course there are 4 library files containing variables specific to each platform.  I used the same names as the ones you'd shared (in the G3 thread) cause they were based off of that but they can easily be renamed to prevent confusion.  And there are method specific variables listed under the appropriate subcomponent options.

Also do note that the EraseJournalEntry() substitution thing did not work for me.  I still had to copy & decompile the file and do a replace to get the strings to show up.  However the solved & unsolved journal variable substitution did work fine.

Please put it thru it's paces. I only tested installation and examination of files.  I did not test in game behavior.

Should work for BG, BG-ToTSC, BGT, & all variants Tutu

http://sasha-altherin.webs.com/mods/abPrismEmeraldsv2.7z (http://sasha-altherin.webs.com/mods/abPrismEmeraldsv2.7z)

EDIT:  if you can get the journal entries to behave properly, that would be cool.  perhaps there was something I missed but it just wasn't working for me.
Also corrected the add journal entries, didn't realize that the QUEST & QUEST_DONE variables were meant for that...  so if you already got it before I edited the post, you need to get it again sorry.
Title: Re: Offering new component for UB
Post by: jastey on March 12, 2012, 03:08:55 AM
Very cool. I will have a look at it.
Title: Re: Offering new component for UB
Post by: plainab on April 03, 2012, 09:46:39 PM
so was playing BGT with a bunch of mods and I included this Prism component to get a feel as to how it fit in etc...

ran into a scenario that needs to be addressed.  tho testing in BG1 indicated it was ok.

first to be on even footing, I installed the BG1 style option.

situation was this:
Montaron went in to pickpocket and got a gem, he bluffed his way out and left.
He then went in to pickpocket the other gem, he failed.  Prism turned hostile and the party killed him.
The container's were not unlocked and the gems stayed inside.

Perhaps in my testing I gave more time for him to process his scripts etc...  Or BG1 handles variables differently than BG2.

One of these script blocks should have been triggered.
Code: [Select]
IF
Allegiance(Myself,ENEMY)
Global("abgf_GemInEye","GLOBAL",0)
THEN
RESPONSE #100
Unlock("A6StatueRightEye")
Unlock("A6StatueLeftEye")
ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) // Emerald
ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) // Emerald
Attack(NearestEnemyOf(Myself))
END

IF
Die()
Global("abgf_GemInEye","GLOBAL",0)
THEN
RESPONSE #100
Unlock("A6StatueRightEye")
Unlock("A6StatueLeftEye")
ActionOverride("A6StatueRightEye",DestroyItem("abgfEyeR")) // Emerald
ActionOverride("A6StatueLeftEye",DestroyItem("abgfEyeL")) // Emerald
END
Could it be the fact that these two blocks are at the bottom of the script be an issue?  Should they be at the top instead?

Is this something you can test prior to releasing? 
It shouldn't hurt to move them both to the top of the script.
Also might be a good idea to change the global check to a negative.  Its set to 3 in the dialog file if they're supposed to stay inside the containers.
Who knows maybe BG2 engine doesn't see it as 0 if it hasn't been set yet, tho that would be fishy as there are many scripts that use a 0 value for those which aren't yet set
Title: Re: Offering new component for UB
Post by: jastey_guest on April 04, 2012, 02:36:32 AM
I once learned that the "Die()" commant can fail if the creature dies too fast, i.e. if the script block doesn't run in exact that moment. So, putting them on top of the file would be good, I think. Later someone said it isn't quite as that so I am confused. Did you test it several times in a row?

To be sure and safe, the two checks could be added to the area script, instead, with Dead() check (instead of Die(), obviously).

The variable handling is the same in BGII, variable =0 works if the variable wasn't set yet.

Also: I notice in the posted script blocks, that the checking variable doesn't get set? The blocks loop that way. If Prism is hostile, the Die() block never gets executed (intheory, it doesn't have to, but looping script blocks are never good). If the "abgf_GemInEye" variable is needed elsewhere, a variable should be added to the block(s), especially if putting them on top of the file.
The looping shouldn't have prevented the emptying of the eyes, though.

Another question: If one gem is pick-pocketed, shouldn't also one gem of the eyes be destroyed instantly? Can't recall whether this is covered, just a thought because you wrote that the gems in the eyes are still there after one was stolen from Prism?
Title: Re: Offering new component for UB
Post by: plainab on April 04, 2012, 08:21:28 AM
Quote
Another question: If one gem is pick-pocketed, shouldn't also one gem of the eyes be destroyed instantly? Can't recall whether this is covered, just a thought because you wrote that the gems in the eyes are still there after one was stolen from Prism?
its done via dialog, but the option to 'bluff' your way out doesn't do anything about the gems.  because as long as player has one and prism has one there is still the option for the player to give it back and go through the scenario with greywolf.  so the gems still need to be there in the container.

this is only the case on the BG1 style.  The BG2 style keeps the containers disabled until needed.

Quote
Also: I notice in the posted script blocks, that the checking variable doesn't get set? The blocks loop that way. If Prism is hostile, the Die() block never gets executed (intheory, it doesn't have to, but looping script blocks are never good). If the "abgf_GemInEye" variable is needed elsewhere, a variable should be added to the block(s), especially if putting them on top of the file.
The looping shouldn't have prevented the emptying of the eyes, though.
It gets set to 3 in dialog so that these blocks don't trigger else it's possible that when he kills himself in the scenario with greywolf that the Die() block will trigger.  I suppose they could be set to 1 if either one happens... Could using the SPRITE_IS_DEAD variable check be of use here instead of Die()?

Quote
I once learned that the "Die()" commant can fail if the creature dies too fast, i.e. if the script block doesn't run in exact that moment. So, putting them on top of the file would be good, I think. Later someone said it isn't quite as that so I am confused. Did you test it several times in a row?
No.  I didn't have saves setup for testing of Prism.  didn't even think about it.  I was just passing by and thought, hmm  Monty has decent pickpocket skills, lets try.  Then as an after thought, I checked the containers.  At least the variables were properly set to not do a rep loss in that case. 

Fixpack testing of container traps indicate that container scripts parse just as often as all other scripts in game.  Could it be useful to add a Dead() check there as a back up?  I want to avoid making as many changes to existing files as possible, only adjust what I need to tie into.  The more you tamper with game files the more you risk incompatibilities.
Title: Re: Offering new component for UB
Post by: plainab on April 04, 2012, 11:56:45 AM
There are more issues with the BGT version than I thought.

My fault for assuming that both would be using the same actions

the change where both gems are taken at once (in either path) doesn't get applied to Oublek because BGT changes GivePartyGold into GiveGoldForce.  So as it is now, the party still gets the gold but the gems aren't taken at all  :(

gonna have to redevelop the platform specific code.  good thing I made a clean BGT install.  i can clua and test things there

edit: didn't take long to work out the vars.  just need time to test, then repack & re-upload

edit2... and i jump the gun.  a clean bgt install uses GivePartyGold.  there must be another mod that changes it -.-

Quote
Mods affecting OUBLEK.DLG:
00000: /* from game biffs */ ~SETUP-BGT.TP2~ 0 0 // Baldur's Gate Trilogy - Core: 1.14 (28 Jan 12)
00001: /* acted upon in an indetectable manner */~SETUP-BGT.TP2~ 0 0 // Baldur's Gate Trilogy - Core: 1.14 (28 Jan 12)
00002: /* acted upon in an indetectable manner */~SETUP-BGT.TP2~ 0 0 // Baldur's Gate Trilogy - Core: 1.14 (28 Jan 12)
00003: /* from game biffs */ ~BG1NPC.TP2~ 0 1 // The BG1 NPC Project: Banters, Quests, and Interjections: v20
00004: ~GAVIN/GAVIN.TP2~ 0 0 // Gavin NPC for Tutu and BGT, 14April2008: v8
00005: ~AURORA/SETUP-AURORA.TP2~ 0 257 // Change quest gold rewards -> Fixes only: v5
00006: ~ABPRISMEMERALDS/ABPRISMEMERALDS.TP2~ 0 0 // Prism and the Emeralds Tweak -> BG Style
and the culprit is Aurora.  easiest is to insist on Aurora being installed after UB, but i suppose a check can be put in.  tho Aurora would want to "fix" what I add I'm sure....

guess Miloch needs to chip in here now
Title: Re: Offering new component for UB
Post by: Miloch on April 04, 2012, 01:16:11 PM
Aurora's quest rewards fix component addresses issues where a certain reward is promised but the .cre hasn't the funds to deliver the reward, thus we change GivePartyGold to GiveGoldForce. Ordinarily, UB would be installed before Aurora (if you follow the Tutu/BWP install guides, Aurora readme etc.). But if you're aiming for maximum compatibility, you should account for whatever mods may have changed the dialogue, which should be fairly easy to do in this case anyway.

Die() checks need to be Continue()d if there are multiple such checks, which you can never be sure of due to mods etc. Otherwise only the first Die() will execute (and should be the first or at least an early block in the script blocks). StateCheck("cre",4032) is a more reliable check, but is usually triggered from scripts other than the creature running the script. Dead() does not always capture some death states, hence the StateCheck(..,4032) checks all of them.

I think these blocks make more sense in the area script as far as unlocking containers etc. The Attack behaviour is probably already in his default script, or belongs there anyway. If Enemy() then attack nearest enemy is pretty standard... Not sure who that's supposed to refer to though. Greywolf has a standard wtasight attack script, whereas Prism has a standard wtrunsgt runaway script, both of which I think are appropriate (I don't see Prism going on the offensive like Greywolf would if provoked.)
Title: Re: Offering new component for UB
Post by: plainab on April 04, 2012, 02:12:25 PM
Quote
Aurora's quest rewards fix component addresses issues where a certain reward is promised but the .cre hasn't the funds to deliver the reward, thus we change GivePartyGold to GiveGoldForce. Ordinarily, UB would be installed before Aurora (if you follow the Tutu/BWP install guides, Aurora readme etc.). But if you're aiming for maximum compatibility, you should account for whatever mods may have changed the dialogue, which should be fairly easy to do in this case anyway.

But Prism isn't part of UB yet.  UB (both of them) were installed before Aurora.  I forgot about Prism till after Aurora.

And yes there should be a check, just in case someone does something stupid like I did.  I've never put in checks for a specific mod's component before.  I've already got a variable for it, just need to know what the check would be in this case...


******
I am confused tho.  How does Oublek qualify for such a change by Aurora?  He starts with 3000 gold in the fixpacked only BGT and even if you include the 1k forced gold & all the GivePartyGold actions despite that not all of them will be possible he has 950 gold left over.  Unless you are compensating for pickpocketing him there is no reason to make the adjustment.... 
Title: Re: Offering new component for UB
Post by: Miloch on April 04, 2012, 02:43:53 PM
Dunno what exactly you're doing via code (I can only see one page up while posting and the only code I see is the aforementioned script block) but I don't know that you need to check for a specific mod. If you're doing some sort of REPLACE_* on GivePartyGold then just duplicate it for GiveGoldForce under the same terms. If it's there, it will be replaced too, if not, it will do nothing.

I don't want to digress too much on Aurora here since it has little to do with UB (apart from the mirror restoration etc. mentioned in another thread), but you may want to read the Components section in the readme and also the ag_quest*.tpa files in the mod's lib folder. In short, we nerf a handful of CREs who have over-the-top gold amounts (to prevent uberlooting exploits, yes, Oublek being one); in any case, we would have to account for the "Change creature gold carried" component which could potentially reduce a quest-giver's gold below what they're promising despite other changes in the quest gold component. (In retrospect, now that I look at the code, we should've used REPLACE_ACTION_TEXT or the like instead of DECOMPILE/REPLACE_TEXTUALLY on .dlg files, but that is even more irrelevant here. I suspect we weren't fully aware of those commands at the time and/or they can be somewhat counterintuitive to use since they require compiling .d pseudofiles... by "we" I mean GeN1e/Ardanis and I, since I can't take sole credit for these components.)

Edit: if you really do need to detect the component, it's probably best to use BUFFER_INDEX or the like to look for GiveGoldForce in the .dlg file. You could also use ACTION/PATCH_IF MOD_IS_INSTALLED setup-aurora.tp2 241 ... 257, but that is more cumbersome in this case, due to the number of alternative subcomponents that do similar things. I vaguely recall asking the bigg for a MOD_IS_INSTALLED subcomponent catchall but don't know if it was ever implemented.
Title: Re: Offering new component for UB
Post by: plainab on April 04, 2012, 03:36:05 PM
so this then will be okay to do without any sort of checks against other mods?
Code: [Select]
REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN %BGT_DiffState% END BEGIN 0 END ~GivePartyGold(150)~ ~GivePartyGold(150) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") %ERASEJOURNALENTRY_0% %ERASEJOURNALENTRY_1% %ERASEJOURNALENTRY_2% %ERASEJOURNALENTRY_3% %ERASEJOURNALENTRY_4% %ERASEJOURNALENTRY_5%~
REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN %BGT_DiffState% END BEGIN 0 END ~GiveGoldForce(150)~ ~GiveGoldForce(150) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") %ERASEJOURNALENTRY_0% %ERASEJOURNALENTRY_1% %ERASEJOURNALENTRY_2% %ERASEJOURNALENTRY_3% %ERASEJOURNALENTRY_4% %ERASEJOURNALENTRY_5%~
and in another spot
Code: [Select]
REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN 4 END BEGIN 0 END ~GivePartyGold(300)~ ~GivePartyGold(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") %ERASEJOURNALENTRY_0% %ERASEJOURNALENTRY_1% %ERASEJOURNALENTRY_2% %ERASEJOURNALENTRY_3% %ERASEJOURNALENTRY_4% %ERASEJOURNALENTRY_5%~
REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN 4 END BEGIN 0 END ~GiveGoldForce(300)~ ~GiveGoldForce(300) TakePartyItem("abgfEyeL") TakePartyItem("abgfEyeR") %ERASEJOURNALENTRY_0% %ERASEJOURNALENTRY_1% %ERASEJOURNALENTRY_2% %ERASEJOURNALENTRY_3% %ERASEJOURNALENTRY_4% %ERASEJOURNALENTRY_5%~
Title: Re: Offering new component for UB
Post by: plainab on April 04, 2012, 06:44:26 PM
Tested on BGT with only BG2 Fixpack prior to BGT conversion.
Used that bit I quoted above for the Gold awards and it seems to work so far. 
Moved the two script blocks to the top & put the Die() block as very first.
Scoured the code and determined that I should actually set the global on those blocks to 3 after they've been activated.
Put a backup block on the container script which checks for Prism to be Dead().

With a level 8 imported thief from the BG2 SoA characters, I tried to pickpocket him, failed, he turned hostile and I killed him.  gems gone from the container.  did this a few more times and had the same result.  Then reloaded and tried to kill him while his circle was still blue.  was successful a couple times and the gems were gone from the container.

Finally took the gems to oublek and turned them in together and he took 'em both as he should.

So unless it's something insane like script bog down from an insane amount of mods, I think this should be working now.

http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z (http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z)
Title: Re: Offering new component for UB
Post by: Miloch on April 04, 2012, 09:52:53 PM
Scoured the code and determined that I should actually set the global on those blocks to 3 after they've been activated.
Isn't that sort of what jastey said? Or are you just saying you had to verify what the value should be...

Since you're not actually changing the gold amount, is it necessary to use that as the text you're replacing or is that all there is? Should be able to use regexp on it anyway, just in case some other mod's changed the gold amount.
Title: Re: Offering new component for UB
Post by: plainab on April 05, 2012, 12:13:25 AM
Scoured the code and determined that I should actually set the global on those blocks to 3 after they've been activated.
Isn't that sort of what jastey said? Or are you just saying you had to verify what the value should be...
I needed to verify cause on the surface it was only set to 3 in the dialog.  There is a variable that's replaced depending upon the method chosen at install time and inside the definition of said variable was where it got set to 1.  Gotta remember it's been a few weeks since I'd last looked at any of this.  :P

Quote
Since you're not actually changing the gold amount, is it necessary to use that as the text you're replacing or is that all there is? Should be able to use regexp on it anyway, just in case some other mod's changed the gold amount.
I would have simply replaced the TakePartyItem action BUT there are two of them and it would cause unneeded duplication.  So I remove the existing TakePartyItem actions first from those two states and then what's left is the give gold action and some erase journal entries.  Since journal strrefs can be different across platforms, it is safer to use the give gold action to tie in the new actions.

REGEXP in a .d file?  how?
do note any .d file regexp in the BG1 fixpack is copied from something else.  I don't know what it means, just that it works.
Title: Re: Offering new component for UB
Post by: Miloch on April 05, 2012, 08:39:23 AM
REGEXP in a .d file?  how?
do note any .d file regexp in the BG1 fixpack is copied from something else.  I don't know what it means, just that it works.
There is a regexp section in the WeiDU documentation and also a REPLACE_ACTION_TEXT example that uses regexp (sort of). Something like this should work:

REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN %BGT_DiffState% END BEGIN 0 END ~GivePartyGold(\([0-9]+\))~ ~GivePartyGold(\1) TakePartyItem... etc.~
Title: Re: Offering new component for UB
Post by: plainab on April 05, 2012, 09:00:50 AM
REGEXP in a .d file?  how?
do note any .d file regexp in the BG1 fixpack is copied from something else.  I don't know what it means, just that it works.
There is a regexp section in the WeiDU documentation and also a REPLACE_ACTION_TEXT example that uses regexp (sort of). Something like this should work:

REPLACE_TRANS_ACTION ~%tutu_var%oublek~ BEGIN %BGT_DiffState% END BEGIN 0 END ~GivePartyGold(\([0-9]+\))~ ~GivePartyGold(\1) TakePartyItem... etc.~
yeah i know about the regexp section in weidu readme.  it doesn't make sense to me.  All I know is from my old dos days where * meant anything and I could narrow down by placing it among characters I knew were in what I wanted.  Looking at what you have here I don't see how it does it.  I'm not doubting that it works, I just don't understand it.
Title: Re: Offering new component for UB
Post by: Miloch on April 05, 2012, 10:03:08 AM
For this:

\([0-9]+\)

[0-9] means match any digit. + means match it one or more times. What's between \( and \) is recorded as the first match, thus in the replacement string you can use \1 to replicate it. It might seem arcane at first if you're used to DOS wildcards, but it's easy to get used to (though I still regularly have to consult the table in the WeiDU doc).
Title: Re: Offering new component for UB
Post by: jastey on April 22, 2012, 06:25:07 AM

So unless it's something insane like script bog down from an insane amount of mods, I think this should be working now.

http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z (http://"http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z")
I am very embarrassed to say, that I don't seem to have this version. At least, I cannot find the version on my computer (I was transferring my files from one to the newer so I have three disc drives where I put files currently).

The link doesn't work for me currently. Would you upload it again, please?
Title: Re: Offering new component for UB
Post by: plainab on April 22, 2012, 07:51:04 AM
I corrected the link....
I think...

http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z (http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z)

the above is this
Code: [Select]
[url]http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z[/url]the previous was this
Code: [Select]
[url="http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z"]http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z[/url]and the modified link is
Code: [Select]
[url=http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z]http://sasha-altherin.webs.com/mods/abPrismEmeraldsv3.7z[/url]which seems to work, so apparently the url tag doesn't like the ""   

With there being no instructions on how to use the url tags on this site (that I've seen), I've always been confused on how to get it to work right.  and in all cases it has worked when I've tested it in the preview.  apparently I need to submit, reload the page and test it again before walking away from the post.
Title: Re: Offering new component for UB
Post by: jastey on April 22, 2012, 08:14:45 AM
Yes, I have problems with posting links sometimes, too, especially since the syntax is different on this forum to G3 (meaning that, if I want to post announcements, I cannot just copy and paste the same text (and it was like this before the forum update at G3, in case someone wants to comment)).

Thank you for the corrected link, I downloaded it now.
Title: Re: Offering new component for UB
Post by: Gay Lord on May 14, 2012, 11:33:39 AM
Let me ask something, since it's been years since I've played BG.  I remember that Oublek gets upset if you take Greywolf's reward when you first speak to him, and he will hold back a future reward as punishment.  What happens if you kill Greywolf BEFORE talking to Oublek?  Since Grey will now never show up to claim his pay from Oublek, is it possible to get Grey's pay AND still get the two rewards for completed missions?  If not, would it be possible to include it?  I hardly think whatever few coins you get by impersonating Grey would be game-breaking.  As an extra, if you wanted, you could include a skill check or charm option or something of the like on Oublek where you take Grey's coin yet manage to sweet talk Oublek so that he doesn't withhold future pay from you for lying to him.

Another question I have is why there are two emeralds, since it seems to be causing a tremendous amount of extra writing on your part?  Instead of having two items of one emerald each, why not have a single item called 'pair of emeralds'?  This would give you your unique item, would reduce the coding and scripting and dialogue options you have to deal with (more text = more chance of bugs), and would save room in your inventory.  I mean, all of this... gah !
Quote
when the player picks prism's pockets:
prism needs to cover the following possibilities
left gem taken, right gem in hand -- player has left gem
left gem taken, right gem in hand -- player stashed/sold left gem
left gem taken, right gem in hand -- player turned in left gem for bounty
right gem taken, left gem in hand -- player has left gem
right gem taken, left gem in hand -- player stashed/sold left gem
right gem taken, left gem in hand -- player turned in left gem for bounty
left gem taken, right gem taken -- player has both gems
left gem taken, right gem taken -- player stashed/sold both gems
left gem taken, right gem taken -- player turned them in for bounty
and i suppose out of fullness sake he should notice the following tho the statements don't have to be the same.
left gem taken, right gem taken -- player has left gem, stashed/sold right gem
left gem taken, right gem taken -- player has left gem, turned in right gem for bounty
left gem taken, right gem taken -- player has right gem, stashed/sold left gem
left gem taken, right gem taken -- player has right gem, turned in left gem for bounty

That's a heck of a lot of, IMHO, unnecessary work.  If you replace the two items with one item, I would think things would be much easier for you.  But I'm not a coder, so I don't know.

I do think though that there's very little reason for anyone involved in this situation to split up the gems.  Prism wants both gems to finish his work, not one.  When he dies, he drops both gems, not one.  Greywolf will let you leave in exchange for both gems, not one.  Oublek wants both gems returned, not one.  The owner wants both gems returned, not one.  If you decide to sell them, you are going to sell both of them, not one.  So to me, it seems fine to replace the two items with one.  Whip up a simple icon, call it 'two emeralds' or 'pair of emeralds' or "Prism's emeralds' or whatever, and you're done.
Title: Re: Offering new component for UB
Post by: plainab on May 14, 2012, 01:14:35 PM
Put it simply:   EXPLOIT FIX

To expand upon that:    The original game engine is limited in how it deals with items.  It takes an entire stack, even if it just wants one or two.  While there aren't that many emeralds floating around in the original version at that stage of the game, there is the issue where players knowingly drop one gem before turning in the quest at Oublek so that they may get the reward twice.

The BG Fixpack prevents the dual reward by putting in missing checks for existing variables, but the player if they attempt the exploit is left with one of the original gems that they then must sell or let rot.

Enter this component:   The main purpose of the component is so that if the player allows Prism to finish the statue, the emeralds will BE IN THE EYES. This gives a finish to the story, the player can choose to leave the gems in the eyes.  If they take them out, they lose the rep point they got for allowing him to finish it.  Everything else was built around the status of the gems at every conceivable point no matter how unlikely.   A nice side effect is that there is no longer an exploit possibility when turning in the emeralds.   NOTE:  Ascension64 originally tried doing just one container for both eyes.  It looked like a crappy pair of blue shaded sunglasses.  Two smaller containers closely fitted along each eye is the most ideal and is what was agreed upon at the time.  Two containers tho means two items.

Nothing was touched in regards to Greywolf, nor is anything planned. If there was a penalty for pretending to be Greywolf, it is still there.

Do you not think it odd that he would drop the gems upon his suicide even tho he claimed to have completed it?  It was an idea put forth and this is my take on the scenario.  Like it or not, your choice.
Title: Re: Offering new component for UB
Post by: Gay Lord on May 15, 2012, 08:25:16 PM
Apologies if I upset.  I do like the mod.

I'll be adding it to my install when I start a new game shortly.
Title: Re: Offering new component for UB
Post by: jastey on July 03, 2014, 07:38:02 AM
(Component is included in v13.1)