Aller au contenu

Photo

[Help] SetItemDroppable - Where is the code for it? / Making SetItemInfinite


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
Ok I'm trying to make a SetItemInfitine, to do that I'm trying to find
the SetItemDroppable code.

Looking at the data, there is a
SAVEGAME_ITEM_DROPPABLE of UINT8 that is either 1 or 0 (drops or
doesnt).

Now I've tried different SetLocalInt(oItems[nCounts],
"SAVEGAME_ITEM_DROPPABLE", 0); and they don't work.
So if anyone
knows how where I could find the actual code in SetItemDroppable, please
let me know.

Edit: I guess what I'm asking is how do I access
that piece of information via code?

#2
Proleric

Proleric
  • Members
  • 2 363 messages
I'm not quite clear whether you're trying to change a saved game, or write a script?

If the latter, it would be something like
object oItem = GetObjectByTag("put_tag_of_item_here");

if (IsItemDroppable(oItem)) 
  SetItemDroppable(oItem, FALSE);


#3
KigenBarzhad

KigenBarzhad
  • Members
  • 132 messages
I'm trying to figure out the way that the scripting command SetItemDroppable works. Look at the save game, I realize it must edit the SAVEGAME_ITEM_DROPPABLE uint8 of the save game.



How it edits the property, I don't know.

#4
Proleric

Proleric
  • Members
  • 2 363 messages
I'm not sure how knowing this will help you?

SetItemDroppable is an engine function IIRC, which toggles the item property in memory.

We can't see inside the engine, but Save Game might well be an entirely separate event which copies the item properties in memory to a legible file format.

So I wouldn't expect to be able to edit save game variables with a script.

If you open an item in the object inspector, then examine the variables list, you can see all the item variables that scripting can touch. We know this list is complete, because scripting isn't allowed to change a variable unless it's pre-defined in that 2DA table.

#5
Proleric

Proleric
  • Members
  • 2 363 messages
Incidentally, the "infinite" property only applies to merchant inventories. AFAIK there's no way to read or write it by scripting.