Jump to content

ACTION_READLN - replacement examples


AL|EN

Recommended Posts

Could you provide a single case where it(no main default component) wouldn't work ? And nope, you install the NPC mods before the tweak mods, not after. Just like you don't install the Widescreen mod and then wonder what happened to the non W-GUI mod, being off the GUI index point.

And yes, you can provide a uninstall component if you want to, to reverse a change... but that then needs to require the exact component, and reverse the change to all the other non-mod files too. Which is itself another component, or a tweak... not a subcomponent.

Edited by Jarno Mikkola
Link to comment
57 minutes ago, jastey said:

Another thing remotedly related: If we are dealing with replacing the ACTION_READLN for a mod that is already around for a while and might be checked for crossmod or conflicts, offering choices for the main component via SUBCOMPONENT has the disadvantage that checking for "mod.tp2" "0" will not be true for all cases if the player choses one of the other options.

Valid point, please give me example so I can see the context and show you how to solve this issue :)

Link to comment
56 minutes ago, AL|EN said:

please give me example

I guess it's more of a principle thing. Crossmod banter pack checks for the dlg files directly, not the mod component, Tweaks Anthology checks for a component number of bg1npc project that is no longer present in v24 (so there is no conflict there). I need to correct one check in Jarl's Adventure Pack for bg1npc v24 component 10 (former 1) but that could have happened anytime and is only remotedly connected to the ACTION_READLN replacement.

In case it counts as an example: I'd have to readjust every check for the base component in my own mods, with regard to the already existent optional components if I'll change it to the main component having several component numbers potentially. Nothing grave, but I just decided that for my purposes, making the extra choices optional components has several advantages, this being one, and also the possibility to change the choice (of timers, portraits...) back during playthrough sounds interesting too. Hm, but that would be one reason not to make Ajantis BGII's kit choice an optional component, actually, as it wouldn't change anything later. Still pondering about this...

To everyone who is modding: I can only stress the importance to use DESIGNATED to give your components specified - fixed! - component numbers that you won't change in the future (does not need to be 0,1,2,3,... - can also be 0, 10, 20, 30,.. if you want to make sure there is still possibility to add components "in between".)

Link to comment
57 minutes ago, jastey said:

Hm, but that would be one reason not to make Ajantis BGII's kit choice an optional component, actually, as it wouldn't change anything later. Still pondering about this...

 

It's a mirracle that you still ponder about this... because by default Ajantis is a Paladin, NO KIT involved ! So if you give him a kit, it's a infidelity to the original character ! By default. But if you give him an optional component that gives him a kit, it's fine by anyones books. So no default optional component necessary. It's there by default.

And there's sure multiple other mods that can adjust his profs etc... so why add unnecessary added things, while others can do things more thoroughly. That's not to say, you can't add -add kit to Ajantis- components with multiple options via subcomponents, just that none of them need to be the "no Kit" option.

Link to comment

@jastey I was thinking about code example but anyway:

1. You are talking about cross-mod requirements (not cross-mod conflicts between two or more mods/components which can be handled differently), when the one mod is looking especially for specific external mod component, right?

List of things:

- bg1npc v24 component 10 (former 1) The BG1 NPC Project: Banters, Quests, and Interjections

- Jarl's Adventure Pack  Main Component (auto-assigned number of 1) : the main component

