Author Topic: Six's general problems & questions thread  (Read 7809 times)

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Six's general problems & questions thread
« on: October 20, 2007, 05:29:28 PM »
If the level of unpredictable weirdness I've seen since installing DLTCEP is any indication, I'm going to be shoveling my way through a lot of odd. And it's easier to keep track of if it's all in one thread, so hey, I'm hijacking my own thread. New stuff is at the bottom, original 1st post begins here.


I've been making my very first kit, the Shieldbearer. I've been using your handy tutorials like a good little boy, and being very careful not to suck. The TP2 looks good. I run the Setup, and everything looks fine, it says that the kit installed successfully. I crack open the Debug file just to make sure, and it has only good things to say.

Giddy, I start up BG2 to begin the first-ever game as a Shieldbearer. My heart gives a little flutter as I see it listed right where it belongs, among the Fighter kits. I read the Kit Description and make note of where I should add line breaks to make it look tidy. I select the Shieldbearer kit and move on to choose my alignment . . . what the hey? All 9 of the alignments are open to me, I should only be allowed to choose Lawful ones. Hmm, must be a bug. I get another surprise when I discover that my adjustments to my allowed Weapon Proficiencies didn't take either. Frowning, I complete the process. Irenicus talk talk talk, Imoen talk talk talk, freedom. The Special Abilities that I'm supposed to have as a Shieldbearer are not there. I look at my Records screen, Kit Description, and there I read the description of a default Fighter. Huh?

Long story short: I make a kit. I install the kit. I choose that kit. And then the game immediately forgets all about the kit and bumps me to a standard Fighter. I know I've never seen any threads reporting bugs similar to this, but does anyone have a clue what went wrong? I can post/email files if you request.
« Last Edit: October 26, 2007, 12:45:49 AM by SixOfSpades »

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: My first mod installed correctly! Oh, wait. No, it didn't. What?
« Reply #1 on: October 21, 2007, 03:02:14 AM »
Found it!

My bad: When I used CamDawg's tutorial as a template, I got tripped up by the line
Code: [Select]
// usability flags, added to the end of the KITLIST.2da entry
  ~0x00004000     3~
I overlooked the fact that I had to change the 3 (Cleric) into a 2 (Fighter). Odd how, even with all the K_F_X files you specify, the game needs one more confirmation before it recognizes the actual parent class.

Anyway, it's all good now. Sorry to have taken up your time, but at least we learned something about an engine quirk.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #2 on: October 26, 2007, 12:58:47 AM »
Okay. This one should stump you, at least for a while. I want the kit to have the innate ability to cast Defensive Harmony, so I crack open SPPR406, change it to be an innate, and save it under a new spell name. Since DH is supposed to be non-cumulative with itself, I copy the spell's "Protection from Spell" Extended headers that block out successive castings of DH, edit those to block out the innate ability as well, and copy this new immunity to both the innate ability and the copy of SPPR406 that's sitting in the Override folder. I then playtest.

The spell correctly does not stack with itself.
The innate correctly does not stack with itself.
The innate correctly blocks against the spell.
The spell does not block against the innate.

I don't get it! Seriously, the two .spl files are exactly the freakin' same, with the sole exceptions being that the innate has General Properties, Spell Type = Innate, and Extended Effects, Location = Innate. I am absolutely sure that all .spl files are correctly named and spelled, and that both the innate and the spell have a total of 4 'Protection from Spell' opcodes: 2 that lock out the innate, and 2 that lock out the spell.

Anybody have a clue what's goin' on?

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Six's general problems & questions thread
« Reply #3 on: October 26, 2007, 01:43:32 AM »
Effects are parsed and processed in the order they appear in the file. Most likely, you have Protection from spell: SPPR406 before Protection from spell: SPINxyz (or SPCLabc) in the original spell (SPPR406).

