Jump to content

Story mode and Legacy of Bhaal in EET


Roxanne

Recommended Posts

Anyway Azoth here is a save with fixed Imoen (well, not entirely since she won't be available during end cutscene due to some leftovers caused by story mode that still affects her since she couldn't join the team right after this conversation).

 

Do you have some more information what story mode does to NPC scripts. This may be an issue also for a number of mods if some vanilla NPCs cannot/can disappear/be removed from the game (e.g. for revisiting areas in later campaigns)?

Story mode is something I have never considered so far...(maybe it is best to recommend not to use it in EET, or at least not in context with some mods)?

Link to comment

 

Story mode is something I have never considered so far...(maybe it is best to recommend not to use it in EET, or at least not in context with some mods)?

I think it's worth the effort to code with it in mind. Let's not gimp player's experience :p Same goes for Legacy of Bhaal mode (Heart of Winter equivalent from IWD) that requires modders to set additional CRE 0x10 flag on BIT22 "EE: Ignore nightmare mode" for joinable NPCs and creatures that you don't want this gameplay effect to affect.

 

Story mode from what I see works like this:

- in global scripts (BALDUR.BCS, BALDUR25.BCS, BDBALDUR.BCS) there is this code:

IF
  Global("OHSMODE","GLOBAL",1)
  Global("OHSMOFF","GLOBAL",0)
  OR(2)
    !StoryModeOn()
    NightmareModeOn()
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    SetGlobal("OHSMODE","GLOBAL",0)
    ReallyForceSpellDeadRES("OHSMODE2",Player1) // No such index
    DisplayStringNoNameHead(Player1,103102) // Story Mode: Off
    SetInterrupt(TRUE)
END

IF
  Global("OHSMODE","GLOBAL",0)
  Global("OHSMOFF","GLOBAL",0)
  StoryModeOn()
  !NightmareModeOn()
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    SetGlobal("OHSMODE","GLOBAL",1)
    ReallyForceSpellDeadRES("OHSMODE1",Player1) // No such index
    DisplayStringNoNameHead(Player1,103101) // Story Mode: On
    SetInterrupt(TRUE)
END

IF
  StoryModeOn()
  Exists(Familiar)
  !CheckSpellState(Familiar,STORY_MODE)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE4",Familiar) // No such index
    SetInterrupt(TRUE)
END

IF
  !StoryModeOn()
  Exists(Familiar)
  CheckSpellState(Familiar,STORY_MODE)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE3",Familiar) // No such index
    SetInterrupt(TRUE)
END

Pretty self explenatory stuff, right?

OHSMODE1.SPL that affects whole party is cast on Player1. It adds tons of protection effects making your party immortal and resistant to most of the negative spell effects.

OHSMODE2.SPL is used to completly remove all OHSMODE1.SPL bonuses from the party via awesome EE exclusive effect ''Remove effects by Resource".

OHSMODE3.SPL same as 2 but affects only 1 character instead of party.

OHSMODE4.SPL same as 1 buf affects only 1 character instead of party.

 

Joinable NPC characters have this code added to Override script:

IF
  !InParty(Myself)
  CheckSpellState(Myself,STORY_MODE)
THEN
  RESPONSE #100
    ReallyForceSpellDeadRES("OHSMODE3",Myself) // No such index
    Continue()
END

so you need to include it for your NPCs too.

 

On top of that DPLAYER2.BCS and DPLAYER3.BCS have this code:

IF
  Global("OHSMODE","GLOBAL",1)
  Global("OHSMLOC","LOCALS",0)
  InParty(Myself)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE1",Myself) // No such index
    SetInterrupt(TRUE)
END

IF
  Global("OHSMODE","GLOBAL",0)
  Global("OHSMLOC","LOCALS",1)
  InParty(Myself)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE2",Myself) // No such index
    SetInterrupt(TRUE)
END

-------

 

 

In order to temporary disable Story Mode for whole party you can use for example this code:

IF
  Global("VariableName","MYAREA",0)
  StoryModeOn()
THEN
  RESPONSE #100
    SetGlobal("VariableName","MYAREA",1)
    ReallyForceSpellDeadRES("OHSMODE3",Player1) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player2) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player3) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player4) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player5) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player6) // No such index
    Continue()
END

and in order to reenable it once you finish your stuff that requires party to be affected by spell effects that story mode prevents:

IF
  Global("VariableName2","MYAREA",0)
  StoryModeOn()
THEN
  RESPONSE #100
    SetGlobal("VariableName2","MYAREA",1)
    ReallyForceSpellDeadRES("OHSMODE1",Player1) // No such index
    Continue()
END

