Jump to content

Interjections from party members


argent77

Recommended Posts

Hello everyone,

 

after a long "vacation" from Baldur's Gate I've started modding again. This time I want to add banters and quests into my mod. But creating dialogs which go beyond a friendly talk between two actors is more difficult than I thought.

 

I'm currently struggling with party interjections in a dialog between my PC and one of my mod characters. After much trial and error I've finally got it to work somehow, but it looks awfully complicated:

// Code between PC and character
BEGIN A7RAKLE

IF ~~ A7RakLe1.9
SAY @1315 // There is a way to spice up our hunt. You can bring...
IF ~~ + A7RakLe1.10
END

IF ~~ A7RakLe1.10
SAY @1350 // What do you say?
+ ~Global("MahelImpressed", "LOCALS", 0)~ + @1316 + A7RakLe1.11 // I want to know more about our reward first.
+ ~Global("MahelImpressed", "LOCALS", 1)~ + @1316 + A7RakLe1.12 // I want to know more about our reward first.
++ @1317 + A7RakLe1.13 // Ok, I will do it.
++ @1318 + A7RakLe1.Hostile // No way. I'm not working for you.
END

--- snip ---

// Party interjections
INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Keldorn
== KELDORJ IF ~InParty("Keldorn") !StateCheck("Keldorn", CD_STATE_NOTVALID)~ THEN ~(Keldorn says something)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Mazzy
== MAZZYJ IF ~!InParty("Keldorn") InParty("Mazzy") !StateCheck("Mazzy", CD_STATE_NOTVALID)~ THEN ~(Mazzy says something when Keldorn isn't around)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Jaheira
== JAHEIRAJ IF ~InParty("Jaheira") !StateCheck("Jaheira", CD_STATE_NOTVALID)~ THEN ~(Jaheira says something)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Cernd
== CERNDJ IF ~!InParty("Jaheira") InParty("Cernd") !StateCheck("Cernd", CD_STATE_NOTVALID)~ THEN ~(Cernd says something when Jaheira isn't around)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Edwin
== EDWINJ IF ~InParty("Edwin") !StateCheck("Edwin", CD_STATE_NOTVALID)~ THEN ~(Edwin says something)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Viconia
== VICONIJ IF ~!InParty("Edwin") InParty("Viconia") !StateCheck("Viconia", CD_STATE_NOTVALID)~ THEN ~(Viconia says something when Edwin isn't around)~
END

INTERJECT_COPY_TRANS A7RAKLE A7RakLe1.9 A7RakLe1.9.Korgan
== KORGANJ IF ~!InParty("Edwin") !InParty("Viconia") InParty("Korgan") !StateCheck("Korgan", CD_STATE_NOTVALID)~ THEN ~(Korgan says something when Edwin and Viconia aren't around)~
END

In short, I want one of my NPCs to interject, if he/she isn't in the party then another NPC jumps in.

 

Are there better ways to implement this, maybe a way to combine it into a single block or merge it with the original dialog?

 

Thanks for any help.

Link to comment

You really only need to do "interjections" when the interjecting NPC is a mod NPC. When the NPC is BioWare, you can just make it a chain.

 

CHAIN MYNPC state

~Says something...~

== KELDORJ IF ~InParty("Keldorn") InMyArea("Keldorn") !StateCheck("Keldorn",CD_STATE_NOTVALID)~ THEN ~Keldorn adds his 2 pence.~

== MAZZYJ IF ~InParty("Mazzy") InMyArea("Mazzy") !StateCheck("Mazzy"), CD_STATE_NOTVALID)~ THEN ~Mazzy chimes in, too.~

== JAHEIRAJ IF ~InParty("Jaheira") InMyArea("Jaheira") !StateCheck("Jaheira",CD_STATE_NOTVALID)~ THEN ~Jaheira *always* has something to say.~

END

++ ~Yeah, well, I'm the protagonist and what I say goes!~ EXTERN MYNPC rebuttal

//etc

Link to comment

Thanks, that will save me a lot of work.

 

It looks like that now, and it works:

CHAIN A7RAKLE A7RakLe1.9
@1315 // There is a way to spice up our hunt. You can bring...
== KELDORJ IF ~InParty("Keldorn") !StateCheck("Keldorn", CD_STATE_NOTVALID)~ THEN ~(Keldorn says something)~
== MAZZYJ IF ~!InParty("Keldorn") InParty("Mazzy") !StateCheck("Mazzy", CD_STATE_NOTVALID)~ THEN ~(Mazzy says something when Keldorn isn't around)~
== JAHEIRAJ IF ~InParty("Jaheira") !StateCheck("Jaheira", CD_STATE_NOTVALID)~ THEN ~(Jaheira says something)~
== CERNDJ IF ~!InParty("Jaheira") InParty("Cernd") !StateCheck("Cernd", CD_STATE_NOTVALID)~ THEN ~(Cernd says something when Jaheira isn't around)~
== EDWINJ IF ~InParty("Edwin") !StateCheck("Edwin", CD_STATE_NOTVALID)~ THEN ~(Edwin says something)~
== VICONIJ IF ~!InParty("Edwin") InParty("Viconia") !StateCheck("Viconia", CD_STATE_NOTVALID)~ THEN ~(Viconia says something when Edwin isn't around)~
== KORGANJ IF ~!InParty("Edwin") !InParty("Viconia") InParty("Korgan") !StateCheck("Korgan", CD_STATE_NOTVALID)~ THEN ~(Korgan says something when Edwin and Viconia aren't around)~
END
IF ~~ EXTERN A7RAKLE A7RakLe1.10

APPEND A7RAKLE
IF ~~ A7RakLe1.10
SAY @1350 // What do you say?
+ ~Global("MahelImpressed", "LOCALS", 0)~ + @1316 + A7RakLe1.11 // I want to know more about our reward first.
+ ~Global("MahelImpressed", "LOCALS", 1)~ + @1316 + A7RakLe1.12 // I want to know more about our reward first.
++ @1317 + A7RakLe1.14 // Ok, I will do it.
++ @1318 + A7RakLe1.Hostile // No way. I'm not working for you.
END

Link to comment

Archived

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

×
×
  • Create New...