Jump to content

BG1 Tweaks


grogerson

Recommended Posts

Hey Grogerson,

 

Interested in an updated version of this: Friendly Arm Inn Container Restoration (Ascension64) (Baldur's Gate without Tales of the Sword Coast only)

I know the code works, but now there is this nifty function now part of WeiDu which in a lot less lines of code can do the same thing. I'll do the code update if you want... just let me know.

Sounds good. Less code, easier handling, less bloat. I'd appreciate it.

alrighty then....

please test this first before calling it official. it is intended to replace everything below the dummy file that's used as a component detector...

 

COPY_EXISTING ~ar2300.are~ ~override~
//first determine that the container truly is not there  if it is, we don't do anything
SET container_exists = 0
READ_LONG 0x70 container_off
READ_SHORT 0x74 container_num
FOR (i = 0; i < %container_num%; i += 1) BEGIN
 READ_ASCII (%container_off% + %i% * 0xc0) container_name (12)
 READ_SHORT (%container_off% + (%i% * 0xc0) + 0x20) locX //2527 //locX
 READ_SHORT (%container_off% + (%i% * 0xc0) + 0x22) locY //3781 //locY
 PATCH_IF ("%container_name%" STRING_EQUAL_CASE "Container 1")
   OR ( (%locX% =2527) AND (%locY% = 3781) ) BEGIN
  PATCH_PRINT ~A container already exists with the same name and/or at the same location. Canceling installation...~
  SET container_exists = 1
 END
END
//so long as container does not exist
PATCH_IF (%container_exists% = 0 ) BEGIN
 PATCH_PRINT ~Adding hidden container~
 //add new container
 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
 INT_VAR fj_loc_x = 2527 //locX
	  fj_loc_y = 3781 //locY
	  fj_type = 1 //Type
	  fj_lock_diff = 100 //Lock difficulty
	  fj_trap_remove_diff = 100 //Trap removal difficulty
	  fj_trap_loc_x = 2528 //Trap locX
	  fj_trap_loc_y = 3775 //Trap locY
	  fj_box_left = 2551 //Bound left
	  fj_box_top = 3757 //Bound top
	  fj_box_right = 2555 //Bound right
	  fj_box_bottom = 3762 //Bound bottom
	  fj_vertex_0 = (2552 + (3757 << 16))
	  fj_vertex_1 = (2555 + (3757 << 16))
	  fj_vertex_2 = (2555 + (3759 << 16))
	  fj_vertex_3 = (2553 + (3762 << 16))
	  fj_vertex_4 = (2551 + (3759 << 16))
 STR_VAR fj_structure_type = ~container~
	  fj_name = ~Container 1~ //Name
 END //ends lpf
 PATCH_PRINT ~Placing Ring of Wizardy into hidden container~
 //put ring into container
 LAUNCH_PATCH_FUNCTION ~fj_are_structure~
INT_VAR fj_charge0 = 1
		fj_con_itm_idx	= SHORT_AT 0x74 - 1
STR_VAR fj_name = ~RING08~
		fj_structure_type = ~itm~
 END //ends lpf
END
BUT_ONLY

I put the patch prints in so that it could be easier in testing to see what happens. also may be beneficial to have them for debugging if there is ever an issue. tho if you don't want the player to see them at install time, change them to PATCH_LOG and they'll only be put into the debug file.

 

Also note, I did not actually test this as the only testing setup for patch/component testing I have is within the BG Fixpack and that's only on my copy of the Original Saga. Obviously, it would fail there as the container is present...

Link to comment

oh I forgot to mention earlier. I've got this old code (needs updating to use the built-in function) that changes the start of chapter 5 in ToTSC to that of the vanilla game. In other words, instead of starting immediately upon Davaeorn's death it starts when the player crosses a floor trigger at either of the map's exits. Its not fixpack material, but some people might prefer the vanilla method over the ToTSC method. Thoughts?

Link to comment

oh I forgot to mention earlier. I've got this old code (needs updating to use the built-in function) that changes the start of chapter 5 in ToTSC to that of the vanilla game. In other words, instead of starting immediately upon Davaeorn's death it starts when the player crosses a floor trigger at either of the map's exits. Its not fixpack material, but some people might prefer the vanilla method over the ToTSC method. Thoughts?

Slow as tar in winter, I am. Not a "fix" or a "tweak." Sounds like good OBC material to me, since I'd prefer the vanilla method.
Link to comment

so are ya saying you'd like me to update it and test it out and then offer the component to whatever the next version of tweaks may be at the time? Is tweaks for only BG1 or are any of the components intended to be BGT/Tutu compatible. Cause this is one that could be designed for all 3 platforms...

Link to comment

Honestly I work only with BG1. I might work with BG2 later, when IWD1-in-BG2 gets out of beta. Pass me the code to check. I'm working on v4 now and not doing so well with a component. I thought Wear Multiple Protection Items (P&P Style) worked in basic BG1, but now I find it literally crashing the engine before it opens. No Limitations (Gold Box games) Style works just fine...

 

Maybe you can help, since I'm a hack at coding (read: I haven't a clue what I'm doing most of the time). I want to upgrade Universal Clubs and Wear Multiple Protection Items (P&P Style) to change the description on the fly like BG2 Tweaks v9 does, which is where my current problem stated above started. The components install, but the description fails to change.

 

Edit: Whilst waiting and working on above frustration, I decided to check out your code for the FAI container. It works nicely, and with a lot less code! New code, new attribution. Thanks.

Link to comment

Ok I'll go revisit the chapter 5 start and (it shouldn't be too much hassle) make it compatible with BGT/Tutu. I can always see if BG2 Tweaks wants to use it for the Tutu/BGT games as well.

 

