Author Topic: SUBCOMPONENT bug  (Read 3083 times)

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
SUBCOMPONENT bug
« on: February 17, 2010, 11:32:20 AM »
From the SUBCOMPONENT tutorial:
Quote
Any REQUIRE_FILEs or other module requirements for the whole group should be put with the first subcomponent. If such a requirement fails, none of the subcomponents can be installed. In addition, each individual subcomponent can be guarded by its own predicate. If that predicate fails, that particular subcomponent cannot be installed.
The first part of this (in bold) isn't true. The fact the second part *is* true makes the fact the first part *isn't* pretty stupid. Why have individual predicates separately? Evidently, this is the way it functions anyhow.

This, for example, should not be possible:
Quote
~SETUP-LIGHTMAPS.TP2~ #1 #0 // Corrected lightmaps for BG TuTu/BGT/Baldur's Gate
~INFINITYANIMATIONS/SETUP-INFINITYANIMATIONS.TP2~ #0 #210 // Cambion/Isair Animation -> All cambions: Beta 4
~INFINITYANIMATIONS/SETUP-INFINITYANIMATIONS.TP2~ #0 #260 // Alu-Fiend/Madae Animation -> All alu-fiends: Beta 4
~INFINITYANIMATIONS/SETUP-INFINITYANIMATIONS.TP2~ #0 #490 // Svirfneblin Animations -> Animations and sounds: Beta 4
The first component of every SUBCOMPONENT of Infinity Animations has a REQUIRE_COMPONENT of the main mod component. Presumably you're able to skip that by picking a SUBCOMPONENT other than the first in a grouping (this will crash your game if the main component is not installed).

Please don't say this can't be fixed without breaking someone's mod. Anyone who coded rationally by the tutorial's explanation would *expect* the mod to fail if the predicates aren't met for the first SUBCOMPONENT.

Quite possibly, this only applies to installing things in batch mode (a la BWP/BWS). But it should work there the same way it does in interactive mode, and apparently the same way it does in batch mode for regular REQUIRE_COMPONENTs without SUBCOMPONENTs.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #1 on: February 17, 2010, 11:42:35 AM »
Please don't say this can't be fixed without breaking someone's mod. Anyone who coded rationally by the tutorial's explanation would *expect* the mod to fail if the predicates aren't met for the first SUBCOMPONENT.
In that case, I'm going to use excuse #2 and say that the code governing the menu is so brittle that I don't want to touch it  :)

It's probable that install_component handle_letter "Y" doesn't correctly enforce subcomponent group requirements, shouldn't be too hard to fix.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #2 on: February 17, 2010, 06:42:08 PM »
Fixed.

By the way, you can specify predicates either via REQUIRE/FORBID_FILE/COMPONENT/PREDICATE, and/or by putting an expression after SUBCOMPONENT:

Code: [Select]
BEGIN ~component 1~
REQUIRE_PREDICATE (FILE_EXISTS_IN_GAME ~a.itm~) ~a.itm is missing~
SUBCOMPONENT ~my group~ (FILE_EXISTS_IN_GAME ~b.itm~)

BEGIN ~component 2~
REQUIRE_PREDICATE (FILE_EXISTS_IN_GAME ~c.itm~) ~c.itm is missing~
SUBCOMPONENT ~my group~ (FILE_EXISTS_IN_GAME ~d.itm~)

BEGIN ~component 3~
SUBCOMPONENT ~my group~

Current behavior is to do the following:

a.itm is missing: don't ask anything about this subcomponent group
b.itm is missing: ask only about 2 and 3
c.itm is missing: ask about 1, 2 and 3; if answered 2, fail and don't ask again
d.itm is missing: ask only about 1 and 3

While I was there, I made the c.itm case fall back into d.itm.
« Last Edit: February 17, 2010, 06:44:49 PM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #3 on: February 17, 2010, 11:25:44 PM »
While I was there, I made the c.itm case fall back into d.itm.
That would be what I'd have expected, but I've never considered using syntax like that (the d.itm case makes more sense per the tutorial etc.).

So the stuff that "doesn't ask" about missing predicates also now forbids them from being installed (via batch or otherwise), aye? Is there some freakish hackaround for this or do I have to wait for v214?

Offline Mike1072

  • Planewalker
  • *****
  • Posts: 298
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #4 on: February 17, 2010, 11:52:15 PM »
I just had to redo a bunch of the IR game checks I slapped on recently because I didn't expect REQUIRE_PREDICATE would work differently when components are in a group.  Groups suck.
« Last Edit: February 17, 2010, 11:54:41 PM by Mike1072 »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #5 on: February 18, 2010, 01:00:08 PM »
So the stuff that "doesn't ask" about missing predicates also now forbids them from being installed (via batch or otherwise), aye? Is there some freakish hackaround for this or do I have to wait for v214?
ACTION_IF blah_blah THEN FAIL
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #6 on: May 10, 2010, 03:18:34 PM »
So I DEPRECATED a couple of my subcomponents (2 out of the 4 in one component) because I put improved versions of them in a different component. But this deprecated the entire component? Buggery. I guess I'll have to just comment them out or delete them.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: SUBCOMPONENT bug
« Reply #7 on: May 10, 2010, 04:16:16 PM »
DEPRECATED and REQUIRE_COMPONENT are treated in the same way (so, if R_C causes a subcomponent group to be skipped, DEPRECATED will do the same thing).

Removing the SUBCOMPONENT designation from the DEPRECATED components should do the trick.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: