Results 1 to 6 of 6

Thread: Tailsman

  1. #1
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,198

    Default Tailsman

    I have been getting a debug log about a null pointer in a single use request for a very long time. It finally bothered me enough to look at. I am 99.44% sure it is the creation of the Talisman from gaudy keys that is the cause.

    I added a line to log when items had to be created one at a time.

    Log snippet.

    Code:
    Creating snakehead charrrm (1 of 2)...
    
    Use 1 gaudy key
    You acquire an item: snakehead charrrm
    
    Use 1 gaudy key
    You acquire an item: snakehead charrrm
    
    Use 1 snakehead charrrm + 1 snakehead charrrm
    You acquire an item: Talisman o' Namsilat
    Unexpected error, debug log printed.
    
    Use 1 gaudy key
    Creating snakehead charrrm (2 of 2)...
    
    Use 1 gaudy key
    I don't know how creation was invoked (because I haven't dissected the automation) but I'm pretty sure it triggered mafia's creation logic for a Tailsman rather than explicitly using keys then charrrms.

    I'm not quite following the "make" logic yet so I don't know whether the concoction needs to be changed, whether the make implementation is not quite right when it needs two single uses to create one thing or whether there is special handling for the Talisman that needs to be reconsidered.

    Anyone have any pointers for me?

    I seem to recall that Talisman creation is a long standing hiccup so if this is a known problem that no one wants to fix because doing so is not simple, just remind me.

    Thanks.
    Attached Files
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,198

    Default

    Managed to catch part of this in the debugger.

    I think what happens is

    script gets two gaudy keys
    script executes make talisman o namsilat
    make gets recipe
    make uses gaudy key to get charrrm
    make uses gaudy key to get charrrm
    ResultProcessor sees two charrms and autocreates talisman
    make tries to continue the recipe by using charrms but they aren't there anymore, hence null pointer.

    If I were the sole arbitrator of what is good for KoLmafia I would just disable the autocreate. But I'm not and there is probably a script out there that relies on the behavior that I would rather not break.

    The silence suggests I am the only one who cares about the NPE so in the absence of commentary I can just leave this alone...

    ;-)
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  3. #3
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    830

    Default

    There was a time long ago where I had an AfterAdventurte script that would auto use gaudy keys and create a talisman. And it caused problems, very much like you describe.
    I took this out of my script and now let Mafia do it for me, and I have had no issues since.

    So I guess the lesson here is to not make talismans in scripts.

  4. #4
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    865

    Default

    My experience was that using create() would give the NPE but changing my script to "use 2 gaudy key" worked fine. Which aligns with frono's analysis.

  5. #5
    Senior Member
    Join Date
    Oct 2014
    Posts
    174

    Default

    I turned off the autocreate because this gave me many issues. I still do that to this day although I don't know if I still have to.

    I still need to.

    Code:
    You acquire an item: McClusky file (page 5)
    Verifying ingredients for McClusky file (complete) (1)...
    Creating McClusky file (complete) (1)...
    You are currently in a choice.
    Last edited by cheesecookie; 02-14-2018 at 11:37 PM. Reason: Update, not terribly important.

  6. #6
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,198

    Default

    I am thinking this is an unintended feature of having autoCreate TRUE and then a user or script explicitly tries to make an item that would be autocreated. It is an intellectual concern because it is a mafia flaw if there is something a user can do to break mafia. If autoCreate is eliminated as an option then scripts will break. Which scripts break will depend upon the change unconditionally autocreates or never does so.

    A robust script will check the value of autoCreate and then pick the make target accordingly. But that requires a script writer to hard code recipe knowledge and which items can be autocreated.

    I'm thinking the reasonable solution is to intercept the various places a script can make an item. If the item can be autocreated and the flag is true, clear autoCreate, make the item and then restore autoCreate. An extension would be a proxy field or a function that says whether the creation of the item is effected by the autoCreate flag or not.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •