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

#1 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 25 January 2017 - 04:56 AM

I am asking from a modder's perspective. I would like to make my Sir Ajantis in BGII be the same cre (same stats, same level up decisions, same items etc) as the vanilla Ajantis in the BG1 part.

Problem: The BG1 Ajantis has the script variable "Ajantis", whereas in my mod I use a prefix. I do not want to use "Ajantis" without a prefix for my mod NPC, to prevent incompatibilities (and other reasons). As far as I know, it is not possible to change the script name of a creature inside the game.

How could I call the BG1 Ajantis in the BGII part but give him a new script name? Or any other solution that gives a similar result?



#2 Roxanne

Roxanne
  • Modders
  • 1153 posts
  • Gender:Not Telling

Posted 25 January 2017 - 05:27 AM

Something like this (in your tp2)

 

COPY_EXISTING ~ajanti.cre~ ~override/MyBG2Ajan.cre~
              WRITE_ASCII 0x280 ~MyBG2Ajan~ #8     //new script name

              WRITE_ASCII 0x2cc ~AjanBG2~ #8      //Probably you also may want to change his dialog?


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 25 January 2017 - 05:46 AM

This would doublicate the base cre file, I think? Before the player formed him in the game, I mean. I was searching for a way to transfer the Ajantis who travelled with CHARNAME in the BG1 part of the game into the BGII part (for BGT or EET, with e.g. MoveGlobal()).

 

The only thing I can think of is MoveGlobal(), but then I would have a cre with the BG1 script name "Ajantis", without my prefix. As far as I can see, name, scripts and dialogue can all be changed in the game. The only problem is the script name / death variable.

 

So, either find a way to change this or be able to doublicate the Ajantis the player leaves at the end of BG1 / SoD into a different creature with my DV. If anyone has an idea, please let me know.


Edited by jastey, 25 January 2017 - 05:47 AM.


#4 argent77

argent77
  • Modders
  • 617 posts
  • Gender:Male

Posted 25 January 2017 - 06:11 AM

There is opcode 135 (Polymorph) which can also transfer stats of the original creature to the target in addition to appearance. But I don't know what side effects this effect may cause.



#5 Roxanne

Roxanne
  • Modders
  • 1153 posts
  • Gender:Not Telling

Posted 25 January 2017 - 06:29 AM

This would doublicate the base cre file, I think? Before the player formed him in the game, I mean. I was searching for a way to transfer the Ajantis who travelled with CHARNAME in the BG1 part of the game into the BGII part (for BGT or EET, with e.g. MoveGlobal()).

 

The only thing I can think of is MoveGlobal(), but then I would have a cre with the BG1 script name "Ajantis", without my prefix. As far as I can see, name, scripts and dialogue can all be changed in the game. The only problem is the script name / death variable.

 

So, either find a way to change this or be able to doublicate the Ajantis the player leaves at the end of BG1 / SoD into a different creature with my DV. If anyone has an idea, please let me know.

Ah - I misunderstood.

So a BGT/EET transition in which DV is changed...


Edited by Roxanne, 25 January 2017 - 06:36 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#6 K4thos

K4thos
  • Modders
  • 876 posts
  • Gender:Male

Posted 25 January 2017 - 06:30 AM

Problem: The BG1 Ajantis has the script variable "Ajantis", whereas in my mod I use a prefix. I do not want to use "Ajantis" without a prefix for my mod NPC, to prevent incompatibilities (and other reasons). As far as I know, it is not possible to change the script name of a creature inside the game.

How could I call the BG1 Ajantis in the BGII part but give him a new script name? Or any other solution that gives a similar result?

It's not possible to change DV mid-game but when it comes to vanilla BG2, BG2:EE and EET I highly recommend using the same DV for both BG1 and BG2 NPC. So in case of your Ajantis mod it would be just "Ajantis". Other files like dialogues and scripts can (and should) be still named differently to not overwrite files of course, but the DV alone is crucial for full continuity, so we can use MOVE_GLOBAL.

The problem with above approach is BGT because of limited vanilla engine functionality (unlike EE games vanilla engine forces us to use the same dialogue, banter dialogue and sleep scripts files during whole game - PDIALOG.2DA, INTERDIA.2DA).

If you want to make the mod compatible with all platforms at once but with full continuity I can think about 3 ways to deal with it:
1. Append to BG1 dialogue files and dream scripts rather than using unique files (not needed for BG2, BG2:EE and EET but this would solve the problem with BGT).
2. One mod version for BG2 / BG2:EE / EET that uses the same DV and different version for BGT
3. Use cpmvars like variable for DV in your code depending on the platform

