Jump to content
Bartimaeus

IR Revised V1.2.5 (2019 April 5th)

Recommended Posts

I don't think it makes any difference ...

Yeah, exactly, it doesn't make a difference...

So what's so hard to understand about that ? Is it too obvious ? Not surpricing enough ?

Share this post


Link to post

​In other news, a new version with a few bug fixes and minor item cost changes (mostly relating to price oddities of some the prices of the Joluv special items) will probably be coming out within the next couple of weeks. Nothing major, but I am working on it.

 

Hey, will this new version include a fix for Shaman item usability? Right now IR and IR-R. make short bows and axes unuseable for Shamans.

Not a big deal if you don't play a Shaman.. but kind of a problem if you do.. :)

Share this post


Link to post

 

​In other news, a new version with a few bug fixes and minor item cost changes (mostly relating to price oddities of some the prices of the Joluv special items) will probably be coming out within the next couple of weeks. Nothing major, but I am working on it.

 

Hey, will this new version include a fix for Shaman item usability? Right now IR and IR-R. make short bows and axes unuseable for Shamans.

Not a big deal if you don't play a Shaman.. but kind of a problem if you do.. :)

Well, if you know that the problem is there, you should be able to fix it, it's just one more click in Near Infinity after you have the item found and have the usability up... and if you already have the item in the game, you just need to drop it, and cheat another copy back in. And try not to use the axe with a druid, or sell the old copy to a shop.:devlook:

As the feature you request also involved Druids partially, as they should be able to use it on class base, but not with a in_item feature. Same as the regular axes ~in the v2.3 EE games. Was it ? As the Shaman was added in there.

Share this post


Link to post

 

Well, if you know that the problem is there, you should be able to fix it, it's just one more click in Near Infinity after you have the item found and have the usability up

 

Maybe I was unclear. IR/IR-R makes ALL axes, short bows and arrows in the game unusable for shamans.

So, no NI won't do. A WeiDU function will of course but that's a bit more advanced than simply changing a flag and adding an effect with NI.

Share this post


Link to post

A WeiDU function will of course but that's a bit more advanced than *

What ? This is why weidu has COPY_EXISTING_REGEXP GLOB ~ax1h.*itm$~ ~override~ //our patching code goes here that features: "simply changing a flag and adding an effect".

 

Say, something close to this effect:

PATCH_IF GAME_IS ~eet bgee bg2ee iwdee~ BEGIN //this needs updated weidu exe something starting with v240 or later
COPY_EXISTING_REGEXP GLOB ~ax1h.*itm$~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6 // unset BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

COPY_EXISTING_REGEXP GLOB ~arow.*itm$~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

COPY_EXISTING ~bow05.itm~ ~override~
              ~bow06.itm~ ~override~
              ~bow08.itm~ ~override~
              ~bow14.itm~ ~override~
              ~bow15.itm~ ~override~
              ~bow18.itm~ ~override~
              ~bow19.itm~ ~override~
              ~bow20.itm~ ~override~
              ~bow21.itm~ ~override~
              ~bow26.itm~ ~override~
              ~bow99.itm~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

This code is of course untested and might need tweaking, but it should be close.

Edited by Jarno Mikkola

Share this post


Link to post

I'll test this later on an old installation. Looks to me like it should work, but this would only fix none mod items, right?

The problem is mod added items are affected as well and even if you check for something like PROFICIENCYSHORTBOW you'll run into issues where you suddenly flag items that are not supposed to work for shamans. Like a thief only short bow for example...

Share this post


Link to post

The IR readme says this

 

The main component of IR overwrites existing items and their descriptions, so it should be installed before mods that patch items. If you would prefer certain items remain unaltered by IR, you have the option to disable specific item modifications prior to installing the mod. You can find instructions on how to do this in the Power Users section below.

The other components of IR have been designed to patch all items, including items added by other mods, so they should be installed after all mods that add or replace items.

 

 

Yet, I am fairly certain that the main component did patch mod added bows as well.

I fear I am too much of a WeiDU newb to effectively check the actual code as to where what is patched and why/whether it is necessary..

Share this post


Link to post

... right?

Correct, one could check for say fighter's usability first, and thus assume that it's a representative for Shamans too. But that's too much work for now, for me.

Share this post


Link to post

code doesn't work

 

 

 