As for the problem with Imoen. Most of the time you don't have to do anything as this is regulated by NPC Override script as you can see above (for example there weren't any problems with Minsc, Jaheira, Khalid in the Lobsterkun's save), but if you force the NPC to leave without a time for Override script to react than just in case it may be a good idea to remove story mode effects during that script run via:

ReallyForceSpellDeadRES("OHSMODE3","Imoen2")

Untested but something like this should work.

Link to comment

 

 

Anyway Azoth here is a save with fixed Imoen (well, not entirely since she won't be available during end cutscene due to some leftovers caused by story mode that still affects her since she couldn't join the team right after this conversation).

 

Do you have some more information what story mode does to NPC scripts. This may be an issue also for a number of mods if some vanilla NPCs cannot/can disappear/be removed from the game (e.g. for revisiting areas in later campaigns)?

Story mode is something I have never considered so far...(maybe it is best to recommend not to use it in EET, or at least not in context with some mods)?

nah, it should be doable to code with it in mind. Let's not gimp player's experience :p Same goes for Legacy of Bhaal mode (Heart of Winter equivalent from IWD) that requires modders to set additional CRE 0x10 flag on BIT22 "EE: Ignore nightmare mode" for joinable NPCs and creatures that you don't want this gameplay effect to affect.

 

Story mode from what I see works like this:

- in global scripts (BALDUR.BCS, BALDUR25.BCS, BDBALDUR.BCS) there is this code:

IF
  Global("OHSMODE","GLOBAL",1)
  Global("OHSMOFF","GLOBAL",0)
  OR(2)
    !StoryModeOn()
    NightmareModeOn()
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    SetGlobal("OHSMODE","GLOBAL",0)
    ReallyForceSpellDeadRES("OHSMODE2",Player1) // No such index
    DisplayStringNoNameHead(Player1,103102) // Story Mode: Off
    SetInterrupt(TRUE)
END

IF
  Global("OHSMODE","GLOBAL",0)
  Global("OHSMOFF","GLOBAL",0)
  StoryModeOn()
  !NightmareModeOn()
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    SetGlobal("OHSMODE","GLOBAL",1)
    ReallyForceSpellDeadRES("OHSMODE1",Player1) // No such index
    DisplayStringNoNameHead(Player1,103101) // Story Mode: On
    SetInterrupt(TRUE)
END

IF
  StoryModeOn()
  Exists(Familiar)
  !CheckSpellState(Familiar,STORY_MODE)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE4",Familiar) // No such index
    SetInterrupt(TRUE)
END

IF
  !StoryModeOn()
  Exists(Familiar)
  CheckSpellState(Familiar,STORY_MODE)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE3",Familiar) // No such index
    SetInterrupt(TRUE)
END

Pretty self explenatory stuff, right?

OHSMODE1.SPL that affects whole party is cast on Player1. It adds tons of protection effects making your party immortal and resistant to most of the negative spell effects.

OHSMODE2.SPL is used to completly remove all OHSMODE1.SPL bonuses from the party via awesome EE exclusive effect ''Remove effects by Resource".

OHSMODE3.SPL same as 2 but affects only 1 character instead of party.

OHSMODE4.SPL same as 1 buf affects only 1 character instead of party.

 

Joinable NPC characters have this code added to Override script:

IF
  !InParty(Myself)
  CheckSpellState(Myself,STORY_MODE)
THEN
  RESPONSE #100
    ReallyForceSpellDeadRES("OHSMODE3",Myself) // No such index
    Continue()
END

so you need to include it for your NPCs too.

 

On top of that DPLAYER2.BCS and DPLAYER3.BCS have this code:

IF
  Global("OHSMODE","GLOBAL",1)
  Global("OHSMLOC","LOCALS",0)
  InParty(Myself)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE1",Myself) // No such index
    SetInterrupt(TRUE)
END

IF
  Global("OHSMODE","GLOBAL",0)
  Global("OHSMLOC","LOCALS",1)
  InParty(Myself)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpellDeadRES("OHSMODE2",Myself) // No such index
    SetInterrupt(TRUE)
END

-------

 

 

In order to temporary disable Story Mode for whole party you can use for example this code:

IF
  Global("VariableName","MYAREA",0)
  StoryModeOn()
THEN
  RESPONSE #100
    SetGlobal("VariableName","MYAREA",1)
    ReallyForceSpellDeadRES("OHSMODE3",Player1) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player2) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player3) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player4) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player5) // No such index
    ReallyForceSpellDeadRES("OHSMODE3",Player6) // No such index
    Continue()
END

and in order to reenable it once you finish your stuff that requires party to be affected by spell effects that story mode prevents:

IF
  Global("VariableName2","MYAREA",0)
  StoryModeOn()
THEN
  RESPONSE #100
    SetGlobal("VariableName2","MYAREA",1)
    ReallyForceSpellDeadRES("OHSMODE1",Player1) // No such index
    Continue()