- cross-mod requirements which are defined by such code: (you don'r really need to use folder name and .tp2)

ACTION_IF (MOD_IS_INSTALLED ~BG1NPC/BG1NPC.TP2~ "1") BEGIN

Problem:

bg1npc v24 changed DESIGNATED number from 1 to 10(for valid reasons) so now JAP needs update.

Unfortunately, you are depended on other modder support. But there is a way for bg1npc to help you in a way which won't force modder to keep DESIGNATED numbers the same for eternity. But let's start from the beginning:

- let's use weidu %TP2_BASE_NAME% as ID, it's the tp2 file name without intention and without 'setup-'
- the BG1NPC mod is inside BG1NPC/BG1NPC.tp2 file, it has ID of 'BG1NPC' ... that doesn't solve anything

So ... let's assume for a second (not an actual suggestion for bg1npc) , that the "The BG1 NPC Project: Banters, Quests, and Interjections" component would exist as ... separate tp2 file:

- it would probably have a filename ofBG1NPC-BantersQuestsInterjections.tp2 and 'BG1NPC-BantersQuestsInterjections' as ID

But since I'm not suggesting that bg1npc mod should be spited into many tp2 files, what we can use to have ID for mod component? Weidu doesn't have support for such thing but it has ... LABEL:

1. The  "BG1 NPC Project: Banters, Quests, and Interjections" component needs to receive LABEL keyword with "BG1NPC-BantersQuestsInterjections"

https://github.com/Gibberlings3/BG1NPC/blob/eev2.5/bg1npc/bg1npc.tp2#L65

Quote

/* The BG1 NPC Project: Banters, Quests, and Interjections */
BEGIN @1007 DESIGNATED 10 LABEL "BG1NPC-BantersQuestsInterjections"
  GROUP @1006
  REQUIRE_COMPONENT ~bg1npc/bg1npc.tp2~ 0 @1004 /* BG1 NPC Required Changes component is not installed. */
   COPY ~bg1npc/Core/X#component.xx~ ~override/X#BG1NPCPhase1.G3~
   COPY ~bg1npc/Core/X#component.xx~ ~override/X#BG1NPCPhase2.G3~ //legacy file, leave in

There is no technical reason to change such label and one component can have multiple labels if needed.

2. Instead of checking hardcoded component number (MOD_IS_INSTALLED ~BG1NPC/BG1NPC.TP2~ "1") check for component number of the LABEL:

(the syntax is not great but it is what current weidu require)

REQUIRE_PREDICATE (MOD_IS_INSTALLED "BG1NPC.tp2" (ID_OF_LABEL "BG1NPC.tp2" "BG1NPC-BantersQuestsInterjections"))
"This component require 'BG1 NPC Project: Banters, Quests, and Interjections' component to be installed."

So no matter what BG1NPC DESIGNATED number will use for this component, as long as it won't change label, you and all other mods are safe :thumbsup: It still require cooperation between two modders but the main benefit is: it doesn't limit the author of the BG1NPC in terms of how he can structure internal mod components.

I'm aware that all of this require change the concept of how modders see mod components but for me, mod components were always ... well, mods! I use LABEL keyword only because weidu doesn't  have any kind of support for component ID out of the box. But if there are valid user cases...

 

On 3/12/2019 at 5:34 PM, jastey said:

To everyone who is modding: I can only stress the importance to use DESIGNATED to give your components specified - fixed! - component numbers that you won't change in the future (does not need to be 0,1,2,3,... - can also be 0, 10, 20, 30,.. if you want to make sure there is still possibility to add components "in between".)

History shows that it won't work because there are technical reasons to change DESIGNATED (install sequence, GROUP etc). My suggestion would be to ask for label-based solution or implementation of the "component ID" support for weidu in any kind of form.

Edited by AL|EN
Link to comment
11 minutes ago, jastey said:

@AL|EN LABEL is very interesting, I didn't even know about it, ahem. Thanks!

 

It goes even futher: all mod components can have one major label (eg. "MyMod") and and also extra unique label ( eg. "MyModDragonQuest", " "MyModIslandQuest") so it's possible to check for ANY component of the MyMod.tp2 and aslo for specific component separately.

Just to be clear: the LABEL keyword name is not adequate to the context of the usage. I only used it because weidu doesn't have anything else. If there would be an eg. "ID" keyword with documentation, the context of the usage would be much more clear.

Edited by AL|EN
Link to comment

Does LABEL accept .tra references?

BEGIN @1007 DESIGNATED 10 LABEL @5207
  GROUP @1006

and 

ACTION_IF (MOD_IS_INSTALLED "BG1NPC" (ID_OF_LABEL "BG1NPC" @127)) BEGIN

? Docs on adding the additional label so that

@120 = AranWCore

@121 = AranWClassChange

etc?

 

Link to comment

@Wisp 

I would be grateful for any feedback regarding https://github.com/WeiDUorg/weidu/pull/139

Quote

 

ATTENTION! Drawbacks of & \DEFINE{ACTION!READLN}:

installation will be paused
impossible to save user choices, every new installation will require to repeat providing manual input
choices are not included inside weidu installation log, debug information is lost
impossible to use weidu GROUP, LABEL and other features
impossible to display ACTION_READLN choices inside mod managers

Instead of ACTION_READLN please use SUBCOMPONENT feature.

 

If there is something which you want to change etc just let me know. I think it would be the best that this kind of information would be included for the new modders so they don't endup with ACTION_READLN drawbacks from the start.

Link to comment

Because I was the most complain person regarding this, I felt obligated to do everything regarding this matter. This includes updates to weidu documentation so new modders would be encouraged not to use ACTION_READLN. I'm happy to announce that a well-crafted description has been added to the docs. Thanks wisp!

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