As for your other issue, you'll need to make sure I've got the right code to look at. Are you just trying to convert an existing component from BG2 Tweaks or what? You can always PM me if you don't want to clutter the thread with lots of back and forth :p

 

Just so you know TWM (Zed Nocear's mod) will have a component that does something similar. Not sure if it is P&P. But its got two subcomponents, one that wipes itemexcl.2da (i.e. no limitations) and another that allows 1 ring/amulet/cloak with 1 armor, basically all it does is removes the armors from the itemexcl.2da file. both are overwrites so if TWM is installed after Tweaks and Tweaks component was installed any changes made to itemexcl.2da will be lost, yet if you make description changes those will still be present... something to think about.

Link to comment

here ya go. In the end decided just to stick with Totsc and not worry about Tutu & BGT mainly cause their scripts are different, requires different handling etc...

There is a simple False() added to the block in the area script. If another mod uses the same trigger I look for in a block they add, then there will be problems. If that happens, it won't be that hard to take care of, just add more stuff for it to match & replace.

 

Chapter 5 vanilla style start.... you can call it whatever you want :p

 

BEGIN ~Revert Chapter Change in Cloakwood Mines to Non-ToTSC BG Behavior~
REQUIRE_PREDICATE !(GAME_IS ~bg1~) ~Skipping -- Already default behavior for Non-ToTSC BG games~
PRINT ~Testing ch5 start change~
OUTER_SPRINT "CloakwoodMines_L4" "AR1803"
OUTER_SPRINT "WyrmsCrossing" "AR0900"
COPY_EXISTING ~%CloakwoodMines_L4%.are~ override
READ_ASCII 0x94 areascript (8) NULL
PATCH_IF FILE_EXISTS_IN_GAME ~%areascript%.bcs~ BEGIN
 INNER_ACTION BEGIN
  COPY_EXISTING ~%areascript%.bcs~ override
   DECOMPILE_BCS_TO_BAF
 REPLACE_TEXTUALLY CASE_INSENSITIVE EVALUATE_REGEXP ~Dead("Davaeorn")~ ~False() Dead("Davaeorn")~
   COMPILE_BAF_TO_BCS
  BUT_ONLY
 END
END
LPF fj_are_structure
   INT_VAR
   fj_type		 = 0    //trap
   fj_box_left	 = 380
   fj_box_top	  = 1062
   fj_box_right    = 541
   fj_box_bottom   = 1277
   fj_cursor_idx   = 0   //no cursor
   fj_vertex_0	 = 380 + (1076 << 16)
   fj_vertex_1	 = 510 + (1160 << 16)
   fj_vertex_2	 = 439 + (1263 << 16)
   fj_vertex_3	 = 468 + (1277 << 16)
   fj_vertex_4	 = 541 + (1148 << 16)
   fj_vertex_5	 = 393 + (1062 << 16)
   fj_flags	    = 0b0000000000000010
   fj_trap_detect  = 100
   fj_trap_remove  = 100
   fj_trap_active  = 1
   fj_trap_status  = 0
   fj_loc_x	    = 404
   fj_loc_y	    = 1300
   STR_VAR
   fj_structure_type   = region
   fj_name			 = ~Chapter trigger 1~
   fj_reg_script	   = endch4
END
LPF fj_are_structure
   INT_VAR
   fj_type		 = 0    //trap
   fj_box_left	 = 1523
   fj_box_top	  = 272
   fj_box_right    = 1629
   fj_box_bottom   = 356
   fj_cursor_idx   = 0   //no cursor
   fj_vertex_0	 = 1523 + (292 << 16)
   fj_vertex_1	 = 1607 + (356 << 16)
   fj_vertex_2	 = 1629 + (334 << 16)
   fj_vertex_3	 = 1550 + (272 << 16)
   fj_flags	    = 0b0000000000000010
   fj_trap_detect  = 100
   fj_trap_remove  = 100
   fj_trap_active  = 1
   fj_trap_status  = 0
   fj_loc_x	    = 1620
   fj_loc_y	    = 340
   STR_VAR
   fj_structure_type   = region
   fj_name			 = ~Chapter trigger 2~
   fj_reg_script	   = endch4
END
BUT_ONLY
<<<<<<<< inlined_totsc/endch4.baf
IF
 Entered([PC])
 Dead("Davaeorn")  // Davaeorn
 Global("Chapter","GLOBAL",4)
THEN
 RESPONSE #100
   RevealAreaOnMap("AR0900")
   IncrementChapter("Chptxt5")
   AddJournalEntry(15839)
END
IF
 Entered([PC])
THEN
 RESPONSE #100
   SmallWait(1)
END
>>>>>>>>
//endch4.bcs should exist in game, but in case it does not
ACTION_IF !FILE_EXISTS_IN_GAME ~endch4.bcs~ THEN BEGIN
COMPILE ~inlined_totsc/endch4.baf~
END

 

 

btw this installs and everything looks good. I don't have any saves at the moment to actually go and test it. However, it duplicates the vanilla process and i know that one works....

Link to comment

Thanks, plainab. I'll check it out. I've also sent you an e-mail regarding Universal Clubs and Wear Multiple Protection Items (P&P Style). It's the BG2 Tweaks code showing my alterations. If I can get them going properly (with your help), I'll get into the game properly.

Link to comment

oh was that from you....

 

got it on my phone and all it said was "Wear Multiple Protection..." I've been getting some 'dirty' spam on that account recently so I automatically deleted it.

 

oops

 

Can you resend as a PM on the forum? At least then it will have the G3 tag when I get notified about it.

 

***********

You have to admit, that this scenario is just a touch funny....

Link to comment

I've been getting some 'dirty' spam on that account recently so I automatically deleted it.

And it died without even a whimper! So sad!

 

OK, I'll send it again, this time by PM. The problem with PM'ing you is that it removes my markups, and I . I'll send it again, this time starting the title with "G3:" so's not to be mistaken (I hope).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...