Jump to content

Which IR should I download


Arthas

Recommended Posts

1 hour ago, subtledoctor said:

Briefly, only because I clearly haven't looked into this as much as you, what is the issue here? My first thought, trailing Bartimaeus, is to simply LOAD_TRA a different .tra file according to your preferences (in an .ini setting, a subcomponent, whatever). So, questions for you off the top of my head:

  1. shouldn't that work fine for the main component?
  2. If so, then can I suppose that the problem you ran into is that a later component tries to run regexp-based replacements on the item descriptions, and fails on your modified versions? To which my first response would be, "try to leave alone the part of the description that is subject to the later regexp."
  3. But I suppose that is unacceptable because that is part of what you don't like about the IR/pre-EE description style? So the regexp itself needs to be amended?

Seems... probably solvable. I'm just not entirely clear on what precisely needs solving. (I note, for instance, that the revised .tra file Bartimaeus linked to earlier does not even specify any variant AC adjustments for different damage types...)

Yep, it's Revised Armor that is the issue. Revised Armor changes those bonuses/penalties for all armor types, hence why I haven't included that text (...yet). Basically, it needs to be able to detect what the current flat AC is, then write those bonuses dynamically depending on what the new bonuses/penalties set are (dependent upon the type of armor, like leather or chain mail or plate). Also probably need to be able to account for armor that includes that text OR doesn't include that text, because Revised Armors affects all armor globally. While I've occasionally been able to punch above my weight in figuring out some stuff, that is a little much for me.

Edited by Bartimaeus
Link to comment
On 9/22/2021 at 6:23 PM, Bartimaeus said:

Yep, it's Revised Armor that is the issue. Revised Armor changes those bonuses/penalties for all armor types, hence why I haven't included that text (...yet). Basically, it needs to be able to detect what the current flat AC is, then write those bonuses dynamically depending on what the new bonuses/penalties set are (dependent upon the type of armor, like leather or chain mail or plate). Also probably need to be able to account for armor that includes that text OR doesn't include that text, because Revised Armors affects all armor globally. While I've occasionally been able to punch above my weight in figuring out some stuff, that is a little much for me.

Subtledoctor, you've got it right. Revised Armours and Items patching code tries to patch my already revised descriptions and fails to do that. You are also right that not touching those lines and leave an IR version is a subpar solution. Hell, to be honest, I would rather leave pure IR description that play with IR/EE mix.

As for what exactly needs to be done to make it work: Basically, the regexp functions in the attached file need to be modified to take into account EE descriptions (not only those modified within IR, but also from other mods).

description_updates.tra

Link to comment
4 minutes ago, Cahir said:

Basically, the regexp functions in the attached file need to be modified

Got it. What I am still missing is, what does the description look like that you prefer? What does the regexp need to match? Bartimaeus' alternative "item_descriptions.tra" lacks an reference to damage-type adjustments. Do you have your own written descriptions? Or an example in an EE game I can look up? Also,

8 minutes ago, Cahir said:

not only those modified within IR, but also from other mods

