Author Topic: Evaluation of the REQUIRE_COMPONENT modComponent number  (Read 8663 times)

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
Evaluation of the REQUIRE_COMPONENT modComponent number
« on: August 30, 2019, 02:56:55 AM »
Hi,

Wouldn't it be too much trouble to extend functionality of REQUIRE_COMPONENT in order to allow evaluation of the modComponent number, just as MOD_IS_INSTALLED action?

This example currently fails:

Quote
BACKUP "IEModA\backup"
SUPPORT "IEModA"
VERSION "1.1.0"


BEGIN "MainComponent" LABEL "IEModA-MainComponent" DESIGNATED 1000


    OUTER_SET ID = ID_OF_LABEL "IEModA.tp2" "IEModA-MainComponent"
    PRINT "%ID%"


BEGIN "ExtraComponent" LABEL "IEModA-ExtraComponent" DESIGNATED 2000
REQUIRE_COMPONENT "IEModA.tp2" (ID_OF_LABEL "IEModA.tp2" "IEModA-MainComponent") "Require IEModA-MainComponent"


    OUTER_SET ID = ID_OF_LABEL "IEModA.tp2" "IEModA-ExtraComponent"    PRINT "%ID%"


This is workaround but with the drawbacks:

Quote
BEGIN "MainComponent" LABEL "IEModA-MainComponent" DESIGNATED 1000


    OUTER_SET ID = ID_OF_LABEL "IEModA.tp2" "IEModA-MainComponent"
    PRINT "%ID%"


BEGIN "ExtraComponent" LABEL "IEModA-ExtraComponent" DESIGNATED 2000
    ACTION_IF MOD_IS_INSTALLED "IEModA.tp2" (ID_OF_LABEL "IEModA.tp2" "IEModA-MainComponent") BEGIN
    OUTER_SET ID = ID_OF_LABEL "IEModA.tp2" "IEModA-ExtraComponent"
    PRINT "%ID%"
    END ELSE BEGIN
        ABORT "Require IEModA-MainComponent"
    END

« Last Edit: August 30, 2019, 03:06:04 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Evaluation of the REQUIRE_COMPONENT modComponent number
« Reply #1 on: August 30, 2019, 02:12:46 PM »
Can you use REQUIRE_PREDICATE? Allowing REQUIRE_COMPONENT to evaluate stuff essentially turns it into a slightly different REQUIRE_PREDICATE.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
Re: Evaluation of the REQUIRE_COMPONENT modComponent number
« Reply #2 on: August 31, 2019, 01:57:45 AM »
I can:

Quote
BACKUP "IEModA\backup"
SUPPORT "IEModA"
VERSION "1.1.0"

BEGIN "MainComponent" LABEL "IEModA-MainComponent" DESIGNATED 1000
    OUTER_SET IEModA-MainComponent = ID_OF_LABEL "IEModA" "IEModA-MainComponent"
    PRINT "%IEModA-MainComponent%"

BEGIN "ExtraComponent" LABEL "IEModA-ExtraComponent" DESIGNATED 2000
    REQUIRE_PREDICATE (MOD_IS_INSTALLED "IEModA.tp2" (ID_OF_LABEL "IEModA" "IEModA-MainComponent" )) "Require IEModA-MainComponent"
    OUTER_SET IEModA-ExtraComponent = ID_OF_LABEL "IEModA" "IEModA-ExtraComponent"
    PRINT "%IEModA-ExtraComponent%"

I guess you can't do anything in terms of simplifying the syntax. One thing I notice that 'MOD_IS_INSTALLED' needs '.tp2', does it have to?


Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

 

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)?: