Jump to content

List from Weidu?


Rabain

Recommended Posts

Guest Nythrun@work

The slots listing is a sequence of shorts (two bytes) rather than bytes.

 

  READ_LONG 0x2b8 so //slots offset
 READ_LONG 0x2bc io //items offset
 SPRINT ~weaponlist~ ~~
 PATCH_FOR_EACH "slot" IN 0x9 0xa 0xb 0xc BEGIN
READ_SHORT ("so" + ("slot" * 0x2)) "empty"
PATCH_IF ("empty" != 0xffff) THEN BEGIN
  READ_ASCII ("io" + ("empty" * 0x14)) ~item~
  SPRINT ~weaponlist~ ~%weaponlist% %item%~
END
 END

 

or some such ;)

Link to comment

Workin' perfectly for everything but kits (which somehow need to be rebuilt into big endin and base 16 -- see my other post. Don't really need the kit values anyways, as stock creatures in Tutu/BG1 don't have them, only NPCs.). Great stuff, and very, very useful.

Link to comment

Yeah I was trying to figure out how to translate big endian to hex with WeiDU too so I ended up just coding an ugly hack for it. I'll post the code in a bit once I'm happy with tweaking it (though I guess we were duplicating efforts - where is your other post? ;)). You may want the kit values for BG1/Tutu mages at least (it has their "schools").

Link to comment

Kit values in kit.ids are just the upper word of the dword in the .cre file - you needn't flop the bit ordering or anything peculiar like that.

  READ_LONG 0x244  "kit_value_from_cre"
 PATCH_IF ("kit_value_from_cre" = 0x4000) THEN BEGIN
SPRINT ~kitname~ ~BARBARIAN~
 END ELSE PATCH_IF ("kit_value_from_cre" = 0x8000) THEN BEGIN
SPRINT ~kitname~ ~WILDMAGE~
 END ELSE PATCH_IF ("kit_value_from_cre" = 0x0) THEN BEGIN
SPRINT ~kitname~ ~None~
 END ELSE BEGIN
SET "kit_value_from_cre" /= 0x10000
LOOKUP_IDS_SYMBOL_OF_INT ~kitname~ ~kit~  "kit_value_from_cre"
 END

Link to comment

The code is cool, but the "upper word of the dword" bit I am unclear on. And /= 0x10000 I also don't quite get. I mean, think I understand SET "final_value" = ("value1" + "value2") * 10 ...

 

Shamelessly stolen and rebuilt from all you people, as a learning exercise:

BACKUP ~crelist/backup~
AUTHOR ~null~

BEGIN ~crelist~
NO_LOG_RECORD
COPY_EXISTING_REGEXP GLOB ~^[_XP].+\.cre$~ ~../crelist/null~
READ_STRREF 0x8 name
READ_LONG 0x1c gold
READ_ASCII 0x0250 CSC
READ_ASCII 0x0258 CSR
READ_ASCII 0x0260 CSG
READ_ASCII 0x0268 CSD
READ_BYTE 0x237 sex
LOOKUP_IDS_SYMBOL_OF_INT sex ~gender~ %sex%
READ_SHORT 0x28 anim
LOOKUP_IDS_SYMBOL_OF_INT anim ~animate~ %anim%
READ_ASCII 0x34 smpt
READ_LONG 0x244  "kit_value_from_cre"
 PATCH_IF ("kit_value_from_cre" = 0x4000) THEN BEGIN
   SPRINT ~kitname~ ~BARBARIAN~
 END ELSE PATCH_IF ("kit_value_from_cre" = 0x8000) THEN BEGIN
   SPRINT ~kitname~ ~WILDMAGE~
 END ELSE PATCH_IF ("kit_value_from_cre" = 0x0) THEN BEGIN
   SPRINT ~kitname~ ~None~
 END ELSE BEGIN
   SET "kit_value_from_cre" /= 0x10000
   LOOKUP_IDS_SYMBOL_OF_INT ~kitname~ ~kit~  "kit_value_from_cre"
 END
