Jump to content

Converting a .spl to an .itm


NiGHTMARE

Recommended Posts

So yeah, I decided it would be cool if the new wands I'm making took into account changes to the regular spells made by other mods. The following code appears to work, in that I can't spot any defects in the resulting item in Near Infinity, and there are no unused bytes. However, DLTCEP absolutely refuses to load it, and I'm wondering if anyone has any idea why.

 

COPY_EXISTING ~spwi523.spl~ ~override/nmwand05.itm~ // Wand of Sunfire
 DELETE_BYTES 0x00 0x60
 INSERT_BYTES 0x00 0x60
 SAY NAME1 #6658
 SAY NAME2 @42025
 SAY UNIDENTIFIED_DESC #16261
 SAY IDENTIFIED_DESC @42026
 WRITE_ASCII 0x00 ITM 	 // Signature
 WRITE_ASCII 0x04 V1 	 // Version
 WRITE_BYTE  0x18 0b01101100  // Flags #1
 WRITE_SHORT 0x1c 35 	 // Category
 WRITE_BYTE  0x1e 0b10000000  // Unusable #1A
 WRITE_BYTE  0x1f 0b01011110  // Unusable #1B
 WRITE_BYTE  0x20 0b01110010  // Unusable #1C
 WRITE_BYTE  0x21 0b01000000  // Unusable #1D
 WRITE_SHORT 0x2a 9 	 // Minimum intelligence
 WRITE_SHORT 0x34 8000 	 // Price
 WRITE_SHORT 0x38 1 	 // Max in stock
 WRITE_ASCII 0x3a NMIWND05  // Inventory icon
 WRITE_SHORT 0x42 40 	 // Lore to identify
 WRITE_ASCII 0x44 GWAND01  // Ground icon
 WRITE_SHORT 0x4c 1 	 // Weight
 WRITE_ASCII 0x58 CWAND04  // Description icon
 READ_SHORT  0x64 "abil_off"
 READ_SHORT  0x68 "abil_num"
 READ_SHORT  0x68 "abil_num2"
 READ_SHORT  0x6a "effect_off"
 WRITE_SHORT 0x68 1
 WRITE_SHORT 0x6a ("%effect_off%" - (("%abil_num%" -1) * 0x28) + 0x10)
 WHILE ("%abil_num%" > 1) BEGIN
   SET "abil_num" = ("%abil_num%" - 1)
   DELETE_BYTES ("%abil_off%" +        ("%abil_num%" * 0x28)) 0x28
 END
 WRITE_SHORT ("%abil_off%"       ) 3  // Type
 WRITE_SHORT ("%abil_off%" + 0x01) 1  // Identify to use
 WRITE_SHORT ("%abil_off%" + 0x02) 3  // Ability Icon location
 WRITE_ASCII ("%abil_off%" + 0x04) NMIWND05	// Icon
 WRITE_SHORT ("%abil_off%" + 0x10) 0  // Launcher Required
 WRITE_SHORT ("%abil_off%" + 0x12) 0  // Speed
 WRITE_SHORT ("%abil_off%" + 0x22) 5  // Number of charges
 INSERT_BYTES ("%abil_off%" + 0x24) 0x04
 WRITE_SHORT ("%abil_off%" + 0x24) 1  // When drained
 WRITE_SHORT ("%abil_off%" + 0x27) 0  // Item recharges?
 INSERT_BYTES ("%abil_off%" + 0x2c) 0x0c
 WRITE_SHORT ("%abil_off%" + 0x2c) 34	// Animation: Overhand swing
 WRITE_SHORT ("%abil_off%" + 0x2e) 33	// Animation: Backhand swing
 WRITE_SHORT ("%abil_off%" + 0x30) 33	// Animation: Thrust
 READ_SHORT  ("%abil_off%" + 0x1e) "effect_num"
 READ_SHORT  0x6a "effect_off"
 DELETE_BYTES ("%effect_off%" + ("%effect_num%" * 0x030)) (("%abil_num2%" -1) * ("%effect_num%" * 0x030))

Link to comment
Guest The Bigg unlogged

All WeiDU hacks in existance (including mine) have a bug whereby they use the 'effect index' field, which NI and the game doesn't consider (EG, you can load c2blun02.itm in the game and in NI, but it'll crash DLTCEP and WeiDU scanning).

 

I'd try to investigate than - count the effects and see wether they match with the indexing or not. ax1h10.itm has a similar bug - due to wrong index field, WeiDU and DLTCEP fail to consider the last effect.

Link to comment
All WeiDU hacks in existance (including mine) have a bug whereby they use the 'effect index' field, which NI and the game doesn't consider (EG, you can load c2blun02.itm in the game and in NI, but it'll crash DLTCEP and WeiDU scanning).

 

I'd try to investigate than - count the effects and see wether they match with the indexing or not. ax1h10.itm has a similar bug - due to wrong index field, WeiDU and DLTCEP fail to consider the last effect.

Will it crash dltcep or dltcep just reports an error.

I think i specifically made dltcep to cope with the original ax1h10.itm bug and fix it on the fly.

Link to comment

Archived

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

×
×
  • Create New...