Jump to content

Please clarify the TP2 file for me


WarChiefZeke

Recommended Posts

The reason the TP2 is not working as you intended is that the SAY commands are actually patch commands that modify the file currently being copied. Therefore, you need all of those SAY commands to follow immediately after the CRE file COPY command.

 

I usually indent SAY commands with a tab or a couple of spaces to make it clear that they are attached to the preceding COPY.

 

The COPY of the sounds should come before the other COPY or after all of the SAY commands.

 

As for opcodes, look at some items with attached abilities and effects using Near Infinity. Each effect is a fixed-size block of data in the resource file (ITM, SPL, etc.). The opcode is just a number that specifies a type of effect. It tells the game how to interpret the other parameters. An ability is something you can click from the toolbar; an ability can have one or more effects (each with an opcode) that specify what the ability will actually do when you click it. An item can also have direct effects (attached directly to the item, not part of a specific ability on the item). Direct effects are applied whenever you equip or use the item.

Link to comment

What is the best way to avoid stutter bugs? I am basically finished at this point and am playtesting through. Quests, interjections, journals, cutscenes all good, but chapter related dialogues such as the one after slaying Mulahey cause permanent stuttering afterwords. I have no idea what could be causing this in the code, as it all looks good to me. The sample:

 

IF
InParty(Myself)
See(Player1)
Global("i!chapter3talk","GLOBAL",0)
CombatCounter(0)
Global("Chapter","GLOBAL",3)
Dead("Mulahey")
THEN
RESPONSE #100
SetGlobal("i!chapter3talk","GLOBAL",1)
StartDialogueNoSet(Player1)
END

 

Dialogue is conditioned to run upon the variable being set to 1, and it does.

Link to comment

What is the best way to avoid stutter bugs? I am basically finished at this point and am playtesting through. Quests, interjections, journals, cutscenes all good, but chapter related dialogues such as the one after slaying Mulahey cause permanent stuttering afterwords. I have no idea what could be causing this in the code, as it all looks good to me. The sample:

 

IF

InParty(Myself)

See(Player1)

Global("i!chapter3talk","GLOBAL",0)

CombatCounter(0)

Global("Chapter","GLOBAL",3)

Dead("Mulahey")

THEN

RESPONSE #100

SetGlobal("i!chapter3talk","GLOBAL",1)

StartDialogueNoSet(Player1)

END

 

Dialogue is conditioned to run upon the variable being set to 1, and it does.

Well, you can check that it's the case here... by for example installing the LStest mod temporarily. Temporarily as it disables the cutscenes from being ran, but it can be uninstalled easily so it has no permanent bad effects. So play the game until you get the stutter, save, exit, install the mod and see it's cause, and verify it by looking at the scripts with Near Infinity for example, uninstall the LStest mod, fix the cause and proceed.

The mod allows you to detect that the specific script is actually ran and at what stage ... so from that you can then determine of what's the cause of the stutter ...

Link to comment

hm, that mod doesn't seem to like many custom scripts in the npc project and wouldn't install. but installed partially as some of the saves- but only some- are shouting the script, and cutscenes still work :undecided:

 

...and now i realize the real problem isn't even the dialogue but in my quest script which starts a timer at the start of chapter 3 which starts the quest at the end.

Link to comment

 

What is the best way to avoid stutter bugs? I am basically finished at this point and am playtesting through. Quests, interjections, journals, cutscenes all good, but chapter related dialogues such as the one after slaying Mulahey cause permanent stuttering afterwords. I have no idea what could be causing this in the code, as it all looks good to me. The sample:

 

IF

InParty(Myself)

See(Player1)

Global("i!chapter3talk","GLOBAL",0)

CombatCounter(0)

Global("Chapter","GLOBAL",3)

Dead("Mulahey")

THEN

RESPONSE #100

SetGlobal("i!chapter3talk","GLOBAL",1)

StartDialogueNoSet(Player1)

END

 

Dialogue is conditioned to run upon the variable being set to 1, and it does.

Well, you can check that it's the case here... by for example installing the LStest mod temporarily. Temporarily as it disables the cutscenes from being ran, but it can be uninstalled easily so it has no permanent bad effects. So play the game until you get the stutter, save, exit, install the mod and see it's cause, and verify it by looking at the scripts with Near Infinity for example, uninstall the LStest mod, fix the cause and proceed.

The mod allows you to detect that the specific script is actually ran and at what stage ... so from that you can then determine of what's the cause of the stutter ...

 

The dialogue itself needs to contain DO~SetGlobal("i!chapter3talk","GLOBAL",2)~ at some point, otherwise it will repeat.

Link to comment

Luckily, i've already been doing that for all starting conversation responses, just to be doubly sure convos don't repeat.

 

Anyway, virtually everything seems to work now, the quest script was the last buggy thing, so once I do a full wipe and re-install to get LStest off of my system (long story short, it bugged out and won't uninstall) i'm gonna complete this playthrough and then, I suppose, release the BG portion of this mod somewhere.

 

This never could have been done without your guys help, as I would have ragequit due to these rather simple issues had I been trying to solve them on my own :)

 

Now to actually play SOD and decide if i'm gonna mod for it :D

Link to comment

Does anyone have any suggestions on how I should handle the transition between SOD and BG1? I really have no idea how to go about this.

 

There are basically two ways for this character to show up, importing from a save game or, if they are not with you in the final battle, being added to some fitting area. So in other words it's not much different than the BG2/TOB transition, so at least this is good practice. I'm assuming it will then be necessary to change banter files with the character, and this should be done by the TP2 correct?

Link to comment

You have two options: you can keep the same dialogue files for BG1 and SoD and check the CHAPTER and ENDOFBG1 global variables to control which dialogues get triggered, or you can create new dialogue files just for SoD.

 

