Jump to content

exclusive conditions for serveral NPCs


lsass.exe

Recommended Posts

It’s me… again… :)

 

I’m doing some conditions for replies but I have some really big problems with the logic behind them. The starting situation is as follows: The PC can give an answer and the dialog will go a distinctive way depending on the NPCs in the party.

 

Example (I know that's not working code, I simplified it to surpress my urge to run away screaming):

+ ~InParty("Xzar") InMyArea("Xzar") !StateCheck("Xzar",CD_STATE_NOTVALID)~ + ~blabla heading to Xzar~
+ ~InParty("Eldoth") InMyArea("Eldoth") !StateCheck("Eldoth",CD_STATE_NOTVALID)~ + ~blabla heading to Eldoth~
+ ~InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)~ + ~blabla heading to Imoen~
+ ~InParty("Khalid") InMyArea("Khalid") !StateCheck("Khalid",CD_STATE_NOTVALID)~ + ~blabla heading to Khalid~
+ ~InParty("Ajantis") InMyArea("Ajantis") !StateCheck("Ajantis",CD_STATE_NOTVALID)~ + ~blabla heading to Ajantis~

 

Works well and stuff, but the downside is of course that the line will be printed for each NPC that is available.

 

 

So I did this:

+ ~InParty("Xzar") InMyArea("Xzar") !StateCheck("Xzar",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Ajantis") !InMyArea("Ajantis") StateCheck("Ajantis",CD_STATE_NOTVALID)~ + ~blabla heading to Xzar~
+ ~InParty("Eldoth") InMyArea("Eldoth") !StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Xzar") !InMyArea("Xzar") StateCheck("Xzar",CD_STATE_NOTVALID)
OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Ajantis") !InMyArea("Ajantis") StateCheck("Ajantis",CD_STATE_NOTVALID)~ + ~blabla heading to Eldoth~
+ ~InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Xzar") !InMyArea("Xzar") StateCheck("Xzar",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Ajantis") !InMyArea("Ajantis") StateCheck("Ajantis",CD_STATE_NOTVALID)~ + ~blabla heading to Imoen~
+ ~InParty("Khalid") InMyArea("Khalid") !StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Xzar") !InMyArea("Xzar") StateCheck("Xzar",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Ajantis") !InMyArea("Ajantis") StateCheck("Ajantis",CD_STATE_NOTVALID)
OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)~ + ~blabla heading to Khalid~
+ ~InParty("Ajantis") InMyArea("Ajantis") !StateCheck("Ajantis",CD_STATE_NOTVALID)
OR(3) !InParty("Xzar") !InMyArea("Xzar") StateCheck("Xzar",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)~ + ~blabla heading to Ajantis~

 

Of course, now the lines will only be printed if the NPC is the only one of the five in the party.

 

But e.g. if Imoen AND Khalid are in the party, no reply is printed for either of them. So I need a second set of replies with conditions that are true if more than one NPC is in the party and that exclude the first set.

 

If Imoen and Khalid or Xzar or Eldoth or Ajantis are in party, then take the Imoenpath. If Khalid and Xzar or Eldoth or Ajantis are in party, then take the Khalidpath. And so on and so on.

 

And that is where my brain fails me. How do I code that? Is that even right thinking? Or have I completely lost myself in wrong thoughts? Or is my inital approach wrong and I run in circles because there is no solution? I don’t know anything anymore and my head is pleading for mercy… ;)

Link to comment

So Imoen should take precedence, right? If she's there?

 

If not, Khalid.

 

Etc.

 

Structure your thoughts like that.

 

Then, for Imoen, since she always takes precedence, simply:

 

InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)

 

Khalid:

 

OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
InParty("Khalid") InMyArea("Khalid") !StateCheck("Khalid",CD_STATE_NOTVALID)

 

Eldoth:

 

OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
InParty("Eldoth") InMyArea("Eldoth") !StateCheck("Eldoth",CD_STATE_NOTVALID)

 

Etc. Just a lengthening set of conditions for lower-priority outcomes.

Link to comment

(remember they evaluate bottom up, so

 

3 [eldoth_branch]

2 [kahlid_branch]

1 [imoen_branch]

 

and build them that way - the way your first thoughts are set up, Ajantis triggers if he is there, then it moves on to look for the next option (Khalid) etc. -

 

even better, instead of replies, can you set it up so that the encounter triggers that way at the script level? )

Link to comment

Sorry, I'm not sure I understand: "evaluate bottom up" means the last reply is the first do be checked?

 

I'd like Imoen to be the top priority, then Khalid, then Eldoth etc.

 

Atm I have:

 

(A ~I sincerely hope we don’t meet any of the more slimy patrons of this fine... establishment... Once one of the bastards followed me across the town, even so I rejected him again and again.~
B ~He offered you gold, you stupid elf. Much gold!~) //banter begin, I cut all the other possible replies for this. And I wrote it in german and made an on the fly translation just now. Errors are to be found.

+ ~InParty("Imoen2") InMyArea("Imoen2") !StateCheck("Imoen2",CD_STATE_NOTVALID)~ + ~I can’t see why he’d do that...~ EXTERN PWwedB BGCellarsBanter1.2c
+ ~OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
InParty("Khalid") InMyArea("Khalid") !StateCheck("Khalid",CD_STATE_NOTVALID)~ + ~I can’t see why he’d do that...~ EXTERN PWwedB BGCellarsBanter1.2d
+ ~OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
InParty("Eldoth") InMyArea("Eldoth") !StateCheck("Eldoth",CD_STATE_NOTVALID)~ + ~I can’t see why he’d do that...~ EXTERN PWwedB BGCellarsBanter1.2b
+ ~OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
InParty("Xzar") InMyArea("Xzar") !StateCheck("Xzar",CD_STATE_NOTVALID)~ + ~I can’t see why he’d do that...~ EXTERN PWwedB BGCellarsBanter1.2a
+ ~OR(3) !InParty("Imoen2") !InMyArea("Imoen2") StateCheck("Imoen2",CD_STATE_NOTVALID)
OR(3) !InParty("Khalid") !InMyArea("Khalid") StateCheck("Khalid",CD_STATE_NOTVALID)
OR(3) !InParty("Eldoth") !InMyArea("Eldoth") StateCheck("Eldoth",CD_STATE_NOTVALID)
OR(3) !InParty("Xzar") !InMyArea("Xzar") StateCheck("Xzar",CD_STATE_NOTVALID)
InParty("Ajantis") InMyArea("Ajantis") !StateCheck("Ajantis",CD_STATE_NOTVALID)~ + ~I can’t see why he’d do that...~ EXTERN PWwedB BGCellarsBanter1.2e

 

Do I have to put Imoen at the end for her to be top priority?

 

 

 

 

PS

Since these are just branches (slightly different depending on the NPC) of that dialog I cannot trigger the branches via script.

Link to comment

Archived

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

×
×
  • Create New...