Jump to content


Photo

How to set a dependency on a DESIGNATED component


  • Please log in to reply
8 replies to this topic

#1 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 17 June 2021 - 12:46 AM

Very silly question, but how do I code a dependency on a DESIGNATED component from another mod?

 

Appreciate LABEL is now the way to do it, but there are mods that still haven't been updated to make use of LABEL and DESIGNATED is all you have to code the dependency.



#2 ALIEN

ALIEN
  • Modder
  • 983 posts

Posted 17 June 2021 - 01:15 AM

Simplest and with nice syntax: REQUIRE_COMPONENT

REQUIRE_COMPONENT "ModID" "0" "You must have infinite stacking installed!"

You don't need to put 'setup-' not 'tp2.


Project Infinity public BETA - mod manager for Infinity Engine games

Infinity Auto Packager - automatically generate and adds mod packages to GitHub release

Modder's Guide to GitHub - you cannot have progress without committing changes


#3 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 17 June 2021 - 01:29 AM

Thank you!



#4 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 07 July 2021 - 12:30 PM

Having some issues with ID_OF_LABEL as well.

 

This code is tripping WeiDU up and I don't know what is wrong with it:

 

REQUIRE_PREDICATE MOD_IS_INSTALLED ~nostalgia.tp2~ ID_OF_LABEL "ac-bg-sprites" @82 // ~This component requires Restore BG1 Character Sprites~


 



#5 ALIEN

ALIEN
  • Modder
  • 983 posts

Posted 07 July 2021 - 02:02 PM

ID_OF_LABEL require tp2 name. Also parentheses. I know, the syntax is bad.

REQUIRE_PREDICATE MOD_IS_INSTALLED ~nostalgia.tp2~ (ID_OF_LABEL ~nostalgia.tp2~ "ac-bg-sprites") @82

 

For more, see this guide: https://www.gibberli...t-dependencies/


Project Infinity public BETA - mod manager for Infinity Engine games

Infinity Auto Packager - automatically generate and adds mod packages to GitHub release

Modder's Guide to GitHub - you cannot have progress without committing changes


#6 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 08 July 2021 - 02:59 AM

Thank you again :)



#7 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 13 July 2021 - 09:36 AM

What if I wanted to check two components and allow installation if one of them is detected?

 

For example, I have two LABELs: "ac-bg-sprites" and "ac-bg-spritesns". The relative components do the same thing, except one of them also offers to patch saved games. I would like to REQUIRE_PREDICATE that one of them is installed, whichever it is.



#8 ALIEN

ALIEN
  • Modder
  • 983 posts

Posted 13 July 2021 - 10:07 AM

Use "OR" 

REQUIRE_PREDICATE (MOD_IS_INSTALLED ~nostalgia.tp2~ (ID_OF_LABEL ~nostalgia.tp2~ "ac-bg-sprites") OR (MOD_IS_INSTALLED ~nostalgia.tp2~ (ID_OF_LABEL ~nostalgia.tp2~ "ac-bg-spritesns")) @82

Edited by ALIEN, 13 July 2021 - 10:08 AM.

Project Infinity public BETA - mod manager for Infinity Engine games

Infinity Auto Packager - automatically generate and adds mod packages to GitHub release

Modder's Guide to GitHub - you cannot have progress without committing changes


#9 Andrea C.

Andrea C.
  • Modder
  • 457 posts

Posted 13 July 2021 - 10:22 AM

Thank you :)