Jump to content

Bg2 NPC Mod d. file (Join several npcs at once?)


uncleclinto

Recommended Posts

Okay peeps,

 

I'm trying to get my favorite characters from the sellswords series in as joinable NPC's. I'm just doing this for my own entertainment and likely won't publish it. I'm writing my d. file for Jarlaxle, and I was wondering if I could have his whole crew join through his d. file. I am a total noob so forgive my ignorance.

 

Here's my d. file:

 

BEGIN CJ#Jarlx

IF ~NumTimesTalkedTo(0)~ FirstMeeting

SAY ~Greetings my <LADYLORD>! My name is Jarlaxle, and these are my friends Artemis and Athrogate. You look like one destined

 

for great profit.~

IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Hey Jarlaxle, you seen Irenicus around here?~ GOTO InquireIrenicus

IF ~~ THEN REPLY ~Greetings, Jarlaxle.~ GOTO Greet

++ ~Go away.~ + GoAway

END

 

IF ~~ THEN BEGIN InquireIrenicus

SAY ~No, but we can assist you in your quest. we have many skills that can prove useful, and Athrogate is only mildly

 

annoying!~

++ ~Sure. We would love your company.~ DO ~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I have no use for for three obvious criminals at this time.~ EXIT

END

 

IF ~~ THEN BEGIN Greet

SAY ~As an astute judge of character, I'm sure you can see that I the type of man who possesses many skills that can prove

 

useful, I'm not bad in a fight, and my friends are only mildly troublesome. Could you use us in your group?~

IF ~~ THEN REPLY ~Yes, as a matter of fact we could.~

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I have no use for for three obvious criminals at this time.~ GOTO GoAway

END

 

IF ~~ THEN BEGIN GoAway

SAY ~Very well my <LADYLORD>, I will await the day when you return, so that we can discuss our possible alliance over some

 

fine wine at the Five Flagons!~

IF ~~ THEN EXIT

END

 

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue

SAY ~I see you have returned, my friend. Let us Journey together to the Den of Seven Vales and drink to our future exploits

 

together!~

IF ~~ THEN REPLY ~Indeed, I could use your services, Jarlaxle, and I could certianly use that drink.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I may just stop by The Seven Vales, but you shan't join me this time.~ GOTO RefusedAgain

END

 

IF ~~ THEN BEGIN RefusedAgain

SAY ~Ah, once again you refuse my offer. No matter, we will find a profitable opportunity in this city yet.~

IF ~~ THEN EXIT

END

 

BEGIN CJ#JarlaxleP

