Jump to content

Checking for mod changed triggers


jastey

Recommended Posts

If so, the simplest option seems to be to use CamDawg's Case 3.
Yes, but I am happy with "Ajantis does not grab all interjections the way it is coded now, nor does it lead to an invalid link, so I am too lazy to change the code I already had and I am feeling very happy about it". :)

 

The point of my question actually was "how do I detect a trigger if I want to use a negation of exactly this one, if at all possible". But the discussion showed this is not necessary.

Link to comment

Case 3 seems cool, but the problem with Interject's(if they do not return to the same state), instead of I_C_T's, is that Interject can replace/erase other mod interjections. Which is probably not very polite...

 

I'd suggest using Case 3 like this:

 

INTERJECT FOO 0 CDAjantisFoo
== AJANTISJ IF ~InParty("Ajantis") See("Ajantis") !StateCheck("Ajantis",CD_STATE_NOTVALID) OR(3) !InParty("Keldorn") !See("Keldorn") StateCheck("Keldorn",CD_STATE_NOTVALID)~ THEN @0
END FOO 0

 

"END FOO 0" - so it'd return to state 0, not to state 1, and other interjections would have their chance to trigger.

Link to comment

Kulyok: Interject means that the NPC changes the PC's decision. If returning to "Foo 0" is wanted I could use I_C_T instead. (Interjecting and returning to "Foo 0" would lead to a dialogue hick-up, I think, as the character "Foo" would repeat his text line of state "0".)

I agree on the "do not eat interjections from other mods", of course. I decided to use INTERJECT on three game occasions, changing the PC's decision and leading on to the others NPC's state, because

-it fits role wise: the NPC is a paladin who will not tolerate bad decisions if he is standing next

-it is original BioWare behaviour (as I said I adjusted the behaviour to Keldorn's and Mazzy's)

-I was hoping that cancelling mod added content (mainly interjections from other NPC mods) wouldn't be too bad because the PC's decision got changed anyway.

 

