Jump to content

Question to the use of REQUIRE_FILE and REQUIRE_PREDICATE


jastey

Recommended Posts

Apologies for opening the third thread to basically the same thing, but..

 

I split my mod in two halves, the second component only to be accessible if the first component is installed. This works, but I have the following question:

 

If I use REQUIRE_FILE, the great advantage (in my opinion) is that the second component will be automatically deinstalled if the required file is gone (i.e. if the mod's first component is deinstalled).

 

Unfortunately, I also have to check for more conditions in the game.

 

From the error messages I encounter, I assume a combination of

 

REQUIRE_FILE ~..~ ~..~

REQUIRE_PREDICATE (..) ~..~

 

is not possible. But when I use

 

REQUIRE_PREDICATE (FILE_EXISTS ~...~ etc.

 

the automatic deinstallation of the second mod's component does not take place, it offers to reinstall the component first, the player has to deinstall the component by hand. Is there any solution to this (or am I just picky)?

Link to comment

From the error messages I encounter, I assume a combination of

 

REQUIRE_FILE ~..~ ~..~

REQUIRE_PREDICATE (..) ~..~

 

is not possible.

Can you be more specific about the elided parts? If you were to use conflicting predicates, I suppose that could cause problems, but there is nothing general that prevents the combination that I am aware of.

 

the automatic deinstallation of the second mod's component does not take place, it offers to reinstall the component first, the player has to deinstall the component by hand. Is there any solution to this (or am I just picky)?

Can't reproduce entirely. With REQUIRE_PREDICATE, the second component is automatically uninstalled, but the option to reinstall or uninstall it are (seemingly erroneously) available. I'll have a closer look at this.
Link to comment

There's always been some weirdness to WeiDU's install/uninstall/reinstall methods. I reported it to the bigg a while back, and he suggested a sort of "triple redundancy" (or at least double) e.g.:

REQUIRE_COMPONENT ~level1npcs.tp2~ 0 @110600
SUBCOMPONENT @410100 (MOD_IS_INSTALLED ~level1npcs.tp2~ 0)
ACTION_IF NOT MOD_IS_INSTALLED ~level1npcs.tp2~ 0 BEGIN
  FAIL @110600
END

In other words, a subcomponent won't get installed, or will get uninstalled if/when the main component isn't present or is uninstalled, with a triplicate check. And yet we still have odd bug reports like this, which really shouldn't be happening AFAICT (if you say to skip a component, WeiDU should skip it). Offhand, I don't know how to solve it if it's not a bug in WeiDU itself.

Link to comment

Sorry, I should have been more specific from the start.

 

If I use the following, upon deinstallation, the second component (flagged with this) gets the "Do you want to reinstall, deinstall etc. (don't remember the exact quote)", but gets deinstalled no matter what is pressed. Ideally, the option wouldn't be available at all. (Skipping the second component if the first one isn't installed at all works fine.)

 

REQUIRE_PREDICATE (FILE_EXISTS ~override/C#SolaufeinCore.RR~) ~Jastey's Solaufein mod is not installed~

REQUIRE_PREDICATE (((GAME_IS ~bg2 tob bgt~) AND (MOD_IS_INSTALLED ~SETUP-INFINITYANIMATIONS.TP2~ "0") AND (FILE_EXISTS ~override/µaba1.bam~) AND (FILE_EXISTS ~override/µaca1.bam~)) OR ((GAME_IS ~bg2ee~) AND (MOD_IS_INSTALLED ~SETUP-EXTENDEDANIMATIONS.TP2~ "0") AND (FILE_EXISTS ~override/##.bam~))) ~The required core component of the animation mod is not installed or the animation is missing, refer to readme.~

 

With the following REQUIRE_FILE alone, the second component is deinstalled automatically if the main component is uninstalled (EDIT: This is the behavior I would like to have all in all):

 

REQUIRE_FILE ~override/C#SolaufeinCore.RR~ ~Jastey's Solaufein mod is not installed~

 

 

If I try to combine the two like this:

 

REQUIRE_FILE ~override/C#SolaufeinCore.RR~ ~Jastey's Solaufein mod is not installed~

REQUIRE_PREDICATE (((GAME_IS ~bg2 tob bgt~) AND (MOD_IS_INSTALLED ~SETUP-INFINITYANIMATIONS.TP2~ "0") AND (FILE_EXISTS ~override/µaba1.bam~) AND (FILE_EXISTS ~override/µaca1.bam~)) OR ((GAME_IS ~bg2ee~) AND (MOD_IS_INSTALLED ~SETUP-EXTENDEDANIMATIONS.TP2~ "0") AND (FILE_EXISTS ~override/##.bam~))) ~The required core component of the animation mod is not installed or the animation is missing, refer to readme.~

I get the error message if I try to install:

 

[C#SOLAUFEIN/SETUP-C#SOLAUFEIN.TP2] PARSE ERROR at line 532 column 1-17
Near Text: REQUIRE_PREDICATE
GLR parse error

[C#SOLAUFEIN/SETUP-C#SOLAUFEIN.TP2] ERROR at line 532 column 1-17
Near Text: REQUIRE_PREDICATE
Parsing.Parse_error
ERROR: parsing [C#SOLAUFEIN/SETUP-C#SOLAUFEIN.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [C#SOLAUFEIN/SETUP-C#SOLAUFEIN.TP2]: Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

Link to comment

I get the error message if I try to install:

Well, at least that one is easy. REQUIRE_FILE is an action and REQUIRE_PREDICATE is a component flag. The latter is being used in a syntactically incorrect context.

And yet we still have odd bug reports like this, which really shouldn't be happening AFAICT (if you say to skip a component, WeiDU should skip it).

It could very well be a WeiDU bug. My mistake. It's of course not a bug. This is how stack operations work (barring certain guarantees which do not apply here). When Aerie is reinstalled, all subsequent componets also need to be reinstalled, in case there is overlap.

 

Well, it is perhaps a bug that [N] is even presented as an option, but I have bad feelings about being able to fix it.

Link to comment

Cool! If I flip the order, it works.

 

Thank you for drawing my attention to the one being an action and the other one being a component flag. I think I understood something today.

 

-From my side, this is solved, it behaves now the way I want it.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...