IF ~Global("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)~ THEN BEGIN KickOut

SAY ~Alas, you hath determined our road to be at an end?~

IF ~~ THEN REPLY ~Oops, I meant to boot that other git, not you. Sorry.~ DO ~JoinParty()~ EXIT

IF ~~ THEN REPLY ~That's right, There's a City full of opportunity out there awaiting your conquest.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",0)~ EXIT

END

 

IF ~Global("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",0)~ THEN BEGIN Rejoin

SAY ~You couldn't go on without us, could you?~

IF ~~ THEN REPLY ~That's right Jarlaxle. Well, actually we really miss Artemis' skills.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~Actually, it's been rather peaceful without all of Athrogate's farting and rhyming.~ EXIT

END

 

BEGIN CJ#Jarlx

IF ~NumTimesTalkedTo(0)~ FirstMeeting

SAY ~Greetings my <LADYLORD>! My name is Jarlaxle, and these are my friends Artemis and Athrogate. You look like one destined

 

for great profit.~

IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Hey Jarlaxle, you seen Irenicus around here?~ GOTO InquireIrenicus

IF ~~ THEN REPLY ~Greetings, Jarlaxle.~ GOTO Greet

++ ~Go away.~ + GoAway

END

 

IF ~~ THEN BEGIN InquireIrenicus

SAY ~No, but we can assist you in your quest. we have many skills that can prove useful, and Athrogate is only mildly

 

annoying!~

++ ~Sure. We would love your company.~ DO ~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I have no use for for three obvious criminals at this time.~ EXIT

END

 

IF ~~ THEN BEGIN Greet

SAY ~As an astute judge of character, I'm sure you can see that I the type of man who possesses many skills that can prove

 

useful, I'm not bad in a fight, and my friends are only mildly troublesome. Could you use us in your group?~

IF ~~ THEN REPLY ~Yes, as a matter of fact we could.~

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I have no use for for three obvious criminals at this time.~ GOTO GoAway

END

 

IF ~~ THEN BEGIN GoAway

SAY ~Very well my <LADYLORD>, I will await the day when you return, so that we can discuss our possible alliance over some

 

fine wine at the Five Flagons!~

IF ~~ THEN EXIT

END

 

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue

SAY ~I see you have returned, my friend. Let us Journey together to the Den of Seven Vales and drink to our future exploits

 

together!~

IF ~~ THEN REPLY ~Indeed, I could use your services, Jarlaxle, and I could certianly use that drink.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~I may just stop by The Seven Vales, but you shan't join me this time.~ GOTO RefusedAgain

END

 

IF ~~ THEN BEGIN RefusedAgain

SAY ~Ah, once again you refuse my offer. No matter, we will find a profitable opportunity in this city yet.~

IF ~~ THEN EXIT

END

 

BEGIN CJ#JarlaxleP

IF ~Global("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)~ THEN BEGIN KickOut

SAY ~Alas, you hath determined our road to be at an end?~

IF ~~ THEN REPLY ~Oops, I meant to boot that other git, not you. Sorry.~ DO ~JoinParty()~ EXIT

IF ~~ THEN REPLY ~That's right, There's a City full of opportunity out there awaiting your conquest.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",0)~ EXIT

END

 

IF ~Global("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",0)~ THEN BEGIN Rejoin

SAY ~You couldn't go on without us, could you?~

IF ~~ THEN REPLY ~That's right Jarlaxle. Well, actually we really miss Artemis' skills.~ DO

 

~SetGlobal("JarlaxleJoined","ArtemisJoined","AthrogateJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~Actually, it's been rather peaceful without all of Athrogate's farting and rhyming.~ EXIT

END

Link to comment

The JoinParty() only works on the actor's DV ... i don't have alot of time right now to read the whole thing, but someone will be along in a minute and doublecheck me:

 

I see no reason why this wouldn't work, but instead of a simple JoinParty() you would want

~SetGlobal("JarlaxleJoined","LOCALS",1) 
SetGlobal("ArtemisJoined","LOCALS",1)
SetGlobal("AthrogateJoined","LOCALS",1)
ActionOverride("jarlaxle'sDV",JoinParty())
ActionOverride("artemis'sDV",JoinParty())
ActionOverride("arthrogate'sDV",JoinParty())~ EXIT

where each DV is the scripting name (not the creature file name).

p.s. if you get interested in publishing it, you will want to figure out how to handle the "3 musketteers" being split up -

The actions and globals are all set one at a time.

Link to comment

Cmorgan, I actually wonder if

 

SetGlobal("JarlaxleJoined","LOCALS",1)

SetGlobal("ArtemisJoined","LOCALS",1)

SetGlobal("AthrogateJoined","LOCALS",1)

 

is going to work, as iirc if you use LOCALS only the speaker will 'remember' those. Might be better to use GLOBAL, not sure though, never use LOCALS myself.

Link to comment

I'm thinking that using LOCALS will not end the way you think it will. If you're using an area script, that won't work too well, and if you've got these in an individual NPC's script, they'll stay with that NPC.

 

So I'm thinking Domi is right.

 

If you're joining 3 NPCs, you'd only do action overrides for 2 of them, as the third will be running the script in the first place.

 

CHAIN

IF ~~ THEN NPC1 JoinYouAll

~So, <CHARNAME>, do you want all three of us?~

END

++ ~Sounds good.~ DO ~SetGlobal("NPC1Joined","GLOBAL",1) SetGlobal("NPC2Joined","GLOBAL",1) SetGlobal("NPC3Joined","GLOBAL",1) JoinParty() ActionOverride("NPC2",JoinParty()) ActionOverride("NPC3",JoinParty())~ EXIT

++ ~Nah. I hear that there's a sexy drow somewhere in Chapter 5, and I'm saving him a seat.~ EXTERN NPC1 YourLoss

Link to comment

While the tutorials and some of BioWare code uses LOCALS, I agree with both Domi and berelinde...

 

switch usage to GLOBAL rather than LOCALS. Then you can use the same variables again when you want to do something else.

 

I know berelinde is right about only needing 2 AOs, but since you are using this on your own install, it won't do any harm to ActionOverride everyone, including the original; to be most correct, follow berelinde, but it is OK if you decide to keep things straight in your head by using the "long form" ActionOverride for all three (including the speaker).

Link to comment

I really hate to disagree with cmorgan, because he knows a lot more about this than I do, but it is better to get in the habit of identifying the person running the script as early as humanly possible because it will save you no end of headaches later. When you've written a cutscene, and you're trying to figure out why it won't work, it will help you troubleshoot it when you remember that Player1 is running the script, so you can't do action override on him.

 

This is the voice of experience, because I am the proud author of one completely buggy cutscene that I have to fix, mostly because I forgot to keep my eye on who was running the script.

 

So, it might work for dialogue file action, but it's just better not to get in the habit of using ActionOverride() excessively.

Link to comment

Archived

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

×
×
  • Create New...