[C:\BGEE\EET-Ready\Baldur's Gate II - Enhanced Edition_OLD-For-Modding\Setup-Tes
tx.exe] WeiDU version 24200
In state 875, I expected one of these tokens:
  [0] EOF
  [3] <<<<<<<<
  [14] ACTION_GET_STRREF_S
  [18] OUTER_TEXT_SPRINT
  [22] RANDOM_SEED
  [23] ADD_KIT
  [27] AT_INTERACTIVE_UNINSTALL
  [34] LAUNCH_ACTION_FUNCTION
  [40] LOG
  [42] COPY_ALL_GAM_FILES
  [45] SILENT
  [48] BEGIN
  [50] ADD_MUSIC
  [52] BIFF
  [56] GET_DIRECTORY_ARRAY
  [63] PRINT
  [70] WITH_SCOPE
  [73] WITH_TRA
  [75] ACTION_RERAISE
  [79] ACTION_IF
  [84] APPEND
  [86] DEFINE_ACTION_MACRO
  [87] ACTION_TO_UPPER
  [88] ACTION_GET_STRREF
  [93] DEPRECATED
  [94] FORCED_SUBCOMPONENT
  [95] ACTION_GET_STRREF_F
  [96] STRING_SET_EVALUATE
  [97] OUTER_FOR
  [98] REQUIRE_COMPONENT
  [100] FAIL
  [101] AT_UNINSTALL
  [104] CLEAR_ARRAYS
  [106] ACTION_GET_STRREF_FS
  [110] GROUP
  [123] COPY_EXISTING
  [124] REINCLUDE
  [127] MOVE
  [131] ADD_AREA_TYPE
  [141] EXTEND_TOP_REGEXP
  [144] ADD_PROJECTILE
  [145] OUTER_PATCH_SAVE
  [146] CREATE
  [152] MKDIR
  [154] OUTER_SET
  [155] WARN
  [157] STRING_SET
  [159] COPY_RANDOM
  [160] ADD_JOURNAL
  [166] DISABLE_FROM_KEY
  [168] AT_INTERACTIVE_EXIT
  [169] ACTION_READLN
  [171] ACTION_DEFINE_ARRAY
  [172] UNINSTALL
  [180] VERBOSE
  [181] DEFINE_PATCH_FUNCTION
  [189] ACTION_BASH_FOR
  [197] ACTION_MATCH
  [198] REQUIRE_FILE
  [205] ACTION_FOR_EACH
  [207] CLEAR_CODES
  [214] EXTEND_TOP
  [216] CLEAR_MEMORY
  [217] DECOMPRESS_BIFF
  [225] DESIGNATED
  [228] COPY
  [229] APPEND_COL_OUTER
  [233] DEFINE_PATCH_MACRO
  [236] COPY_LARGE
  [249] COPY_KIT
  [254] ADD_SECTYPE
  [255] ACTION_CLEAR_ARRAY
  [259] EXTEND_BOTTOM
  [276] ALTER_TLK
  [278] COPY_EXISTING_REGEXP
  [284] EXTEND_BOTTOM_REGEXP
  [285] FORBID_FILE
  [286] CLEAR_IDS_MAP
  [289] ALTER_TLK_LIST
  [300] OUTER_PATCH
  [304] AT_INTERACTIVE_NOW
  [306] AT_EXIT
  [308] AT_INTERACTIVE_UNINSTALL_EXIT
  [311] NO_LOG_RECORD
  [314] STRING_SET_RANGE
  [315] APPEND_COL
  [318] ACTION_TO_LOWER
  [323] ADD_SPELL
  [326] CLEAR_EVERYTHING
  [327] GET_FILE_ARRAY
  [332] AT_NOW
  [334] LOAD_TRA
  [335] REQUIRE_PREDICATE
  [337] INSTALL_BY_DEFAULT
  [339] ACTION_PHP_EACH
  [342] SUBCOMPONENT
  [349] ACTION_TRY
  [351] ACTION_DEFINE_ASSOCIATIVE_ARRAY
  [354] INCLUDE
  [363] ALTER_TLK_RANGE
  [368] DEFINE_ACTION_FUNCTION
  [369] OUTER_SPRINT
  [372] LAUNCH_ACTION_MACRO
  [373] FORBID_COMPONENT
  [392] COMPILE
  [397] AT_UNINSTALL_EXIT
  [403] ADD_SCHOOL
  [404] LABEL
  [410] APPEND_OUTER
  [413] CLEAR_INLINED
  [416] DELETE
  [430] OUTER_WHILE