If you create new dialogue files just for SoD, they should be added to BDDialog.2DA and BDBanter.2DA, which are the SoD equivalents of the pdialog.2da and interdia.2da files (https://gibberlings3.github.io/iesdp/files/2da/2da_bgee/index.htm).

 

The game will automatically assign dialogue files to your NPC when it joins/leaves the party and at the BGEE->SoD transition (after Sarevok's defeat) based on the contents of the files above. Specifically, the dialogue files listed with your NPC's scriptname/DV in the respective 2DAs.

 

Assuming you don't use separate dialogue files, here is an example of a chapter check:

 

Global("Chapter","Global",7)

 

This is true only during chapter 7, which is the final BG1 chapter and also the SoD prologue chapter. Chapters 8 - 13 are SoD (13 is also BG2's first chapter for EET games).

 

You can also use ENDOFBG1 - this global variable will return 1 after the death of Sarevok. It is set to 2 after Siege of Dragonspear -> Shadows of Amn transition. In other words you can use it to filter content designed only for BG:EE part of the story (or only for BG2 if you set the trigger to check if the result equals 2).

 

In other words, Global("endofbg1","GLOBAL",1) is only true after Sarevok is defeated, so that plus chapter 7 means SoD prologue is in progress.

 

You can also use GlobalLT and GlobalGT (less than / greater than) to match a range of chapter values.. Or, for example, GlobalLT("endofbg1","GLOBAL",2) is true until the BG2 SoA transition/start in chapter 13, so it covers both BGEE and SoD content. That one is useful for EET compatibility.

Link to comment

Nice, that helps a lot, thanks. The dialog parts are working fine but i'm assuming the new banter files for SOD are why the banter files are not.

 

Having that one variable that checks for the end of BG1 saves me quite a bit of time coding the reset of all variables upon transfer to SOD.

 

Is there a script command to change your banter file name like there is for your dialogue?

Link to comment

Nice, that helps a lot, thanks. The dialog parts are working fine but i'm assuming the new banter files for SOD are why the banter files are not.

 

Having that one variable that checks for the end of BG1 saves me quite a bit of time coding the reset of all variables upon transfer to SOD.

 

Is there a script command to change your banter file name like there is for your dialogue?

You may use (in the NPC's override script) something like

StartDialogue("BMySoD",[PC])

Which should make your NPC use the BMySoD banter file for this specific dialogue. Otherwise it would be better to use the assignment in BDBanter.2da like in agb1's excellent turorial.

Link to comment

You have two options: you can keep the same dialogue files for BG1 and SoD and check the CHAPTER and ENDOFBG1 global variables to control which dialogues get triggered, or you can create new dialogue files just for SoD.

 

If you create new dialogue files just for SoD, they should be added to BDDialog.2DA and BDBanter.2DA, which are the SoD equivalents of the pdialog.2da and interdia.2da files (https://gibberlings3.github.io/iesdp/files/2da/2da_bgee/index.htm).

 

The game will automatically assign dialogue files to your NPC when it joins/leaves the party and at the BGEE->SoD transition (after Sarevok's defeat) based on the contents of the files above. Specifically, the dialogue files listed with your NPC's scriptname/DV in the respective 2DAs.

 

Assuming you don't use separate dialogue files, here is an example of a chapter check:

 

Global("Chapter","Global",7)

 

This is true only during chapter 7, which is the final BG1 chapter and also the SoD prologue chapter. Chapters 8 - 13 are SoD (13 is also BG2's first chapter for EET games).

 

You can also use ENDOFBG1 - this global variable will return 1 after the death of Sarevok. It is set to 2 after Siege of Dragonspear -> Shadows of Amn transition. In other words you can use it to filter content designed only for BG:EE part of the story (or only for BG2 if you set the trigger to check if the result equals 2).

 

In other words, Global("endofbg1","GLOBAL",1) is only true after Sarevok is defeated, so that plus chapter 7 means SoD prologue is in progress.

 

You can also use GlobalLT and GlobalGT (less than / greater than) to match a range of chapter values.. Or, for example, GlobalLT("endofbg1","GLOBAL",2) is true until the BG2 SoA transition/start in chapter 13, so it covers both BGEE and SoD content. That one is useful for EET compatibility.

An overview of the new chapter sequence for all of EET is here

http://gibberlings3.net/forums/index.php?showtopic=27913&do=findComment&comment=242897

 

@agb1

This is an excellent tutorial for all modders interested in SoD/EET modding/addition to their mods-

It should be secured to one of the "how to..." threads for easier reference.

Link to comment

A creature has only one dialogue file assigned to it at any given moment. When the NPC joins the party, the game sets the NPC's current dialogue file to the "joined" dialogue file (from pdialog.2da - or BDDialog.2da during SoD only). When the NPC leaves the party (kicked out), the game sets the NPC's current dialogue file to the "post" dialogue file (from same 2da).

 

The banter dialogue file is not stored on the creature itself, but rather is accessed periodically from interdia.2da or bdbanter.2da (during SoD only), specifically whichever row of that 2DA file has the NPC's script name in the first column.

 

The dream/sleep script works similarly (it's specified in pdialog.2da -- or in BDDialog.2da during SoD only). That isn't a dialogue file itself, note -- it is a BCS file that runs when the player clicks on the party-rest button. Often it initiates dialogue via StartDialogue or a similar script action.

 

See https://gibberlings3.github.io/iesdp/scripting/actions/bgeeactions.htm (search for StartDialogue and StartDialogueNoSet). The latter initiates dialogue using the NPC's currently assigned dialogue file, and in my view it is good practice to use that unless you explicitly want to change the NPC's currently assigned dialogue file.

Link to comment

Archived

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

×
×
  • Create New...