READ_BYTE 0x270 ea
LOOKUP_IDS_SYMBOL_OF_INT ea ~ea~ %ea%
READ_BYTE 0x271 gen
LOOKUP_IDS_SYMBOL_OF_INT gen ~gender~ %gen%
READ_BYTE 0x272 rac
LOOKUP_IDS_SYMBOL_OF_INT rac ~race~ %rac%
READ_BYTE 0x273 cls
LOOKUP_IDS_SYMBOL_OF_INT cls ~class~ %cls%
READ_BYTE 0x275 gnd
LOOKUP_IDS_SYMBOL_OF_INT gnd ~gender~ %gnd%
READ_BYTE 0x27b aln
LOOKUP_IDS_SYMBOL_OF_INT aln ~alignmen~ %aln%
READ_ASCII 0x2cc dlg
READ_ASCII 0x0280 dv
PATCH_PRINT ~File: %SOURCE_RES% Name: %name% 
S: %sex% G: %gnd% | %gen% R: %rac%
ANIM: %anim% Class: %cls% Kit: %kit_value_from_cre% Alignment: %aln%
Enemy/Ally: %ea% SmPortrait: %smpt% DLG: %dlg%
BCS Class: %CSC% BCS Race: %CSR% BCS General: %CSG% BCS Override: %CSD%
DV: %dv%~
READ_LONG 0x02bc ilo
READ_LONG 0x02c0 ilc
 SPRINT ~itemlist~ ~~
 FOR (i1 = 0x0; i1 < (ilc * 0x14); i1 += 0x14) BEGIN
   READ_ASCII (ilo + i1) item
   SPRINT ~itemlist~ ~%itemlist% %item%~
 END
 PATCH_PRINT ~%itemlist%~
BUT_ONLY_IF_IT_CHANGES

gives me entries like

File: _RAHVIN Name: Rahvin 
S: MALE G: MALE | MALE R: HUMAN
ANIM: FIGHTER_MALE_HUMAN Class: FIGHTER Kit: 0 Alignment: CHAOTIC_NEUTRAL
Enemy/Ally: ENEMY SmPortrait: None DLG: _RAHVIN
BCS Class: _SHOUT BCS Race: _WTARSGT BCS General: None BCS Override: None
DV: rahvin

_AROW11 _BOW03 _AROW02 RNDTRE05 _PLAT01 _AROW04 _BOW01 _AROW01 _AROW06 _AROW10 _SW1H01 _RING06

File: _XZAR2 Name: Xzar 
S: MALE G: MALE | MALE R: HUMAN
ANIM: MAGE_MALE_HUMAN Class: MAGE Kit: 4096 Alignment: CHAOTIC_EVIL
Enemy/Ally: NEUTRAL SmPortrait: _ZARS DLG: _XZAR
BCS Class: _SHOUT BCS Race: _MAGE5 BCS General: _TASIGHT BCS Override: _DPLAYER
DV: xzar

_DAGG01 _POTN08 _SCRL82 _SCRL84


File: X#WINSKI Name: Winski Perorate 
S: MALE G: MALE | MALE R: HUMAN
ANIM: MAGE_MALE_HUMAN Class: MAGE Kit: 128 Alignment: LAWFUL_EVIL
Enemy/Ally: NEUTRAL SmPortrait: winskis DLG: X#WINSKI
BCS Class: None BCS Race: None BCS General: None BCS Override: X#DYQWIN
DV: X#WINSKI

_STAF01 _DART01 _POTN08 _POTN08 _SCRL1G _SCRL1Q _MAGE04 _MAGE05 _CLCK11 _RING08

Link to comment

I think she means you drop the last four bytes of the eight-byte value (I think this is what /= 0x10000 does) and look that up in kit.ids. But if there are values in those last four bytes, you have to assign those manually. There's at least one more exception - for some odd reason in Tutu (at least on my copy) if you assign Imoen to swashbuckler, the kit value is 0x10. And there's a bunch of other values that don't even show up in kit.ids. My code just assigned them all manually but Nythrun's is of course cooler and more concise.

 

Edit: Is it just me or is the forum server really freaking slow today?

Link to comment

Yup, that's it. Sorry if the babble-surpression filters are making my posts too difficult to read.

 

SET var /= 0x10000 is the same as

 

SET var = (var / 0x10000)

 

