Jump to content


Photo

(Mod) NPC continuity (BGT / EET): From BioWare NPC in BG1 to mod NPC in BGII - how?


27 replies to this topic

#16 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 05:38 AM

Roxanne: MoveGlobal("Ar0700","Ajantis",[2753.1275]) (in AR0700.bcs) works fine for the transition from BG1 to BGII in BGT for Ajantis not in the party during the transition? At least I could spawn Ajantis in the Promenade for testing. Without preparation, he didn't have a valid dialogue any more, but he appeared with all items etc. What problems did you encounter for the BG1-BGII transition in BGT?

Congratulations - good that it works for you.

 

In hindsight (I gave up BGT a while ago) it probably was due to the fact that she had to have personal items and plot items with her when transitioning + her unseparable cat companion. And also the fact that she appeared out of the portal right into Irenicus living room once you fought your way to that part of the dungeon. And she had some action during the leaving part of BG1 (a bit similar to what SoD now has in the final scene when the shadow thieves ambush you. So much more complex than spawning either the old BG1 cre or the new BG2. (AC)Braegar was a bit similar (with his artificial silver arm and such) - those things did not work with MoveGlobal in BGT.

In this technical aspect, Ajantis is probably *simpler*, there is no special coding for his shield unless that has changed.


Edited by Roxanne, 01 March 2017 - 05:38 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#17 jastey

jastey
  • Gibberlings
  • 6895 posts
  • Gender:Female

Posted 01 March 2017 - 05:50 AM

Ah, I see. I am not sure it really works as simple as it seems with Ajantis. The "AJANTP.dlg" doesn't work after the real transition to BGII. Whereas, if I jump to AR0700 by cheats without talking to Duke Belt, he still has his BG1 kickout dialogue. I thought for BGT, the dialogues have to be the same for BG1 and BGII part, so I am confused, but didn't dig deep enough into the problem yet. EDIT: It's because the unmodded BGT AjantP.dlg checks for "GlobalLT("ENDOFBG1","GLOBAL",2)". So, transition by MoveGlobal() seems to work.

 

I had no luck with Polymorph opcode 135, though. It can only be referenced to a cre file (so, changes the player did during the game would be lost), and it also only took the animation, and maybe some stats (but not all). Plus, the changed stats are marked red. So, this is not an option.

 

Leaves the two possibilities for the transition in BGT:

 

-use the BG1 cre (with BG1 script name) and move it via MoveGlobal()

-use own BGII cre

 

Since in BGT I'd have to use the same dialogue files for the BGII part, I guess it will be the custom BGII cre (sorry, BGT players). I realize that's what you Roxanne and K4thos told me some pages ago :crazyeyes:


Edited by jastey, 01 March 2017 - 06:19 AM.


#18 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 08:25 AM

Forget my last post - I was already half sleeping I guess - I forgot the most important thing about Ajantis (namely there are two of them).

The situation is best illustrated by this snippet from K4thos code:

      //1 - BG1/SoD NPC without BG2 content (NPC is disabled from game after BG1, mentioned but not summonable in ToB)
      //2 - BG2 NPC without BG1 content (transition to ToB if joined the party at least once during SoA)
      //3 - NPC with BG1 and BG2 content (full transition to SoA/ToB)
      //4 - NPC joinable only in ToB (creates new creature)

Ajantis is none of that, instead BG1Ajantis is cat1 and BG2Ajantis is cat2, different creatures altogether, different dialogues, different script names. In this he equals probably only Xan/O#Xan or P#Kivan with the same problems.

The way they are, you cannot make them continuous in BGT nor in EET.

However, merging the two parts to a cat3 character will do the trick (and cost less time than spending days in research). And it would be compatible with any old, new, merged or not-merged game since another BG2Ajantis does not exist (and after 20 years it is unlikely that a bean dog will create one). You know your mod better than I do, but changing C#Aja to Aja in all files may be an option I would consider if I were you.


Edited by Roxanne, 01 March 2017 - 08:39 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#19 jastey

jastey
  • Gibberlings
  • 6895 posts
  • Gender:Female

Posted 01 March 2017 - 09:47 AM

I am considering it, but it wouldn't save me for BGT, because there I would have to use the BG1 dialogue files, meaning I would have to make sure the BG1 and BGII dialogues are triggered correctly... (Which I can't with mods adding to Ajantis in BG1) plus the nightmare oft actually changing the dialogues in this mod.. I coded a real mess there, so I'm not changing *that*.
But for EET with different dialogue files during the game, it is a good solution.