Because the engine sees and applies this protection, any subsequent effects fail. Just swap them so that Protection from spell: SPPR406 is the *last* effect in SPPR406 (similarly, the protection from your innate should be the last effect in your innate SPL).

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #4 on: October 26, 2007, 11:17:08 PM »
Hey, that explanation . . . actually makes some sense. I was half expecting you to tell me to strip naked, paint myself orange, and dance the hoodoo. It seems a bit counterintuitive to allow the spell to short-circuit itself instead of just subsequent castings, but I guess BioWare wanted a built-in emergency exit. Thanks for the help!

But since you're so smarty and all, does the game have some underlying hatred of applying an Attacks per Round penalty? The opcode seems to be unable to handle negative numbers.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Six's general problems & questions thread
« Reply #5 on: October 26, 2007, 11:44:06 PM »
APR is handled stupidly. There may not be any way to reduce it, but I suspect there probably is. I've never messed around with it personally, however, so I can't say what exactly you'd need to do.

(I don't remember that there was a true APR modifier effect, just the one to set APR to a static value; you could also just set the affected character's APR to 1, which would be a reduction for most characters! BioWare certainly never used a modifier -- everything they coded sets APR.)
« Last Edit: October 26, 2007, 11:46:57 PM by devSin »

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #6 on: October 27, 2007, 11:33:07 AM »
Yeah, I tried setting ApR = 1, but that actually has zero effect in-game. I then tried setting it to 0.5, which correctly counteracted the 0.5 bonus that Warriors get at Level 7, but it was unable to similarly counter the bonus they get at Level 13. And that method generates some wonkiness when they're using a weapon that they're not proficient with: Instead of the correct ApR of 1, their ApR is 0.5.

I've also tried things like setting ApR to be 2/3rds of its previous value, or setting it = 0 & then adding a +1 bonus, but those methods do nothing. So I've decided to throw my metaphysical hands in the air and abandon that particular disadvantage of the kit, at least for now. But at least everything else is done--I even finally got the Shieldbashing to work.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #7 on: November 18, 2007, 02:26:15 AM »
Brace yourselves, I've got another one.

I want to do things like allow default Paladins (but not their kits) to attain Mastery in any weapon. This means telling WeiDU to find the Paladin column in WEAPPROF.2DA and change almost all of the 2s into 3s.
     . . . except that I can't find any commands that will let me do that. I've checked the first 10 pages of this forum, all of the General Mod Discussion forum, and scoured the README-WeiDU file (version 185). There might be a command to search a .2da file for a certain string and return its location, but I read it three times & didn't see anything that would let me alter an existing column of data. So, lacking a single convenient keyword, I started doing it by brute force, and after much shooting in the dark, I got

Code: [Select]
COPY_EXISTING ~weapprof.2da~ ~override/weapprof.2da~
  WRITE_ASCII   0x16cf 3  // Bastard Sword
  WRITE_ASCII   0x194a 3  // Longsword

And I could have gone on like that, except luckily I facepalmed and realized that this method could only work on systems that had absolutely no new mod kits added to the game. Granted, I could ask players to install this component before any kit mods, but that would be asking too much--not to mention really sloppy workmanship. So I ask you--how the heck do I WeiDU an existing column of data?

Offline aVENGER

  • Planewalker
  • *****
  • Posts: 143
Re: Six's general problems & questions thread
« Reply #8 on: November 18, 2007, 05:51:54 AM »
What you want is SET_2DA_ENTRY.

Once you get the hang of the basics, it might be better to use the SET_2DA_ENTRY_NOW/LATER combo.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Six's general problems & questions thread
« Reply #9 on: November 18, 2007, 09:14:42 AM »
Once you get the hang of the basics, it might be better to use the SET_2DA_ENTRY_NOW/LATER combo.
For maximum performance, if you have 5 or fewer SET_2DA_ENTRY actions for a single file, you want to continue using SET_2DA_ENTRY. SET_2DA_ENTRY_LATER and SET_2DA_ENTRIES_NOW is only beneficial if you have more than 5 SET_2DA_ENTRY actions (or if you want automatic NOT_SO_PRETTY_PRINT_2DA).

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #10 on: November 18, 2007, 10:50:56 AM »
The ironic thing is, I saw SET_2DA_ENTRY . . . I must have just glossed over it because it didn't change a whole row/column at once, which is what I was sure could be done. Only just now, before coming online, did I install Rogue Rebalancing and see that aVENGER uses . . . SET_2DA_ENTRY_LATER. Looks like I'll be updating my WeiDU now. Thanks for the continued reality checks, devSin. As you can tell, I needs 'em. :)

