Jump to content


Photo

minor correction to BP code


  • Please log in to reply
1 reply to this topic

#1 pro5

pro5
  • Modder
  • 722 posts

Posted 08 November 2006 - 02:18 AM

Found a minor error in code which switches scripts to BP versions:

PATCH_IF (%patched% < 5) THEN BEGIN
		FOR(x=0; x<%count% - 1; x=x+1) BEGIN
		  READ_2DA_ENTRY_FORMER ~#_script_table~ x 1 "old_script"
		  READ_2DA_ENTRY_FORMER ~#_script_table~ x 2 "new_script"
		  PATCH_IF (("%Override%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN
			SET patched = %patched% + 1
			SPRINT "Override" "%new_script%"
		  END
		  PATCH_IF (("%Class%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN
			SET patched = %patched% + 1
			SPRINT "Class" "%new_script%"
		  END
		  PATCH_IF (("%Race%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN
			SET patched = %patched% + 1
			SPRINT "Race" "%new_script%"
		  END
		  PATCH_IF (("%General%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN
			SET patched = %patched% + 1
			SPRINT "General" "%new_script%"
		  END
		  PATCH_IF (("%Default%" STRING_COMPARE_CASE "%old_script%") = 0) THEN BEGIN
			SET patched = %patched% + 1
			SPRINT "Default" "%new_script%"
		  END
		  PATCH_IF (%patched% > 4) THEN BEGIN
			SET x = %count% - 1 //if all slots accounted for, stop checks and move on to next CRE file
		  END
		END

The loop header here should look like this:
FOR(x=0; x<%count%; x=x+1) BEGIN
otherwise the last line in BPSCRIPT.2DA will be skipped and last script will be left unchanged.

I also have a small request to whoever manages BP now.

This script block
// But these won't work with them, so they need to be yanked like bad teeth!
  COPY_EXISTING ~DROTH.cre~	 ~override~
	WRITE_ASCII 0x250 ~BPMAGE3~
  BUT_ONLY_IF_IT_CHANGES
will overwrite BG1 creature script without checking whether it already has custom scripts assigned. I can workaround all other script changes BP makes, but not this one. Can I request to change it to something like this?

COPY_EXISTING ~DROTH.cre~	 ~override~
	READ_ASCII 0x250 "Class"
	PATCH_IF (("%Class%" STRING_COMPARE_CASE "INITDLG") = 0) BEGIN
	  WRITE_ASCII 0x250 ~BPMAGE3~
	END
BUT_ONLY_IF_IT_CHANGES

See, I even did the work for ya. B)

#2 seanas

seanas
  • Modder
  • 1906 posts

Posted 08 November 2006 - 03:41 AM

no worries. i've been slack about getting v178 out the door, so i'll add these to the as-yet-unreleased v187. if you've got any other requests, get them in asap! (and note that suggestions that come already coded like this one will get much faster attention! :) )

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||