temnix Posted October 8, 2019 Share Posted October 8, 2019 The ADD_CRE_ITEM function only allows one flag in the end. A couple are combination, but what I need is an item that is both unstealable and stolen. I'm going to rewrite the string for "I don't accept fenced goods" to refer more generally to black market, illegal stuff. In the case of this item the party will have to kill the NPC to get it, and then the item is to be marked as impossible to sell to anyone but a dealer. So I need both of those flags. Possible? Quote Link to comment
subtledoctor Posted October 9, 2019 Share Posted October 9, 2019 WRITE_BYTE 0x18 (THIS BOR 0b00000001) WRITE_BYTE 0x19 (THIS BOR 0b00000100) Quote Link to comment
temnix Posted October 13, 2019 Author Share Posted October 13, 2019 And what would be the offset here, hmm? I could patch creatures with this, but that's different from adding items - that function puts items wherever. For patching the offset would be different for every creature, depending on file size, number of items, effects, spells etc. But it's all right, I don't need this any more. This item is a shield and equipped, so it's unstealable as it is. Quote Link to comment
subtledoctor Posted October 14, 2019 Share Posted October 14, 2019 To clarify for anyone reading this later, those WRITE commands are for including in a separate instance of COPY ~item~ ~override~. Those offsets ate in the .itm file itself; they are independent of which creature possesses or sells them. Quote Link to comment
temnix Posted October 14, 2019 Author Share Posted October 14, 2019 (edited) This is not a place for irrelevant explanations to the general public. It's my question, and if you don't know the answer, don't say anything. Especially if it's nonsense. The STOLEN and UNSTEALABLE flags are not in ITM files, they are in CRE files. Edited October 14, 2019 by temnix Quote Link to comment
subtledoctor Posted October 14, 2019 Share Posted October 14, 2019 (edited) I mean, I just derived the “unsellable” and “stolen” from the .ITM file format in the IESDP. Pray tell what is the source of your assertion that those flags “are not in ITM files?” Edited October 14, 2019 by subtledoctor Quote Link to comment
Endurium Posted October 15, 2019 Share Posted October 15, 2019 He's referring to Item Instance structures that can be in creatures (inventory items) and area containers, which in turn refer to master Item resources via their resref fields. They have their own flags: Cre Item Flags copy pasta: Flags bit 0: Identified bit 1: Unstealable bit 2: Stolen bit 3: Undroppable So only one write per item instance, with bits 1 and 2 being set. Quote Link to comment
temnix Posted October 15, 2019 Author Share Posted October 15, 2019 No, it's possible to set two flags in a CRE's item - by hand. The problem is that Weidu doesn't accept more than one when adding or replacing an item. It may be possible for an advanced coder to GLOB scan creatures, pick up their equipment by name or slot, fetch the offsets dynamically, because they are going to be different for every file, and then set both flags, but I am not such a coder. Quote Link to comment
subtledoctor Posted October 15, 2019 Share Posted October 15, 2019 (edited) Huh. If it's a custom item and only appears in that one place, I don't see why not to simply patch the item itself. But glancing at the Weidu source, I see there is in fact a "ADD_CRE_ITEM_FLAGS" function. Might work something like this: COPY_EXISTING ~creature.cre~ ~override~ LPF ADD_CRE_ITEM_FLAGS STR_VAR item_to_change = ~your_item~ flags = ~STOLENUNSTEALABLE~ END EDIT - huh, it's in the documentation and everything. Amazing what you can figure out, when you actually try to figure out what you need to figure out. Edited October 15, 2019 by subtledoctor Quote Link to comment
kjeron Posted October 15, 2019 Share Posted October 15, 2019 The ADD_CRE_ITEM patch doesn't support any flag combination that contains both "stolen" and "unstealable", making it necessary to run ADD_CRE_ITEM, then ADD_CRE_ITEM_FLAGS, an extra step which isn't necessary for other flag combinations. I'd say an oversight on weidu's part. Quote Link to comment
Ardanis Posted October 16, 2019 Share Posted October 16, 2019 (edited) https://weidu.org/~thebigg/README-WeiDU.html#hevea_default461 (OH FUCK WYSIWYG SHITWARE) Quote ADD_CRE_ITEM itmName charge1 charge2 charge3 flags slot [ EQUIP ] [ TWOHANDED ] [ NOMOVE ] Add the item itmName to the current CRE file, with the number of charges determined by charge1, charge2 and charge3, respectively. Each charge should be an integer, either in the form of #integer or ( value ). The argument flags must be a string consisting of one of none, identified, unstealable, stolen, undroppable, identified&stolen, identified&unstealable, identified&undroppable, unstealable&undroppable, stolen&undroppable, identified&stolen&undroppable, identified&unstealable&undroppable. Edited October 16, 2019 by Ardanis Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.