#20 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 10:02 AM

I am considering it, but it wouldn't save me for BGT, because there I would have to use the BG1 dialogue files, meaning I would have to make sure the BG1 and BGII dialogues are triggered correctly... (Which I can't with mods adding to Ajantis in BG1) plus the nightmare oft actually changing the dialogues in this mod.. I coded a real mess there, so I'm not changing *that*.
But for EET with different dialogue files during the game, it is a good solution.

Good argument - I was not considering that Ajantis is a vanilla BG1 NPCs and banters or Interjects from other mods (or even other vanilla NPCs) would not recognise when in BG2. A real tricky nut to crack. Question is - does it matter? Like Imoen's talks with Ajantis are generic and most others I remember are as well (something woth checking, maybe?)

You are right, in EET you can use different files for each campaign.


Edited by Roxanne, 01 March 2017 - 10:15 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#21 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 10:49 AM

Maybe there is something from EET code that can be used:

 

Im my current EET install all existing state triggers in AjantiJ and Bajant dialogues have a flag for EndofBG1 1,0 or LT2 (i.e. they are marked being prior BG2), Since I have no Ajantis for BG2 installed and EET would append any BG2 contents to those files, this means that core EET has added those flags.

 

If you borrow this code from k4thos even for BGT, this could work. For a BGT install you could

1.Install BG1 contents

2. Use EET code to add the additional trigger conditions

3. Install BG2 contents


Edited by Roxanne, 01 March 2017 - 10:50 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#22 jastey

jastey
  • Gibberlings
  • 6895 posts
  • Gender:Female

Posted 01 March 2017 - 12:11 PM

Intersting idea. I am a bit paranoid, though, because this method would not add the triggers to BG1 dialogues added by another mod after Ajantis BGII.

And I still would have to add a EndofBG1=2 trigger to all the BGII mod dialogue states, I think, or they could trigger in BG1 <-- this scares me, tbh, because I would have to go through my horrible code. EDIT: Wait, it's the script blocks this would go to. Hm, they are not that messy. I'll have to think about this.


Edited by jastey, 01 March 2017 - 12:12 PM.


#23 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 01:03 PM

Intersting idea. I am a bit paranoid, though, because this method would not add the triggers to BG1 dialogues added by another mod after Ajantis BGII.

I assume that the extra EET code will be executed at first thing in your BG2 mod.

In BGT the install sequence will be (or is, if you follow BWS or BWP manual)

1. all the BG1 mods including BG1NPCs and all mods that may add to the BG1 part of Ajantis

2. Then this add on of triggers (after this there will be no mods to append to Ajantis)

3. Then your BG2 stuff.

 