END

As for the problem with Imoen. Most of the time you don't have to do anything as this is regulated by NPC Override script as you can see above (for example there weren't any problems with Minsc, Jaheira, Khalid in the Lobsterkun save), but if you force the NPC to leave without a time for Override script to react than just in case it may be a good idea to remove story mode effects during that script run via:

ReallyForceSpellDeadRES("OHSMODE3","Imoen2")

Untested but something like this should work.

 

Thank you so much.

Looks straight forward. It seems to me that I need to take that into account for my NPCs from start of ToB campaign onwards, thus that any story mode settings are disabled should they leave and re-join in my later expansions.

During the regulat campaigns it should not affect my mod.

Link to comment

no problem. Some more things regarding story mode detection other than StoryModeOn():

- OHSMODE1.SPL and OHSMODE4.SPL sets OHSMLOC local variable to 1

- OHSMODE2.SPL and OHSMODE3.SPL sets OHSMLOC local variable to 0

- you can also check if particular character is under story mode effects via trigger:

CheckSpellState(Myself,STORY_MODE)

of course Myself could be any object including DV references.

Link to comment

Another question concerning NPC modification - not sure if EET does it or not.

 

Every joinable NPC gets a class script assigned automatically upon joining (just like dplayer2 in DEFAULT). This is supposed to provide some "enhanced" AI script. The vanilla ones get a BDName, mod NPCs get BDDefal.bcs.

 

Is there a reason for this enforcing an AI script?

Is there a way to prevent it?

 

Such behaviour counteracts NPCs who have elaborated scripts of their own by enforcing a mediocre behaviour,

Link to comment

Is there a way to prevent it?

Well...if memory serves, the player can do that by assigning any other script of they like to the spot. Yeah, it's the one that the player assigns in character customization. It's where I tried to make you put your custom battle script ... as the player can customize the cheese out of it, and what ever you put in it doesn't really make that much of a difference, as one can disable it with ease.

 

Such behaviour counteracts NPCs who have elaborated scripts of their own by enforcing a mediocre behaviour,

Right, and the player has no say to it... as they can also disable it. "NPC with an elaborated scripts of their own", are the mediocre at best. At worst they run into fireballs and are never seen again ... or was it at bests, I could never decide. :devlook:
Link to comment

it's controlled by PARTYAI.2DA You don't need to add your NPC there.

That is the one to assign individual scripts to those in the list.

 

The problem is that anyone who is not on the list gets BDDefal.bcs instead.

 

Maybe the solution is to ADD my NPCs to the list and give them an empty script here.

Link to comment

 

Is there a way to prevent it?

Well...if memory serves, the player can do that by assigning any other script of they like to the spot. Yeah, it's the one that the player assigns in character customization. It's where I tried to make you put your custom battle script ... as the player can customize the cheese out of it, and what ever you put in it doesn't really make that much of a difference, as one can disable it with ease.

 

This is what it was in the old game. The default was *none* and you had to consciously do something to change that, EE reverts it - it gives you a crappy one and you have to remember to disable it.

Link to comment

 

it's controlled by PARTYAI.2DA You don't need to add your NPC there.

That is the one to assign individual scripts to those in the list.

 

The problem is that anyone who is not on the list gets BDDefal.bcs instead.

 

Maybe the solution is to ADD my NPCs to the list and give them an empty script here.

 

Tested and it works

I need to add my NPCs to the PARTYAI.2DA and give them script NONE.

Link to comment

EE reverts it - it gives you a crappy one and you have to remember to disable it.

Or you can disable the group AI.

Besides, what's so bad about the "normal attack if I see enemies and have no other orders assigned" AI ?

That's what I would expect to be given by default... I haven't upped my games for a long time, so I can't say what the current implementation today gives.

The Shaman needs to use their special one... as far as I remember.

 

I need to add my NPCs to the PARTYAI.2DA and give them script NONE.

Or you could use that to put the one you designed script for the char, and see if "players actually use it or they would they like to order the character themselves?".
Link to comment

 

EE reverts it - it gives you a crappy one and you have to remember to disable it.

Or you can disable the group AI.

Besides, what's so bad about the "normal attack if I see enemies and have no other orders assigned" AI ?

That's what I would expect to be given by default... I haven't upped my games for a long time, so I can't say what the current implementation today gives.

The Shaman needs to use their special one... as far as I remember.

 

I need to add my NPCs to the PARTYAI.2DA and give them script NONE.

Or you could use that to put the one you designed script for the char, and see if "players actually use it or they would they like to order the character themselves?".

 

Oh, Imp...

This is about BDDefal.bcs in the latest EEs/SoD 2.3? Bet you did not even look at it....

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...