Not sure which one would be the best for you. If you would like to use third option than it can be implemented automatically via EET_modConverter tool (see the report attached to this post - all the files mentioned there are automatically updated and your tp2 file is patched with EVALUATE_BUFFER if not present already). The result would be exactly the same as option 2 but you wouldn't need to maintain 2 different mods builds. The first option is also viable (thats how BGT implement continuous characters) but you would need to be careful with dialogue filtering (especially for banters).

 

edit:

There is opcode 135 (Polymorph) which can also transfer stats of the original creature to the target in addition to appearance. But I don't know what side effects this effect may cause.

If this would work than it sounds like a good workaround for the problem of 2 different DVs during game. I've experimented with it years ago at the beginning of EET creation. From what I remember it didn't work the way I wanted but not sure what was the problem. Maybe it was just my concern about compatibility with other BG2 mods (since other than Imoen DV used by BG1 and BG2 cre files are the same) rather than technical problem with the action / spell effect. Let us know if this will be viable solution.

Attached Files


Edited by K4thos, 25 January 2017 - 07:20 AM.


#7 Roxanne

Roxanne
  • Modders
  • 1153 posts
  • Gender:Not Telling

Posted 25 January 2017 - 08:56 AM

I have found ways to change almost everything contained in the cre file by either script or spell while developping my mods, except for the DV.

I think it is far easier and reliable to rather change the scripts/dialogues that use the DV.

 

For EET I would suggest to follow K4thos proposal, move your NPC per MoveGlobal to where and when he re-appears. Create a EET set of dialogues and scripts with revised DV references (also adjust to new chapter numbers).

 

For BGT there is not such an easy solution - even if it tries to appear as a continuos game it is not. Only few attempts have been made to create continuous NPCs for BGT (Breagar, my own deceased Sandrah) and those were designed for that purpose from the beginning. I am not sure if trying to unite both mod parts into one may not be more work than to create a continuos one for BGT (or just leave it as it is). Especially for Ajantis it is not so far fetched that the man you meet after much development is not exactly the same you left significant time ago on the Sword Coast. Ajantis is not one of those whom you meet again right after the transition and when you finally find him, he has undergone some trials and events in between.

 

By the way - your attempt is a good example for the fact that it will get harder to maintain mods compatible with all platforms while trying to make use of the far more advanced possibilities of EET. Some things are simply not backwards compatible.


Edited by Roxanne, 25 January 2017 - 09:00 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#8 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 25 January 2017 - 10:11 AM

Thank you for your ideas.

It is true that there is a good explanation why Ajantis would be changed after all the time that passed. Making him continuous is my wish since he was made compatible with BGT, though. It also is nice if the player used Level1NPC to change him into something custom. Not that I appreciate him being made to something other than Paladin or Cavallier. :-)

I will ponder about using the same DV. It feels so... possessive. And the possibility about my NPC performing actions/dialogues meant for another Ajantis scares me.

 

 

I don't think I understand EET's possibilities, though. Because I thought it is possible to move the BG1 NPC into the appropriate BGII area in BGT (assuming the problem with the DV is solved). What are the problems with continuity you mention for BGT? As far as I see, the big advantage of EET is the possibility to define different dlg names for the different game parts. Is there more (in relation to the transition, not the general advanced possibilities of EE)?

 

I guess I will go for one version, nevertheless, and work with OUTER_SPRINTs. Appending to different dialogue files for the different games is still better than maintaining two different mod versions.



#9 Roxanne

Roxanne
  • Modders
  • 1153 posts
  • Gender:Not Telling

Posted 25 January 2017 - 10:28 AM

I don't think I understand EET's possibilities,

You will need a completely different transition for BGT and EET - also take into account that EET has SoD in between.

In EET you will check that Ajantis is not dead, he has been in your party already, (maybe his romance status or similar) and finally let him appear via MoveGlobal at the chosen place and event in BG2.

In BGT you have to do the transition from the BG1 side prior to initiating the final talk with Belt. For this you have to find the right place/time/trigger - and what if he is not in the final party? It requires different methods and more work - I say this because I did it for both games already. (Your case is even more tricky because Ajantis is not just standing there at some pre-defined location in BG2, if I remember correctly)

The big difference in EET is that living joinable NPCs not in party are maintained in Baldur.gam and can be *summoned* from there in their latest state. This does not exist in the old game (BGT), where you need to move them from BG1 to BG2 in some manner.


Edited by Roxanne, 25 January 2017 - 10:30 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#10 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 25 January 2017 - 10:53 AM

Ah, I see. Thank you for the explanation!

 

I also wanted to ask: Why "deceased" Sandrah?



#11 K4thos

K4thos
  • Modders
  • 876 posts
  • Gender:Male

Posted 25 January 2017 - 11:04 AM