Offline aVENGER

  • Planewalker
  • *****
  • Posts: 143
Re: Six's general problems & questions thread
« Reply #11 on: November 18, 2007, 02:41:09 PM »
For maximum performance, if you have 5 or fewer SET_2DA_ENTRY actions for a single file, you want to continue using SET_2DA_ENTRY. SET_2DA_ENTRY_LATER and SET_2DA_ENTRIES_NOW is only beneficial if you have more than 5 SET_2DA_ENTRY actions (or if you want automatic NOT_SO_PRETTY_PRINT_2DA).

That's why I said might. ;)

Anyway, there are several examples of both uses in the Rogue Rebalancing .tp2 and they are always accompanied by comments which explain what exactly is being done. The reason for this is that I had forgotten what most of the code actually meant when I came back to BG2 modding (after a lengthy break) so from then on, I started adding explanatory comments to every damn thing. :)

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #12 on: November 18, 2007, 10:00:49 PM »
Yeah, I noticed that, and I'm thankful for it, otherwise I would have lost another chunk of time (and gained the equivalent chunk of aggravation) before remembering that the actual data in weapprof.2da is right-shifted by 1 column. And yep, I'm documenting everything too, both for the sake of good programming style and because the best new mods look to the best old mods for guidance. Thanks, aVENGER.

And now if you'll excuse me, I'm going to go look up that mod that allows Barbarians to Dual-class, and see what it does to dualclas.2da. Yeah, I could just go by trial & error for an hour and a half, but why?
[ADD] Sheesh. Spent an hour scouring the Modlist, never did find the dang thing. I guess they haven't submitted it yet. And then I did the trial & error bit and got it right on the first try. Took all of three minutes. Another victory for Team Irony.
« Last Edit: November 18, 2007, 11:51:29 PM by SixOfSpades »

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #13 on: November 24, 2007, 12:25:15 AM »
Next up: Messing with DIALOG.TLK.

If I have the numerical index of an existing string that I want to change, what WeiDU command should I use to avoid shooting myself in the foot? It doesn't seem to be SAY offset string, or WRITE_ASCII_TERMINATE, and most of the others say do not use this feature. I'm scared.  :-\
« Last Edit: November 24, 2007, 12:29:26 AM by SixOfSpades »

Offline Ascension64

  • Planewalker
  • *****
  • Posts: 472
Re: Six's general problems & questions thread
« Reply #14 on: November 24, 2007, 01:54:49 AM »
STRING_SET index string. Do not use this feature.  ;)

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #15 on: November 24, 2007, 10:38:33 PM »
Well, it seems to work, thanks. Odd, though--if it's safe to use, what's with the warning?

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 859
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: Six's general problems & questions thread
« Reply #16 on: November 24, 2007, 11:13:53 PM »
It's an old modder joke--any time we'd pester Wes to add a new WeiDU feature, it'd usually come with a 'do not use this function' note in the WeiDU readme.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: Six's general problems & questions thread
« Reply #17 on: November 24, 2007, 11:31:42 PM »
It's an old modder joke--any time we'd pester Wes to add a new WeiDU feature, it'd usually come with a 'do not use this function' note in the WeiDU readme.

Although this was, if not the first, then certainly one of the first, and for good reason.
  • At the time it was introduced, it was not uninstallable (is it now? I lose track.)
  • There is often a different, more graceful way of achieving something you would otherwise do with hard string setting, particularly if it involves a state of dialogue.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Six's general problems & questions thread