From my experience with YARAS, this will simply never be perfect. A lot of mods add items, and they tend to be wildly inconsistent in the way they are written. You can capture the bulk, but there will always be some random stray items here and there that just look weird. (It's especially annoying for YARAS since it uses terms in the written text to apply mechanical properties...)

Link to comment
18 minutes ago, subtledoctor said:

Got it. What I am still missing is, what does the description look like that you prefer? What does the regexp need to match? Bartimaeus' alternative "item_descriptions.tra" lacks an reference to damage-type adjustments. Do you have your own written descriptions? Or an example in an EE game I can look up? Also,

Here (pages 3-4) are my attempts to make it work. I was semi successful with items and shields, but haven't tried to modify armours, because of the reason described by Bartimaeus.

Basically, I would like to have undmodded EE descriptions + newly added IR lines starting with "–"

Link to comment

I'm having some trouble with the cosmetic changes code. This is what I'm doing:

INCLUDE ~item_rev/lib/lib_cosmetic.tph~
INCLUDE ~item_rev/lib/alter_effect_dw.tpa~

OUTER_SPRINT workspace "weidu_external/workspace"
OUTER_SPRINT data_loc "weidu_external/temp/itemrev"
MKDIR "%workspace%"
MKDIR "%data_loc%"
	
MKDIR "%data_loc%/item_copy"
ACTION_BASH_FOR "item_rev/itm" ".*\.itm" BEGIN
	COPY_EXISTING "%BASH_FOR_RES%.itm" "%data_loc%/item_copy" IF_EXISTS
END

LAM cosmetic_data

LAF cosmetic_document_changes STR_VAR loc = EVAL "%data_loc%/item_copy" old_loc = "item_rev/itm" RET change_count END

PRINT "%change_count% itm files changed"

By my lights, that should take the set of .itm files in item_rev/itm/ , and copy the unmodded versions of those files to the item_copy folder. (This is successful - of the ~1,100 files in item_rev/itm/ 758 get copied, presumably those are the 758 files with the same name that exist in BG2EE.) Then if I understand correctly, it should take the actual files in item_rev/itm/ as the base set (%old_loc%) and compare them to the unmodded EE v2.5 files (copies of which are in %data_loc%/item_copy/) and record the changes, which would show the modifications necessary to change the items. The idea being, after doing this I could install IR, and then run cosmetic_implement_changes from another mod to later convert the IR items to their base EE cosmetic state.

But the .ini file is empty, and %change_count% is zero.

EDIT -
I also COPY_EXISTING'ed the unmodded files over to a temp directory, then installed IR (in case some of its cosmetic changes happen at install-time), then COPY_EXISTING'ed the same set of files over to a second temp directory, and then tried to compare the two directories.

Spoiler


///////////////////////////////////////////////////////////////////////////
// Item Revisions by Demivrgvs (Main Component) -  Installs all items    //
///////////////////////////////////////////////////////////////////////////

BEGIN @1
DESIGNATED 0
REQUIRE_PREDICATE (GAME_IS ~tob bgt tutu tutu_totsc bgee bg2ee eet~) @9000

INCLUDE ~item_rev/lib/lib_cosmetic.tph~
INCLUDE ~item_rev/lib/alter_effect_dw.tpa~

OUTER_SPRINT workspace "weidu_external/workspace"
OUTER_SPRINT data_loc "weidu_external/item_rev"
MKDIR "%workspace%"
MKDIR "%data_loc%"
	
MKDIR "%data_loc%/item_copy_original"
MKDIR "%data_loc%/item_copy_item_rev"
ACTION_BASH_FOR "item_rev/itm" ".*\.itm" BEGIN
  ACTION_IF (FILE_EXISTS_IN_GAME ~%BASH_FOR_RES%.itm~) BEGIN
    COPY_EXISTING ~%BASH_FOR_RES%.itm~ ~%data_loc%/item_copy_original~
  END
END

ACTION_IF install_tobex && (ENGINE_IS ~tob~) BEGIN
  OUTER_SPRINT ~TOBEX_MOD_DIRECTORY~ ~item_rev~
  LOAD_TRA ~item_rev/tobex_redist/TobEx.tra~
  INCLUDE ~item_rev/tobex_redist/TobEx.tpa~
END

LOAD_TRA ~item_rev/languages/english/item_descriptions.tra~
LOAD_TRA ~item_rev/languages/english/item_upgrades.tra~
LOAD_TRA ~item_rev/languages/english/potion_descriptions.tra~
LOAD_TRA ~item_rev/languages/%LANGUAGE%/item_descriptions.tra~
LOAD_TRA ~item_rev/languages/%LANGUAGE%/item_upgrades.tra~
LOAD_TRA ~item_rev/languages/%LANGUAGE%/potion_descriptions.tra~

INCLUDE ~item_rev/components/main_component.tpa~

ACTION_BASH_FOR "item_rev/itm" ".*\.itm" BEGIN
  ACTION_IF (FILE_EXISTS_IN_GAME ~%BASH_FOR_RES%.itm~) BEGIN
    COPY_EXISTING ~%BASH_FOR_RES%.itm~ ~%data_loc%/item_copy_item_rev~
  END
END

LAM cosmetic_data

LAF cosmetic_document_changes STR_VAR loc = EVAL "%data_loc%/item_copy_original" old_loc = "%data_loc%/item_copy_item_rev" RET change_count END

PRINT "%change_count% itm files changed"

...But same result.

Edited by subtledoctor
Link to comment

On line 144 of lib_cosmetic, %old_loc/ should be %old_loc%/. If you change that, it should work (it does on my install). Apologies: my testing was all with old_loc="", i.e. comparing to in-game files.

Let me suggest that you might want to fully install IR, copy its files over to some data folder, uninstall it, and then compare the data folder items to the unmodded-game items. That way you don't miss any changes that IR implements by scripting (I don't know if there are any such changes, though).

