Hi wisp,
many mods already have used code using MOD_IS_INSTALLED/REQUIRE_COMPONENT ("one component needs another, not the way around") and FORBID_COMPONENT ("can't install this component because other is present").
I need to access those data somehow so how about --list-dependence ?
Syntax:
tp2nameWithoutSetup(componentNumber):tp2nameWithoutSetup(componentNumber)
Example 1 internal dependence :
https://github.com/subtledoctor/NPC_EE/blob/9f5272c2190ee8506e2d1ddc97d477269b99746e/npc_ee/npc_ee.tp2#L752BEGIN @3000
DESIGNATED 3000
REQUIRE_COMPONENT ~npc_ee.tp2~ ~2000~ @1
//GROUP @6
Proposed output:
npc_ee(3000):npc_ee(2000)
tp2 name it's the same (it's internal dependence ) but external dependence like this:
https://github.com/vbigiani/refinements/blob/a587dd5e8675f13817b40f6a6ba09c57f0c56c57/setup-refinements.tp2#L293BEGIN @702
SUBCOMPONENT @700
FORBID_COMPONENT ~bg2fixpack.tp2~ 0 ~Already included in BG2 Fixpack~
have tp2 name for another mod/component.
Proposed output:
refinements(702)>bg2fixpack(0)
The "
>" stands for "conflict", you can use anything else with will distinct REQUIRE_COMPONENT from FORBID_COMPONENT
EDIT: one more example with "MOD_IS_INSTALLED" :
https://github.com/Argent77/A7-NoEENPCs/blob/master/A7NoEENPCs/setup-A7NoEENPCs.tp2#L56
BEGIN @301 // Make NPC-specific items available for everyone
REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee eet~) @1000 // This component requires either BG:EE, BG2:EE or EET to be installed.
REQUIRE_PREDICATE ((MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 1) OR
(MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 101) OR
(MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 102) OR
(MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 103) OR
(MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 104) OR
(MOD_IS_INSTALLED ~setup-A7NoEENPCs.tp2~ 105)) @1005 // This component is only available if one or more NPCs have been disabled.
REQUIRE_PREDICATE (NOT ((MOD_IS_INSTALLED ~EE_content_tweaks.tp2~ 0) OR
(MOD_IS_INSTALLED ~EE_content_tweaks.tp2~ 1))) @1006 // This mod is not compatible with Pecca's EE_content_tweaks.
DESIGNATED 301
Proposed output:
A7NoEENPCs(301):A7NoEENPCs(1)
A7NoEENPCs(301):A7NoEENPCs(101)
A7NoEENPCs(301):A7NoEENPCs(102)
A7NoEENPCs(301):A7NoEENPCs(104)
A7NoEENPCs(301):A7NoEENPCs(105)
A7NoEENPCs(301)>EE_content_tweaks(0)
A7NoEENPCs(301)>EE_content_tweaks(1)
// Output for the rest of the weidu code
A7NoEENPCs(101):A7NoEENPCs(3)
A7NoEENPCs(102):A7NoEENPCs(3)
A7NoEENPCs(103):A7NoEENPCs(3)
A7NoEENPCs(104):A7NoEENPCs(3)
A7NoEENPCs(105):A7NoEENPCs(3)
A7NoEENPCs(201):A7NoEENPCs(3)
A7NoEENPCs(203):A7NoEENPCs(3)
A7NoEENPCs(204):A7NoEENPCs(3)
A7NoEENPCs(205):A7NoEENPCs(3)
A7NoEENPCs(101)>A7NoEENPCs(1)
A7NoEENPCs(102)>A7NoEENPCs(1)
A7NoEENPCs(103)>A7NoEENPCs(1)
A7NoEENPCs(104)>A7NoEENPCs(1)
A7NoEENPCs(105)>A7NoEENPCs(1)
A7NoEENPCs(201)>A7NoEENPCs(1)
A7NoEENPCs(203)>A7NoEENPCs(1)
A7NoEENPCs(204)>A7NoEENPCs(1)
A7NoEENPCs(205)>A7NoEENPCs(1)
A7NoEENPCs(101)>A7NoEENPCs(2)
A7NoEENPCs(102)>A7NoEENPCs(2)
A7NoEENPCs(103)>A7NoEENPCs(2)
A7NoEENPCs(104)>A7NoEENPCs(2)
A7NoEENPCs(105)>A7NoEENPCs(2)
A7NoEENPCs(201)>A7NoEENPCs(2)
A7NoEENPCs(203)>A7NoEENPCs(2)
A7NoEENPCs(204)>A7NoEENPCs(2)
A7NoEENPCs(205)>A7NoEENPCs(2)
assuming that the "|" character means "OR", the above output can be simplified to:
A7NoEENPCs(301):A7NoEENPCs(1|101|102|103|104|105)
A7NoEENPCs(301)>EE_content_tweaks(0|1)
and for the rest of the weidu code:
A7NoEENPCs(101|102|103|104|105|201|203|204|205):A7NoEENPCs(3)
A7NoEENPCs(101|102|103|104|105|201|203|204|205)>A7NoEENPCs(1|2)
The logic behind this exist inside weidu, I'm just asking about a way to get easy access to this data.