I don't think I understand EET's possibilities, though. Because I thought it is possible to move the BG1 NPC into the appropriate BGII area in BGT (assuming the problem with the DV is solved). What are the problems with continuity you mention for BGT? As far as I see, the big advantage of EET is the possibility to define different dlg names for the different game parts. Is there more (in relation to the transition, not the general advanced possibilities of EE)?

It is possible in BGT (done for all vanilla NPCs - as mentioned Ascension64 decided to merge dialogues controlled by PDIALOG.2DA and INTERDIA.2DA to make it work with old engine). You just need to solve the DV problem with BGT. And it can be done with any of the options suggsted in this topic. I would start with testing Polymorph effect mentioned by Argent.

 

You will need a completely different transition for BGT and EET - also take into account that EET has SoD in between.

In EET you will check that Ajantis is not dead, he has been in your party already, (maybe his romance status or similar) and finally let him appear via MoveGlobal at the chosen place and event in BG2.

In BGT you have to do the transition from the BG1 side prior to initiating the final talk with Belt. For this you have to find the right place/time/trigger - and what if he is not in the final party? It requires different methods and more work - I say this because I did it for both games already. (Your case is even more tricky because Ajantis is not just standing there at some pre-defined location in BG2, if I remember correctly)

The big difference in EET is that living joinable NPCs not in party are maintained in Baldur.gam and can be *summoned* from there in their latest state. This does not exist in the old game (BGT), where you need to move them from BG1 to BG2 in some manner.

EET compatibility patch for Ajantis is already created so it's a matter of internalizing it by jastey rather than coding new stuff. To make character continuous with BG1 CRE files (if the same DV will be used by BG1 and BG2 CRE files) the only adjustment needed is updating STR_VAR variables used by EET_NPC_TRANSITION function (which is already implemented in Ajantis compatibility patch) So less than a minute of work to make it fully continuous in EET. When it comes to SoD he just won't be playable in that part of the story unless jestey makes changes in Beamdog's BD0103.BCS script that dumps him from the party by default after leaving Korlasz's Tomb (same is true in vanilla BG:EE).

 

If the Polymorph effect will be usable for this purpose I'm also interested in updating EET_NPC_TRANSITION function to support this automatically for mods.

 

BGT transition indeed will need to be coded separately though but it's not hard. I think I could help with this if I install BGT to refresh memories how it was implemented there. There is 1 script in BGT that handles whole transition to SoA IIRC.

 

edit:

I guess I will go for one version, nevertheless, and work with OUTER_SPRINTs. Appending to different dialogue files for the different games is still better than maintaining two different mod versions.

you mean cpmvars like variable for DV? If yes than send me latest version of your mod. As mentioned converter tool can implement this automatically.


Edited by K4thos, 25 January 2017 - 11:35 AM.


#12 Roxanne

Roxanne
  • Modders
  • 1153 posts
  • Gender:Not Telling

Posted 25 January 2017 - 11:51 AM

There is 1 script in BGT that handles whole transition to SoA IIRC.

That was exactly my point. There is one script (Aram00.bcs) that handles it.

 

It is an area script that works on the party that is sent to this area by Belt. I.e. those that go to the area (and the items they carry) do the transition. E.g. Ajantis waiting at Elfsong Inn will not. And since you cannot go back there and no script can reach him there, this is where he will stand for the rest of BGT. Unless he is in the final party OR you write your own transition script for any case not covered by the BGT one. (For the BGT Sandrah I had a feature that sent her to Amn if you kicked her from the party during the last BG1 chapter instead of waiting for you at a temple). You just have to do it, it is possible, it is just not as convenient and easy as in EET.

 

In Aram00.bcs you define where and if your NPC does a transition or is just removed. This is also where per default the vanilla NPCs are handled. Anyone not captured there is stuck in BG1 or Nirvana, which is no problem because in BGT you do not return to there. Except for the max 5 NPCs in your transition party, the BG2 versions will appear instead (even if the BG1 creature died).

 

There was a short-lived initiative about 2 years ago to improve the transition but it was given up because a) it would have required changes to BGT itself and b) the idea of EET became visible with all the new possibilities.


Edited by Roxanne, 25 January 2017 - 12:13 PM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#13 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 25 January 2017 - 12:40 PM

Thank you for the explanations. K4thos: thank you for your offer. I'll test some things and have to make up my mind first, which could take a (long) while.



#14 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 01 March 2017 - 03:44 AM

I have questions to the LAF ~EET_NPC_TRANSITION~ as linked in K4thos' post above. I don't understand what it does. Do I need this for my mod's preparation? Or do I include this into my mod? Why do all examples read stringPosDV = "Jaheira" although it's about Imoen's DV?


Edited by jastey, 01 March 2017 - 03:44 AM.


#15 jastey

jastey
  • Gibberlings
  • 6536 posts
  • Gender:Female

Posted 01 March 2017 - 04:39 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?





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users