« Reply #18 on: November 25, 2007, 02:49:05 AM »
At the time it was introduced, it was not uninstallable (is it now? I lose track.)
Yes. Or as close to it as possible.

There is often a different, more graceful way of achieving something you would otherwise do with hard string setting,
More compatible too.

"Do not use this" usually means it's either undocumented (you can easily maim small children with careless use), created for a specific purpose (i.e., not for you), or is just a stupid idea for an interoperable installation system (i.e., forced overwrite with no consideration of the current state, which may or may not be the default state).

I think toward the end it was more the first two reasons than the latter. Wes either didn't want to talk about it or didn't care for anybody else to use it. ;)

Offline Ascension64

  • Planewalker
  • *****
  • Posts: 472
Re: Six's general problems & questions thread
« Reply #19 on: November 25, 2007, 03:08:20 AM »
But of course, those dreadful warnings demand a review. STRING_SET being one of them.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #20 on: November 25, 2007, 08:20:00 AM »
As far as I can tell, my STRING_SET is regularly uninstallable--I did notice that the Description of my Ripper+2 got badly mangled, but that may have been a result of my earlier attempts with things like WRITE_ASCII_TERMINATE. I restored my backup, tested by reinstalling & uninstalling the new string, and I haven't seen any weirdness since.

There is often a different, more graceful way of achieving something you would otherwise do with hard string setting, particularly if it involves a state of dialogue.
The string in question is the Archer's kit description. I suppose I could append my new description to the end of DIALOG.TLK and insert its string index on the fly into KITLIST.2DA . . . but I think at the moment, this newbie will go for simplicity over elegance.

Offline Ascension64

  • Planewalker
  • *****
  • Posts: 472
Re: Six's general problems & questions thread
« Reply #21 on: November 25, 2007, 11:29:53 PM »
Yes, STRING_SET has been reversible back in the late 190s. Its just that documentation has never been a bigg thing.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Six's general problems & questions thread
« Reply #22 on: November 26, 2007, 12:08:48 AM »
Yes, STRING_SET has been reversible back in the late 190s. Its just that documentation has never been a bigg thing.
Back farther. Wes eventually caved and coded it up; probably the 170s or 180s or something.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #23 on: December 15, 2007, 01:34:15 AM »
This probably comes as no great surprise, but I want to make a Bard kit that has a Backstab multiplier. After my first failures, I was worried that it was a hardcoded limitation that only Thieves and part-Thieves can Backstab, but then I realized "Duh! The Stalker!" So I double-checked the Stalker kit and made sure everything was the same: Both the Stalker and the Rapscallion use the same spell (AP_spcl332) to increment their Backstab, I tested them using the same means of invisibility (Ring of Invisibility) and weapon (generic Longsword+1) for both.
The Stalker's damage was multiplied, the Rapscallion's was not. In addition, the Rapscallion had no Backstab multiplier mentioned in his Record page, whereas the Stalker did.

So, my question: Is this a hardcoded limitation? Am I talking to a wall here, or is there actually some way to do it? Thanks.
« Last Edit: December 16, 2007, 11:32:38 AM by SixOfSpades »

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: Six's general problems & questions thread
« Reply #24 on: December 18, 2007, 01:01:00 AM »
Okay, maybe somebody will know the answer to this one. I'm poking & prodding at 2 of the opcodes listed in DLTCEP:
Set AI Script [82]
(Retreat From) [110]
According to the description, Retreat From is bugged/unknown/does nothing. I messed around with it, and predictably, couldn't get it to do jack. So I looked to Set AI Script to serve as a substitute (as well as do other stuff), but I do have one worry: Supposing that I do manage to get the opcode to work, and succeed in yanking a creature out of its regular AI script & into a script that I designate, can I get them back? I don't want to create a nifty effect's that so dang nifty it can be used to make a smart enemy stupid, or even potentially break the game. I'm hoping that I can simply set Set AI Script to be of a short duration, after which the targets snap back to normal, but I thought I'd run it by you folks first. Does anyone out there have any experience with this? Thanks.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: