Skip to content

[solved] How can a mod detect LoB?

PaulaMigratePaulaMigrate Member Posts: 1,201
edited September 2017 in General Modding
Is there a way for mods to detect that the player uses Legacy of Bhaal mod?

Will
DifficultyGT(NORMAL)
detect it, LoB it is not in Divlev.ids?
Post edited by PaulaMigrate on

Comments

  • KuronaKurona Member Posts: 881
    edited September 2017
    You can check if BD_NIGHTMARE_MODE is 1.

    (It's a global variable)
  • TressetTresset Member, Moderator Posts: 8,268
    edited September 2017
    It looks kinda like you want to detect this for script writing.

    I believe this will return true if it is on:
    IF
    NightmareModeOn()
    and this will return true if it is off:
    IF
    !NightmareModeOn()
    For example:
    IF
    Global("ACH_LORD_OF","GLOBAL",0)
    Global("bd_ach_difficulty","global",2)
    AreaCheck("AR0125")
    Dead("Sarevok") // Armored Figure
    NightmareModeOn()
    THEN
    RESPONSE #100
    SetGlobal("ACH_LORD_OF","GLOBAL",1)
    END
    This is the block of script from ACHIEVEM.BCS that gives the achievement for beating BG1 on LoB difficulty.

    Edit: Ninja'd again.
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    Kurona said:

    You can check if BD_NIGHTMARE_MODE is 1.

    (It's a global variable)

    Thank you.
    Yes, it is set. But it looks like any mod added NPC is unusable in LoB anyway. They all come at level 15-18 with no XPs but millions of points needed to level them up correctly. Their stats are all over the place etc.
    Most likely LoB only works for vanilla NPCs - unless the modders would specifically re-work them for LoB.
  • TressetTresset Member, Moderator Posts: 8,268
    Check to see if the mod NPCs have flag 22 on their creature file. The flag is labeled in NI as "EE: Ignore Nightmare Mode (22)" amd all the vanilla NPCs have this flag so I am assuming it needs to be on for NPCs.
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    Tresset said:

    Check to see if the mod NPCs have flag 22 on their creature file. The flag is labeled in NI as "EE: Ignore Nightmare Mode (22)" amd all the vanilla NPCs have this flag so I am assuming it needs to be on for NPCs.

    Right, I've seen that flag but forgot about it again.

    I have a highly modded EET game, but the only NPCs that have the flag are the vanilla ones. No mod NPC has it - there are only a few golems from the *Golem construction mod* that have it set.

    Means either modders don't know about this or have chosen not to support LoB.
  • argent77argent77 Member Posts: 3,478

    Means either modders don't know about this or have chosen not to support LoB.

    I would say the former since CRE format description on IESDP doesn't list it yet as a valid flag.
Sign In or Register to comment.