Skip to content

Q for weidu experts: ACTION_IF inside ACTION_IF?

[Deleted User][Deleted User] Posts: 0
edited September 2014 in General Modding
The user and all related content has been deleted.
Post edited by [Deleted User] on

Comments

  • [Deleted User][Deleted User] Posts: 0
    edited September 2014
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • GrammarsaladGrammarsalad Member Posts: 2,582
    I am shooting from the hip, but if it is bgee, then it has clsrcreq.2da, yes? It seems you can check for bgee1/2 first, add kit bgee style, else begin add vanilla slinger, check for clsrcreq, add ranger slinger for vanilla, else add fighter slinger. (Using proper syntax of course!)

    I could be missing something. Haven't actually used that command
  • CrevsDaakCrevsDaak Member Posts: 7,155
    Yeah, it does work and well. Same applies for PATCH_IF.
  • [Deleted User][Deleted User] Posts: 0
    edited September 2014
    The user and all related content has been deleted.
  • [Deleted User][Deleted User] Posts: 0
    edited September 2014
    The user and all related content has been deleted.
  • CrevsDaakCrevsDaak Member Posts: 7,155

    (Man it gets complicated though - 3 different engines, 3 different sets of string references... it's head-spinning.)

    You could make some
    DEFINE_ACTION_FUNCTION action_function_name BEGIN
    // do classic .tp2 actions here
    END
    and put the stuff that is shared between each version for each game. Also you could use %variables% for the stuff that changes if you Kit rebalancing or whatever is installed or no, and add a previous
    ACTION_IF put_your_check_here = 1 BEGIN
    OUTER_SPRINT variable_name "variable_value"
    END ELSE BEGIN
    OUTER_SPRINT variable_name "another_variable_value"
    END
    .
    To launch an ACTION_FUNCTION simply use
    LPF action_function_name END
    (LPF is the short for LAUNCH_PATCH_FUNCTION).
  • The user and all related content has been deleted.
  • ErgErg Member Posts: 1,756
    edited September 2014

    can a component have 2 REQUIRE_PREDICATE arguments? Like:

    BEGIN ~Add kit for TobEx~
    REQUIRE_PREDICATE ENGINE_IS ~tob~
    REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~clsrcreq.2da~

    ADD_KIT ~yadda yadda


    Will that only run if both predicates return true?

    @subtledoctor, you need just one REQUIRE_PREDICATE:

    BEGIN ~Add kit for TobEx~
    REQUIRE_PREDICATE ((ENGINE_IS ~tob~) AND (FILE_EXISTS_IN_GAME ~clsrcreq.2da~))

    ADD_KIT ~yadda yadda

  • The user and all related content has been deleted.
  • ErgErg Member Posts: 1,756
    edited September 2014

    the user would only have to interact with one - the one corresponding to their engine. ?

    Yes.

    If the predicate is false the component is skipped and the user is notified of the reason why it is skipped. There is no interaction unless the predicate is true. For example

    REQUIRE_PREDICATE condition ~Message for the User.~
    will simply produce something like that
    SKIPPING: [Name of Component]
    Message for the User.
    during installation (and in the DEBUG file), if the condition is false.
  • [Deleted User][Deleted User] Posts: 0
    edited September 2014
    The user and all related content has been deleted.
  • WispWisp Member Posts: 1,102
    @subtledoctor‌
    Yes, you can have multiple REQUIRE_PREDICATEs for the same component. They must all be true or the component will not install (it's semantically equivalent to using AND, except you can have one message per REQUIRE_PREDICATE). And to keep our terminology straight, REQUIRE_PREDICATE is a component flag and not a function.
  • The user and all related content has been deleted.
Sign In or Register to comment.