Jump to content

Imprisonment bug?


critto

Recommended Posts

@Avenger So if I understand correctly, when an NPC joins, or dual-classes and levels up to regain their first class, or is Imprisoned and them freed, any effects in their CLAB are stripped away, and then reapplied? (Sort of like running an AddKit action?)

 

And the bug was caused by some effects not being stripped away?

 

Does it (the stripping away of effects) operate by resource name, or by effect? Will mod-added .spl files be treated correctly?

 

I've been going through my mod and breaking out every effect I AP_ in kits' CLABs into multiple versions so they don't get doubled. Like, where I used to apply d5_thac.spl, which gives a +1 to-hit bonus, multiple times in a CLAB file... now I have d5_thac1.spl, d5_thac2.spl, etc., 10 copies total, and each one gives a thac0 bonus and then uses opcode 206 to never be applied again.

 

It is SUPER annoying to have to do that.

Link to comment

The strip/reapply CLAB is pretty common, actually. Characters lose their CLAB when they leave the party and get it back when they rejoin--the best known example is temporarily kicking Yoshimo to get his special snares back. It's also why you don't see kitted NPCs have the abilities in their creature files, e.g. Korgan has no enrage and Yoshimo has no special snares. When they join, the CLAB gets applied, and Korgan's ready to rage amd Yoshimo ready to snare.

 

Last I had looked (which, granted, was long ago) the number of mod NPCs that don't know this is kinda depressing. So many ship with kit abilities on the creature file, which means they get doubled up when they join.

 

Edit: Strike that, the best known example are cleric holy symbols, and why we have to do such a stupid scripting workaround for them.

Link to comment

It's probably better mentioned in an NPC tutorial, since it's more relevant there.

 

Let me try an example to explain what I'm getting at. Let's say I'm making a new NPC mod, an Assassin named Havelock. I'll go into character creation, set up my stats, race, pick the kit, etc. I'll get to the game, export the character (I'll probably level him up and export a few more times so I have a couple of versions of him at different levels). Now, being an assassin kit, Havelock had the contents of the assassin CLAB ability table, clabth02.2da, applied to him. So he's got his +1 to hit/damage for being an assassin, as well as some Set Snare and Poison Weapon abilities.

 

If I make my mod creature files from this and ship my mod, it means when Havelock joins a player's party, he gets all of that applied again. So now he's got +2 to-hit/damage and double the number of Set Snare and Poison Weapon abilities as he should. I should have removed all of that when making my original creature files--this is the step a lot of mod NPCs miss.

 

This isn't just a kit issue either--straight classes have CLAB files for abilities as well. However, straight class CLAB tables are generally empty so it's rarely an issue.

Link to comment

It's probably better mentioned in an NPC tutorial, since it's more relevant there.

... (I'll probably level him up and export a few more times so I have a couple of versions of him at different levels).

This is usually a great mistake, see I for one would like to have the character be a level 1 NPC(unless under exceptional circumstances, such as the NPC challenges the pc to a duel) with just the XP to match when the char name has an level .. so the character can be leveled up and have a proper weapon profs I want them to have. So advising this would be good...

Link to comment

Here's how I'm beginning to see things (FWIW):

 

If you watch closely during character creation, you can see things go onto your character sheet with a bit of a delayed reaction as you get further along. Hit the "Skills" button, and when you come back you can see that CLAB effects get applied; hit the "Appearance" button, and you can see that you skills and proficiencies have been applied. And those are all basically just effects, that get applied to your .CHR file. After you choose proficiencies, if you open the file in NI, you can see opcode 233 effects acting on your character.

 

So, when you first meet an NPC, it has a blue circle, and it represents a .CRE file. When you select a dialogue option to have the NPC join you party, I think the engine generates a .CHR file from the .CRE file, and (more or less) runs through the character generation process just like you do, except in an automated way, applying the information in the .CRE file. So if the Valygar .CRE says he is a Stalker, then the created .CHR file will have all of the Stalker CLAB effects applied as it is generated.

 

Pitfall #1: most people don't realize the game does this automatically - they think they have to "catch the character up" to its level. So they manually add CLAB effects to the .CRE file. Those effects are actually redundant.

 

Now, the next part happens when characters *leave* the party. Basically they are stripped down to their basic .CRE elements - no longer a full character, just a formula for a character. If they re-join the party, the process runs again, and the formula is converted into a full character.

 

Pitfall #2: sometimes the game is not perfect at stripping effects from the .CHR file when it leaves the party. So those effects carry over to the simplified formula; and when you once again convert the formula to a character, the CLAB effects are applied over the leftover effects, and you get doubled bonuses or doubled abilities.

 

If EE v2.0 fixes that 2nd pitfall I will be very happy. :)

Link to comment

Avenger can speak to the CLAB apply/remove better than I can, but AFAIK CHR files are only generated for export/import.

 

Like turtles, it's cre files all the way down. Character creation loads the GAM file, starts with CHARBASE.cre, and builds onto it and throws it onto the GAM file. Traditional NPCs are listed in the GAM file; when you enter their area it consults npclevel.2da to decide which cre file to pull. Once they join, the cre file gets their CLAB applied and enter the GAM file and stay there. Mod NPCs spawn via script, but they go into the GAM file (with their CLAB) once they join as well. Kick/join will remove/apply the CLAB file.

 

If you're generating cre files for a mod NPC, it seems the best plan seems to be generating them as a multiplayer NPC, kicking them out of the party, and then extracting the cre file from the save game.

Link to comment

 

 

The strip/reapply CLAB is pretty common, actually. Characters lose their CLAB when they leave the party and get it back when they rejoin--the best known example is temporarily kicking Yoshimo to get his special snares back. It's also why you don't see kitted NPCs have the abilities in their creature files, e.g. Korgan has no enrage and Yoshimo has no special snares. When they join, the CLAB gets applied, and Korgan's ready to rage amd Yoshimo ready to snare.

That makes sense. The issue with EE, however, as I understand it (the 1.3 version, at least, I haven't tested 2.0) is that when you join a kitted character (the cre file does not possess any of the manually assigned kit bonuses that the game is expected to add automatically), he gets those bonuses applied twice, at least, on the first join. I couldn't reproduce the same behaviour for a re-join. That's why I had to write a script that applies one-time spell designed to negate those doubled bonuses on a character.

 

This is what my question was about. Whether 2.0 fixes that particular problem. Not only the issue with multiplayer-created characters having their kit bonuses doubled on re-join after Imprisonment, etc.

 

PS: thanks for the explanation on the mechanics of the whole process.

Link to comment

Well, vanilla iwd had no kits. Did vanilla bg1 have kits? Applying the clab on join was always the case as far as i know.

 

CamDawg: EE 2.0 will scrub all clab effects from the char on join, so i think it will be compatible with the buggy mods too.

Link to comment

Well, vanilla iwd had no kits. Did vanilla bg1 have kits? Applying the clab on join was always the case as far as i know.

Well, if we go back a full circle and look with the info we now have, it kinda did have kits, even if you would group them as classes instead(just like the Barbarian and Half-Orcs). Wizard kit... :p

But that's way pass the point you desired to make, so I'll give you it still.

Link to comment

Archived

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

×
×
  • Create New...