Link to comment
23 minutes ago, DavidW said:

Let me suggest that you might want to fully install IR, copy its files over to some data folder, uninstall it, and then compare the data folder items to the unmodded-game items. That way you don't miss any changes that IR implements by scripting (I don't know if there are any such changes, though).

Agreed, that's what I was going for in the second instance: copy the pre-IR items into a data folder, then install IR, then copy the same items into a second data folder, and c compare the two folders. So the items are preserved in their initial state, and then compared to the fully-installed IR versions.

Thanks.

Link to comment
1 hour ago, Cahir said:

Basically, I would like to have unmodded EE descriptions + newly added IR lines starting with "–"

Throwing this out there: maybe you are going about this the wrong way? You want different versions of the IR descriptions; but changing the text in item_descriptions.tra would lead to failures in Revised Armor and other components. To prevent those failures we could change the regexp capture... but maybe we don't need to? Maybe you can change the descriptions after it is all installed, instead of beforehand. You have item_descriptions.tra, and you can write out your replacement for the text... so it shouldn't be hard to basically make a new mod, to be installed immediately after IR, with a bunch of SAY IDENTIFIED_DESC and/or REPLACE_TEXTUALLY commands. Right?

Link to comment
16 minutes ago, subtledoctor said:

Throwing this out there: maybe you are going about this the wrong way? You want different versions of the IR descriptions; but changing the text in item_descriptions.tra would lead to failures in Revised Armor and other components. To prevent those failures we could change the regexp capture... but maybe we don't need to? Maybe you can change the descriptions after it is all installed, instead of beforehand. You have item_descriptions.tra, and you can write out your replacement for the text... so it shouldn't be hard to basically make a new mod, to be installed immediately after IR, with a bunch of SAY IDENTIFIED_DESC and/or REPLACE_TEXTUALLY commands. Right?

Possibly, but this is even more beyond my skills☹️ I know nothing of WeiDu coding, so I'm not even sure what those functions mean. 

Link to comment

@Cahir And just to be clear, you yourself don’t want to install Revised Armors, right? The only concern there is to make sure your changes don’t prevent  other people from installing Revised Armor?

EDIT - 

And, are you doing this in English or Polish? (IR doesn’t have a Polish translation, does it?)

9 minutes ago, DavidW said:

I'm struggling to understand exactly what you guys are trying to do with these armor description issues

I’ve been struggling to understand as well, but if I’m beginning to understand correctly, it might not be hard. Brute text replacement might work better than a fancy regexp. 

Link to comment
13 minutes ago, DavidW said:

I'm struggling to understand exactly what you guys are trying to do with these armor description issues, but if you describe it to me in nice simple terms I can probably code it for you.

Thanks for the offer David. 

What I would like to achieve step by step is:item_descriptions_EE.zip

1. Create an EE-style version of IR(R) item descriptions. In attachment is my attempt for IRR (maybe not up-to-date, this was done for one of the previous versions). Of course, I can prepare also a version for Subtledoctor's fork.

2. I would like Revised Items and Armors components to correctly patch these descriptions which is normally done via description_updates.tra file. At the moment, it correctly patches only IR or classic game formats.

Link to comment
9 minutes ago, subtledoctor said:

@Cahir And just to be clear, you yourself don’t want to install Revised Armors, right? The only concern there is to make sure your changes don’t prevent  other people from installing Revised Armor?

EDIT - 

And, are you doing this in English or Polish? (IR doesn’t have a Polish translation, does it?)

I do want to install both Revised Armors and Revised Items. I haven't tried to adjust regexp patching for Armors, because of the Armor type description split vs different weapons type. It was too difficult for me even to think about tackling it. 

I'm not sure if I follow what do you mean, that my changes can prevent others to install Revised Armors. Those EE-style descriptions can be purely optional component, I think?

I'm doing it in English, IR does not have Polish translation, as far as I know.

Link to comment
3 minutes ago, DavidW said:

I’d need to know what the intended output is; seeing the implementation code isn’t enough. E.g. do you want the armor bonuses to display in some specific format; if so, what is it?

Sorry for not being technical enough, it's because I'm having trouble to explain it properly. I'll try to prepare some examples tomorrow, it's almost midnight here, need to hit a rack, otherwise I'll be a zombie tomorrow at work.

Need to check exact lines that Revised Armors and Items components are adding to the description and find EE equivalent. I forgot the details, it was over a year when I tried to figure it out.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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.

×
×
  • Create New...