Jump to content

Trouble with custom items


tibicina

Recommended Posts

This topic may properly belong in the DLTCEP forum, but if I can solve my problem through another method, I'm willing to change methods. I'm having a bug appear in my custom tomes.



I've been working on developing a custom tome. Everything is going well, except for one glitch. I want the tome to remain in the player's quickslot after having been used, so I used DLTCEP to flag the item to not vanish after use. The problem is that somehow, when a player takes them out of the quick slot and puts them back in the quick slot, the game treats the expended item as a stack of tomes, making it possible to reuse. I see two options: (a) how do I disable the tome after use and prevent the stacking problem or (b) morph the tome after use into another, unusable book. I can make unusable books that look the same as the tomes. (How, for example, when shields shatter, do they morph into the shattered shield object).



EDIT: Sometimes I'm so focused on complicated solutions that I forget the simple ones... When you click the tome, it generates a letter, an unusable book that looks the same, and destroys itself... Duh!!


Link to comment

No matter what you might have heard or understood, I swear this on my life, the wall before you did not answer, it just crumpled down to that very pile of bricks before and underneath you, when your head hit it. Though, whose to say that was not it's intention.

 

Yeah, the break into item is the easiest way to go about this.

Link to comment

Nice quote, Jarno... It fits my question very well... :)

 

I'm still trying to figure out how wands can be used up, stay in the inventory, and NOT be re-useable through the "stacking" glitch I discovered. Is it because they're flagged as rechargeable?

 

Is it possible to patch all of this stuff through using weidu? I get frustrated with the GUI that DLTCEP uses when I'd like to do something that DLTCEP doesn't...

 

Just thinking aloud, so to speak...

Link to comment

Is it possible to patch all of this stuff through using weidu? I get frustrated with the GUI that DLTCEP uses when I'd like to do something that DLTCEP doesn't...

In principle, everything you can do in DLTCEP you can do with Weidu.exe, although it won't be easy either, as you have to code everything, or copy-paste from other mods and know how they do it.
Link to comment

You probably have to set 'when charges run out' to 'disabled'. And make sure the 'Stack' field is 0 or 1 in General Properties. If you can't fix this in DLTCEP, you won't be able to do it in WeiDU either. But, I have never experienced the stacking problem you mentioned, either.

Link to comment

So something like this does it for all "wand" items. Now that might get a little overzealous but...

BACKUP ~Wand_fix/backup~
AUTHOR ~Jarno Mikkola, The Imp.~
VERSION ~v0.99~

  COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN		// protects against invalid files
    READ_SHORT 0x1c ~itm_type~
    READ_LONG  0x38 ~stack_amount~
    PATCH_IF (~itm_type~ = 0x23 ) THEN BEGIN            // the 23 is wands
      WRITE_LONG ~stack_amount~ = 1
      READ_LONG  0x64 "abil_off"
      READ_SHORT 0x68 "abil_num"
        SET ~loops~ = 0
        WHILE (~loops~ < ~abil_num~) BEGIN
          READ_SHORT (abil_off + 0x22 + (0x38 * loops)) ~charges~
          READ_SHORT (abil_off + 0x24 + (0x38 * loops)) ~wanish~
          PATCH_IF ~"%charges%" > 0~ BEGIN
            PATCH_IF ~"%wanish%" = 1 OR "%wanish%" = 2~ BEGIN
            WRITE_SHORT ~wanish~ ~0~
            END
          END
        END
      END
  END
BUT_ONLY

... and there might be a few typos. And I am not sure there's enough or too many END's. Ah well, who cares.

Link to comment

Archived

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

×
×
  • Create New...