Sounds like Tutu is pulling its values from an uncorrected kit.ids. The kit field in a .cre is a dword (four bytes) and the engine reads it fine, but Kit() and associated scripting actions only read two of those bytes, so the file needs rebuilding if kit related scripting triggers are going to work (and Barbarians and Wildmages can't be detected by Kit() alone). Bioware changed the kit values for a couple creatures in ToB instead of changing the trigger or kit.ids, so we're kind of stuck with imperfect behavior here.

Link to comment

hmmm... the kit.ids currently in use is EasyTutu after several standard mods, including DRv5, which should patch that kit.ids, if I'm not mistaken...

it is a throwaway install, so I can try running the thing through the section of kit.ids corrections pulled from your l1npcs, and see what happens.

 

Edit/ nope, no luck. The ids is either corrected, or I did something wrong - I grabbed the code and set it up, but came up with identical results. kit.ids =

IDS
0x00004000 TRUECLASS
0x00004001 BERSERKER      
0x00004002 WIZARDSLAYER        
0x00004003 KENSAI        
0x00004004 CAVALIER      
0x00004005 INQUISITOR    
0x00004006 UNDEADHUNTER        
0x00000040 MAGESCHOOL_ABJURER      
0x00000080 MAGESCHOOL_CONJURER      
0x00000100 MAGESCHOOL_DIVINER      
0x00000200 MAGESCHOOL_ENCHANTER    
0x00000400 MAGESCHOOL_ILLUSIONIST  
0x00000800 MAGESCHOOL_INVOKER      
0x00001000 MAGESCHOOL_NECROMANCER  
0x00002000 MAGESCHOOL_TRANSMUTER    
0x00004000 MAGESCHOOL_GENERALIST    
0x00004007 ARCHER        
0x00004008 STALKER        
0x00004009 BEASTMASTER    
0x400A ASSASIN        
0x400B BOUNTYHUNTER        
0x400C SWASHBUCKLER        
0x400D BLADE    
0x400E JESTER        
0x400F SKALD    
0x00004013 GODTALOS      
0x00004014 GODHELM        
0x00004015 GODLATHANDER        
0x00004010 TOTEMIC        
0x00004011 SHAPESHIFTER        
0x00004012 AVENGER
0x4020 A!ACROBAT
0x4021 A!CHORISTER
0x4022 A!DIRGESINGER
0x4023 A!GYPSY
0x4024 IK!ADVENTURER
0x4025 A!BURGLAR
0x4026 A!SOULKNIFE
0x4027 A!SHARPSHOOTER
0x00000000 BARBARIAN
0x00000000 WILDMAGE
0x4028 CDSelune
0x4029 A#SHAR
0x402a A#TEMP
0x402b CDILMATR
0x402c A#OGMA
0x402d NMSUNE
0x402e A#CYRIC
0x402f NMRNBSLN
0x4030 A#FERALAN
0x4031 NMRNFRRN
0x4032 A#JUSTIFIER
0x4033 NMRNWLRN

Nythrun, it isn't the babble filters, it is the math... I honestly thought that meant

 

"run the equation" "kit_value_from_cre divided by or equal to the number value 0x10000" ;) I am still at the stage that many Visual basic programmers are: "Just do this. It works. I dunno why, but just link these little chains of black boxes that work together, and you should be ok" :D

Link to comment

I was actually suggesting that Tutu might be just assigning 0x00100000 to Imoen when it makes her a swashbucker without having looked up that value anywhere or fixing kit.ids - I dunno how Macready implemented that, and I don't want to badmouth him, so I shush now.

 

Math ;)

 

Programming ;)

 

/edit

 

Grr, blabbed until missing the point again

 

Syntax for LOOKUP_IDS_SYMBOL_OF_INT is ~TextStringThatYouRetrieveFromIds~ ~IdsFile~ "NumberThatYouLookUp" - so you'd want to be PATCH_PRINTING Kit: %kitname% (or however you'd like to call it :D )

Link to comment

eversed it again... to quote a certain omnicient god like voice after sparing Mulahey, ~I *WILL* learn...~

 

There is definitel something hinkey with Imoen, as I Swashed her buckle, (arrr) but Ajantis, Xzar, etc. show up correctly:

 