Also mind that not all code need those extra checks, e.g. area checks are unique and all based on triggers that are set after the reunion etc none of that can happen in BG1. (Just from experience, my continuos character uses the EndOfBG1 trigger only a few times over those 1000's of code blocks - the majority of them to detect EndOfBG1 = 1 for what is now SoD).

I know well the being scared of how much there is - then I give it a try and often it turns out easier than estimated (yes, there is always chance for the opposite...)


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#24 K4thos

K4thos
  • Modders
  • 1057 posts
  • Gender:Male

Posted 01 March 2017 - 02:14 PM

Im my current EET install all existing state triggers in AjantiJ and Bajant dialogues have a flag for EndofBG1 1,0 or LT2 (i.e. they are marked being prior BG2), Since I have no Ajantis for BG2 installed and EET would append any BG2 contents to those files, this means that core EET has added those flags.

this is implemented by BG1NPC Project and it's not longer needed in latest version of EET (since I've implemented PID detection auto filtering). The only problematic part of JOIN dialogue files is PID system which is mods added feature (nothing like this exists in vanilla content) because those dialogues don't have any real filtering so they can be triggered just by talking to party NPC (which normally should not trigger any dialogue). Other than PIDs if dialogues are properly filtered (which means following the same rules that Bioware implemented in the original content) than there should be no way for wrong dialogue to show up. Endofbg1 filtering is NOT needed if you don't do sloppy job writing your dialogue triggers. Nothing in vanilla content needed any of those (or at least there wasn't a single report about this yet). Such filtering should be done only if you really don't want something to show up later in the game. Let me quote the documentation why setup-eet_end automatically merges JOIN dialogue files in the first place:

 

EET is installed in two steps - main components (setup-EET_core installed automatically by setup-EET) on a clean BG2:EE, and additional setup-EET_end component at the end of mod installation process (after any other mods). This second step is used to automatically:

  • merge NPC JOIN dialogue files and update all references to them
  • update campaign related 2da files that may have missing entries
  • export mod added strings that can be used to update mod added content in new installation
  • generate code for SoA item importation based on 2da files

Why exactly NPC JOIN dialogue files are being merged? Short answer - interjections. Let's use an example from vanilla game.

 

Party travels through Athkatla slums where they can meet a shady looking guy that initiates a dialogue: "Yes, you! See this mighty fine sphere here? You can have it for your very own for a mere 500 gold pieces! What do you say?". Now if you have Minsc in the party following interjection is called "Boo says such a sphere will not fit into my pocket. If I can't carry it with me, it's just not a good buy."

 

The above dialogue piece called 'interjection' is triggered by WAYLANE.DLG and filtered with triggers, in this case See("Minsc") and InParty("Minsc"). Now let's say you didn't meet this guy during your Shadows of Amn travels. What would happen after going back from Throne of Bhaal to Athkatla with Minsc? The dialogue would be interrupted in the place where Minsc is expected to say something (dialogue shutdown/infinite loop and other problems). In order to make JOIN dialogue files valid through whole journey continuous characters that uses more than 1 JOIN dialogue file have them merged with one another.

 

JOIN dialogue file merging is done automatically, based on PDIALOG variants 2DA entries, at the end of installation process (after all mods are already installed), so modders don't need to change anything when it comes to JOIN dialogue coding. You should patch each dialogue file exactly the same way as you do in vanilla games. State numbers and file names are not altered at that point of installation (just keep in mind that some BG1 files have been renamed due to conflicts with BG2). You can use this reference file that lists different files that are assigned through out the game (green colour cells shows BG1 renamed files - if you're using cpmvars variable libraries thn you don't even need to be aware about it).

 

 

Unless BG1 NPC Project also filters code that triggers dialogues with Endofbg1 / chapter variables (not sure if that's the case), additional filters can actually break the JOIN dialogue interjection when party returns to area during different campaign (no links or replies / dialogue aborted etc.).

 

edit: to clarify using above mentioned example: Let's say that Minsc interjection has been added by mod. If you're going to filter it with chapter variable in his JOIN dialogue file than you should also filter WAYLANE.DLG response that triggers it the same way. Not doing so would break the dialogue. But why would you do it in the first place? That Minsc's line is equally good even if it triggers during ToB when you return to SoA.

 

 

---------

 

Newest version of setup-eet_end implements this code to automatically handle PIDs:

Spoiler

it analyses all triggers that particular dialogue block has at once and add additional filter automatically if IsGabber(Player1) trigger is detected and block is not filtered with chapter / endofbg1 variable yet. Unfortunately PIDs didn't exist in vanilla content so there is no guideline how to code one so there are differences all over the place in different mods but from what I've seen all mods that I've tested used IsGabber(Player1) for PIDs. With this in place problem like this wouldn't happen even if BG1 NPC Project didn't use Endofbg1 filtering at all.

 

edit: I've mentioned that nothing in vanilla content needed additional filters - there is one exception. Irenicus Dungeon Imoen and SoA Imoen in vanilla game used entirely different DV (Imoen, Imoen2) and considering both of this content happens during single campaign BG2 Imoen dialogues have additional chapter variable filters in EET.

 

edit: clarified few things in the post. Please let me know if something is still confusing.


Edited by K4thos, 02 March 2017 - 06:05 AM.


#25 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 01 March 2017 - 03:07 PM

this is implemented by BG1NPC Project and it's not longer needed in latest version of EET

Means that you would need to check if this is done by BG1NPC only if game is EET and (if needed) maybe expand it to BGT as well?

 

Anyway - I promise I shut up now. There is enough to think about for the moment.


Edited by Roxanne, 01 March 2017 - 03:09 PM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#26 jastey

jastey
  • Gibberlings
  • 6895 posts
  • Gender:Female

Posted 01 March 2017 - 10:51 PM

edit: to clarify using above mentioned example: Let's say that Minsc interjection has been added by mod. If you're going to filter it with chapter variable in his JOIN dialogue file than you should also filter WAYLANE.DLG response that triggers it the same way. Not doing so would break the dialogue. But why would you do it in the first place? That Minsc's line is equally good even if it triggers during ToB when you return to SoA.

I would never add triggers to dialogue states. That's very risky, in addition to what you pointed out there is also the risk of script firing the dialogue but dialogue disabled by an additional trigger. I would only add additional triggers to the script blocks.
PID is a different thing and a good point. But if it's dealt with by EET, I wouldn't have to worry about the Ajantis BG1NPC PID in BGII, I guess.

 

Did I understand you correctly that for BGT, all I would have to do (presumably, at least) is take care of the BG1 PIDs to restrict them to BG1 and other than that, joining the BG1+BGII dialogues should be no problem (assuming the coding was done soundly)?

 

Thank you both very much for your input. This is really helpful.


Edited by jastey, 01 March 2017 - 10:52 PM.


#27 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 02 March 2017 - 12:22 AM

Did I understand you correctly that for BGT, all I would have to do (presumably, at least) is take care of the BG1 PIDs to restrict them to BG1 and other than that, joining the BG1+BGII dialogues should be no problem (assuming the coding was done soundly)?

I know that you dislike Sandrah, but talking from a technical perspective I have proven it with her. The BG2 dialogues and scripts are added/appended to the BG1 dialogues/scripts (which are used throughout until the switch to ToB). Never a problem with that. (And theoretically they could work independently for a BG1 and/or BG2 character - just her story is not made for this and I simply have no interest in modding the separated games.)

 

For the PIDs I have created several *packages* so she has different contents at different stages, e.g.. prior bhaalspawn revealed, after it, in SoD, InBG2 prior/after lost soul etc.

So you will have e.g.

IF ~ IsGabber(Player1) Global("SanPidPack","GLOBAL",XY)~ THEN BEGIN SanPCInitXY

And then those banters appropriate for that stage (some generic can trigger always), so the talks are much more tuned to the given circumstances in a mod that runs for a very long time. (Instead of *packs* you could of course simply use the EndOfBG1 global).


Edited by Roxanne, 02 March 2017 - 12:26 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#28 jastey

jastey
  • Gibberlings
  • 6895 posts
  • Gender:Female

Posted 02 March 2017 - 02:56 AM

 

IF ~ IsGabber(Player1) Global("SanPidPack","GLOBAL",XY)~ THEN BEGIN SanPCInitXY

Yes, making several dialogue states for PID is better than adding it all to one dialogue state (with appropriate triggers, of course). I learned this the hard way with BG1NPC Ajantis PIDs that where all in one state and it took like 2 seconds to load the PID dialogue in the game...

 

Thank you! It's a really great idea, but I think I will stick to the two-cre version for BGT. It's much work and a huge source of potential bugs for, well, only a small outcome. As you already said, it's not so unrealistic he changed a bit during the break.

 

For EET, I am decided to make him a continuous character. I am not there yet, though. So, more question will come later...





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users