Page 1 of 1

Take All Button of Pain and Happiness issue

PostPosted: Mon Oct 26, 2015 2:36 pm
by NexGenration
i hate to necro such an old mod with such an old issue, but i have found no solutions online as to the fact that when i try to use Fliggerty's "Take All Button of Pain and Happiness" mod, it crashes the game whenever i try to press the hotkey (the one that defaults to middle click and is changed by ta_setup). also is it possible to make the same key "dispose corpse" if used on corpses?

Re: Take All Button of Pain and Happiness issue

PostPosted: Sat Dec 26, 2015 7:53 am
by ortorin
Well, I looked into the script and it's easy to see why the mod might crash a lot. Checkout this snip of code from it.

Code: Select all
               setx ownerid to contref->xGetOwner
               ifx ( ownerid )
                       setx owner to xGetRef ownerid
                       xSetRef owner
                       set detect to GetDetected "player"


The function "xGetOwner" has a major flaw in it. Here's the description:

"Returns a 0 if the object is not owned, the objectid of the owner of the item if it is owned by a specific NPC or the string "unknown" if it is owned by a faction or controlled by a variable."

That means there is a great deal of chests in the game that will return the string "unknown" when you try to get the owner of the container. Passing "unknown" into this part of the code "setx owner to xGetRef ownerid" will crash the game because there is no reference for a NPC named "unknown"

So looking at the script and what it says, it is really nothing more than a tech-demo. It is a very hacky way of implementing the idea, and is not stable at all because of the scripting to add to the want level (crime) of the player if you are detected while stealing from an owned chest.

You're better off using a third-party macro program to move the mouse to the take all button than to use this mod. It's simply not stable.

Re: Take All Button of Pain and Happiness issue

PostPosted: Sat Dec 26, 2015 9:25 pm
by sassman
Why couldn't a simple check be made to see id the ownerid is, indeed "unknown", and then skip the rest of the code, since--obviously--the nonexistent "unknown" does NOT own the contents of the container?

Re: Take All Button of Pain and Happiness issue

PostPosted: Thu Dec 31, 2015 2:14 pm
by ortorin
The might work to fix things, but there may still be stability issues with the mod that I didn't identify.

On a brighter note; I just read that the Morrowind Code Patch 2.2 adds the ability to "take all" by pressing the "ready weapon" key, which makes this mod obsolete anyways.