At least I took great care to jump to an original character's dialogue state (instead of creating an own one), so mod-added content there won't be lost. (Note: All in all I took great care in the Ajantis mod to always close the cycle, i.e. after inserting new content (where a plain I_C_T wouldn't do) there is a "COPY_TRANS Foo 0" that leads back to the original state and enables other mod's content to fire.)

 

It's only those INTERJECT points where I don't know how I am supposed to enable that. I am open to suggestions but leading back to the original state doesn't make sense in these cases.

Link to comment
Maybe I should include "InMyArea()"?
An NPC interjection of an NPC that was not in the area (he was standing outside the house while the dialogue happened inside) just broke my CHAIN (it said "continue" on the button but after pressing the dialogue just ended instead of the NPC interjection.) The interjection was triggered by "InParty("NPC") !StateCheck("NPC",CD_STATE_NOTVALID)".

I highly recommend adding "See()" or "InMyArea()", to whoever this is reading and hasn't done so yet.

Link to comment

OK, I understand that, but whom should the NPC see?

 

See(Player1)

See("partynpcDV")

See("interjecteeDV")

See("SomeOtherNpcDV")

 

Any of the above would probably work, since they would all return false if the npc was in another building. But it might be best to explain it as completely as possible for us noobers.

Link to comment

Just to confirm, the CHAIN was broken, not completed correctly?

 

That means that the current interjections/chains are looking for the following to be true:

InParty(X)

NotDeadorSleepingorAnythingelse(X)

 

but something *else* is saying "there is no viable party member there so follow the interjection but don't allow the state to complete".

 

I don't understand why if simple InParty checks result in "dead", "sleeping", or otherwise unavailable NPCs to talk, the NPC not being in the same area would cause this behavior. I would want to know this before we tighten the conditions again. Anyone got an idea how this can be happening?

 

As for target, good question... and another update for the I_T_C2's, I_T_C's, and CHAINs in BG1 NPC. Do we want to assume the target of SDNS() is there for InMyArea()?

Link to comment

Maybe there's more than one thing happening here.

 

This is the .d code:

 

CHAIN C#Ajan welcome_chain //called from somewhere else

~[Ajantis is talking with the PC inside the house]~

== KELDORJ IF ~InParty("KELDORN") !Dead("KELDORN") !StateCheck("KELDORN",CD_STATE_NOTVALID) Global("C#AjantisKeldornWelcome","GLOBAL",0)~ THEN ~[Keldorn wasn't in the party, so this was supposed not to happen]~

== C#Ajan IF ~InParty("KELDORN") !Dead("KELDORN") !StateCheck("KELDORN",CD_STATE_NOTVALID) Global("C#AjantisKeldornWelcome","GLOBAL",0)~ THEN ~[As well as Ajantis' reply would be scipped]~ DO ~SetGlobal("C#AjantisKeldornWelcome","GLOBAL",1)~

== ANOMENJ IF ~InParty("ANOMEN") !Dead("ANOMEN") Global("C#AjantisAnomenWelcome","GLOBAL",0) !StateCheck("ANOMEN",CD_STATE_NOTVALID) !Global("AnomenIsNotKnight","GLOBAL",1)~ THEN ~[Anomen was in the group and standing in front of the house, and able to talk, but didn't interject either]~

== C#Ajan ~[This last line was skipped, too]~

END

++ ~[reply options that didn't show at all.]

 

 

All I got was:

~[Ajantis is talking with the PC inside the house]~

Pressing "continue" lead to an end of the dialogue.

 

Taking Anomen inside solved the problem. Let me have a quick run-through with some "See"s or "InMyArea"s, I'll post my results later.

 

berelinde: I would put See("NPC who should interject") to the conditions, or am I wrong?

Link to comment

I see the problem. Keldorn *is* in the party. He just isn't in the room.

 

If he is occupying a party slot, he is still in the party, whether he is in the room or not.

 

Or is this when he isn't in the party at all? If that is the case, the bigger concern might be why the InParty trigger is failing.

Link to comment

What I tested: I added "InMyArea("interjecting NPC")" for both Keldorn and Anomen, and it worked fine: Anomen's interjection fired, when he was in the area, and the dialogue continued smoothly if he wasn't.

 

Keldorn is not in my party. I had the suspicion that two interjections with different conditions with the first not valid could lead to problems*, but this seems not to be the case here: Even if I deleted the Keldorn line alltogether (as well as Ajatis' reaction to it), the Anomen interjection showed the same problem as before: If the "InMyArea("Anomen")" was missing his interjection did not work if he was not in the room, breaking the chain.

 

So "InParty("interjecting NPC") !StateCheck("interjecting NPC",CD_STATE_NOTVALID) InMyArea("interjecting NPC")" is the thing to go (or replace "InMyArea("interjecting NPC")" with"See("interjecting NPC")", to exclude hidden and invisible NPCs).

 

*I noticed such a behaviour for I_C_T, btw: If two interjections with differing conditions are put in one I_C_T, the second will never show if the conditions of the first are not met, even if the conditions of the second one would be true:

 

I_C_T chardlg CheckVariable

== NPCdlg IF ~(false condition)~ THEN ~say something~

== NPC2dlg IF ~(true condition)~ THEN ~say something here~ //this will never show.

END

 

This has to be coded as two separate I_C_T.

Link to comment
So "InParty("interjecting NPC") !StateCheck("interjecting NPC",CD_STATE_NOTVALID) InMyArea("interjecting NPC")" is the thing to go (or replace "InMyArea("interjecting NPC")" with"See("interjecting NPC")", to exclude hidden and invisible NPCs).

 

Got it - InMyArea("interjecting NPC") should be added to CHAIN and I_C_T and I_C_T2 codes throughout the project to avoid problems.

 

*I noticed such a behaviour for I_C_T, btw: If two interjections with differing conditions are put in one I_C_T, the second will never show if the conditions of the first are not met, even if the conditions of the second one would be true:

 

I_C_T chardlg CheckVariable

== NPCdlg IF ~(false condition)~ THEN ~say something~

== NPC2dlg IF ~(true condition)~ THEN ~say something here~ //this will never show.

END

 

This has to be coded as two separate I_C_T.

So while CHAIN will allow two different conditionals, i.e.

 

CHAIN condition state

~NPC1 talks here~

== NPC2 IF ~condition1~ REPLY ~X~

== NPC2 IF ~condition2~ REPLY ~Y~

END

 

I_C_T and I_C_T2 would need to be separated into two separate items? Without different conditions, we can do this:

 

I_C_T2 ~_ARDROU~ 0 X#VicArd
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @14
== ~_ARDROU~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @15
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @16 END

 

but we can't do

 

 

I_C_T2 ~_ARDROU~ 0 X#VicArd
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID) Global("ThisIsATest","GLOBAL",1)~ THEN @14
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID) Global("ThisIsATest","GLOBAL",3)
~ THEN @14\
== ~_ARDROU~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @15
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @16 END

Link to comment
but we can't do
Yes: My experience showed that if the first interjection does not get performed, the followings are not performed at all (even though the conditions would be valid), i.e. if the first condition would be false but the second true, the true one doesn't get performed.

 

It would have to be coded like this:

I_C_T2 ~_ARDROU~ 0 X#VicArd1
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID) Global("ThisIsATest","GLOBAL",1)~ THEN @14
END

I_C_T2 ~_ARDROU~ 0 X#VicArd2
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID) Global("ThisIsATest","GLOBAL",3)
~ THEN @14
END

I_C_T2 ~_ARDROU~ 0 X#VicArd3
== ~_ARDROU~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @15
== ~_VICONJ~ IF ~InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)~ THEN @16 
END

Link to comment

Archived

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

×
×
  • Create New...