Parse error (state 875) at PATCH_IF

[TESTX/SETUP-TESTX.TP2] PARSE ERROR at line 7 column 1-8
Near Text: PATCH_IF
        GLR parse error

[TESTX/SETUP-TESTX.TP2]  ERROR at line 7 column 1-8
Near Text: PATCH_IF
        Parsing.Parse_error
ERROR: parsing [TESTX/SETUP-TESTX.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [TESTX/SETUP-TESTX.TP2]: Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

Press ENTER to exit.

 

 

Share this post


Link to post

Switch the PATCH_IF to be REQUIRE_PREDICATE ... This will requyire you to make it an independent component, name that component... so:

BEGIN ~Shaman usability patch~
REQUIRE_PREDICATE GAME_IS ~eet bgee bg2ee iwdee~ BEGIN //this needs updated weidu exe something starting with v240 or later

COPY_EXISTING_REGEXP GLOB ~ax1h.*itm$~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6 // unset BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

COPY_EXISTING_REGEXP GLOB ~arow.*itm$~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

COPY_EXISTING ~bow05.itm~ ~override~
              ~bow06.itm~ ~override~
              ~bow08.itm~ ~override~
              ~bow14.itm~ ~override~
              ~bow15.itm~ ~override~
              ~bow18.itm~ ~override~
              ~bow19.itm~ ~override~
              ~bow20.itm~ ~override~
              ~bow21.itm~ ~override~
              ~bow26.itm~ ~override~
              ~bow99.itm~ ~override~ BEGIN
	WRITE_BYTE ~0x021~ THIS & `BIT6
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode=319 target=1 timing=2 duration=0 parameter1=11 parameter2=5 END

Share this post


Link to post

Still no good even with the REQUIRE_PREDICATE line commented out.

Share this post


Link to post

Now you get to this one...

BACKUP ~modname/backup~
AUTHOR ~The Imp~

BEGIN ~Shaman usability patch~
MKDIR modname
ACTION_IF (GAME_IS ~eet bgee bg2ee iwdee~ ) BEGIN
COPY_EXISTING_REGEXP GLOB ~.*\.itm$~ ~override~
	PATCH_IF (SOURCE_SIZE > 0x113) BEGIN // protects against invalid files
	READ_SHORT ~0x1C~ ~type~
	PATCH_IF (type = 0x5) OR (type = 0xf) OR (type = 0x19) BEGIN
	READ_BYTE  ~0x21~ ~race~
	WRITE_BYTE  0x21  (race BAND  0b10111111)
	LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = 319 target = 1 timing = 2 duration = 0 parameter1 = 11 parameter2 = 5 resist_dispel = 0 probability1 = 100 insert_point = 0 
END
END
END
END

It 's checked that it works in a BG2 game with weidu.exe v244... but I can't say that it actually "works", as I don't have the bug.

 

The only bad side it has it should make all the bows usable to Shamans, not just Short Bows, but they don't have the proffs, so it matter not that much.

Share this post


Link to post

LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = 319 target = 1 timing = 2 duration = 0 parameter1 = 11 parameter2 = 5 resist_dispel = 0 probability1 = 100 insert_point = 0

 

I presume this is the "add usability for class/kit" opcode in the EEs? IR already has an item type identifier, thankfully, so it would be very easy to integrate for only EE games if that's the case.

 

(e): Ah, I see that subtledoctor whipped up something similar. Yes, I'll fix this for the next version.

Edited by Bartimaeus

Share this post


Link to post

I presume this is the "add usability for class/kit" opcode in the EEs? IR already has an item type identifier, thankfully, so it would be very easy to integrate for only EE games if that's the case.

Actually that's the exact opposite. The item is first allowed to be usable by all druids by the other code, which allows also Shamans to use them, and then this restricts axes from usage by druids, but not Shamans that use the same class marker for usability, but not the same class mark on the class stat identifier(class.ids), which that code restricts usage from. Aka we do the exact thing the EE v2.3 patch did.

Edited by Jarno Mikkola

Share this post


Link to post
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×