File: _IMOEN1 Name: Imoen

S: FEMALE G: FEMALE | MALE R: HUMAN

ANIM: THIEF_FEMALE_HUMAN Class: THIEF Kit: WILDMAGE Alignment: NEUTRAL_GOOD

Enemy/Ally: NEUTRAL SmPortrait: _MOENS DLG: _IMOEN2

BCS Class: _INITDLG BCS Race: None BCS General: _TRUNSGT BCS Override: _WTARSGT

DV: imoen

 

_POTN08 _POTN08 _POTN08 _WAND12 _AROW01 _BOW05 _AROW01 _POTN14

 

File: _AJANTI Name: Ajantis

S: MALE G: MALE | MALE R: HUMAN

ANIM: FIGHTER_MALE_HUMAN Class: PALADIN Kit: INQUISITOR Alignment: LAWFUL_GOOD

Enemy/Ally: NEUTRAL SmPortrait: _JANTISS DLG: _AJANTI

BCS Class: _TASIGHT BCS Race: None BCS General: None BCS Override: _DPLAYER

DV: ajantis

 

_SW2H01 _CHAN01 _HELM11 _BELT01 _SW1H04 X#AJSHLD dw#npcl0

Link to comment
I was actually suggesting that Tutu might be just assigning 0x00100000 to Imoen when it makes her a swashbucker without having looked up that value anywhere or fixing kit.ids - I dunno how Macready implemented that, and I don't want to badmouth him, so I shush now.
The EasyTutuNPCKits actually gives her 0x00000010 and that does, somehow, make her a swashbuckler. I looked at the CRE in the mod without even having installed it and that's the case (it overwrites CREs rather than patching). Even though the Skie CRE with the same kit gets 0x400c0000. So... ;) There are some other inconsistencies with Shar-Teel etc. I guess I could report it on PPG but it's probably "expected behaviour" :D

 

@cmorgan - not sure what's up with your code. Can you look at the kit value for Imoen with NI or DLTCEP?

Link to comment

Well, something pretty strange -- I swashbuckled Imoen, but in NI her value is A!SHARPSHOOTER 1048576 from Song & Silence. This may be due to my overwriting kit.ids before running the checker, so I will roll it back and doublecheck, because in the savegame I have she is listed correctly as Swashbuckler.

Link to comment

There are two kit schemes; one that respects the value from the original IDS and 2DA files (or at least the 2DA file), and the one that's used by the engine.

 

Note that Near Infinity has hacks to support both the values from the 2DA file (since the IDS was such a mess) and any corrected IDS file in your install. What value is used determines where NI will look for it.

Link to comment

This version will generate a file called crelist.csv in your override. Most of the code pinched from everyone else in this thread. You should be able to double-click and open the file in whatever spreadsheet application you have associated to CSVs (if you have one, e.g. Excel), and it looks something like this:crelist.gif

I've output spreadsheets for BG1-TotSC, EasyTutu and BG2-Fixpacked (no other mods in any). You can see there are several things off the bat that should be fixed, even with the Fixpack applied (for example Alatelo De Bonito has an invalid kit of 0x4019).

 

The Tutu version only retrieves underscore-prefixed CREs. So this has the drawback of not picking up most modded CREs but that's a one-line change in the TP2. Also, invalid EasyTutuNPCKit values are mapped to proper names followed by a '2'. With another tweak, you can point it to produce a list of CREs from a mod folder instead of the game.

 

You can download the code here (I tried pasting it but it hosed my post). I was thinking of retrieving the weapon Names instead of the ResRefs if that's possible. Might be easier to check proficiencies against them, at least for BG1/Tutu (BG2 would probably need to look up EFFs or something).

Link to comment
I've output spreadsheets for BG1-TotSC, EasyTutu and BG2-Fixpacked (no other mods in any). You can see there are several things off the bat that should be fixed, even with the Fixpack applied (for example Alatelo De Bonito has an invalid kit of 0x4019).

I will get you the BG1V verison of this. I suppose you could then merge it with the TOTSC version or even the tutu version and see how the files differ.

Link to comment

Archived

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

×
×
  • Create New...