Temple+ Modding Question

Discussion in 'General Modification' started by _doug_, Feb 21, 2018.

Remove all ads!
  1. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Hopefully this is the right place to ask this: In a temple+ python modifier script, how do I get the shield ac bonus from a shield object? A call to item.obj_get_int(obj_f_armor_ac_adj) returns 0 and I don't see any constant to pass to get the shield ac value.

    Thanks!
     
  2. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    If it's a worn shield, I think you should be able to get it via Q_Armor_Get_AC_Bonus and d20_query_with_data using the shield's handle as the extra arg.

    upload_2018-2-21_22-52-5.png

    upload_2018-2-21_22-52-25.png

    Otherwise you'll pretty much have to do something icky like in UiItemCreation::MaaInitCrafter and CreateItemFinalize, where you directly access its wielder_condition_array and obj_f_item_pad_wielder_argument_array fields to extract the data. You could create a helper function for it though and expose it to the python layer.
     
    _doug_ likes this.
  3. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Thanks for the quick reply! I'll give it a shot and let you know.
     
  4. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    That did seem to work. Just got distracted on divine vigor and divine armor. A couple more questions:

    Do bucklers get their AC bonus removed after an attack in temple+? I don't see it happening.
    Is there a list of bonus types (the third parameter) for bonus_list.add()?
    What is up with the message about loading at the wrong address that sometimes pops up when running temple+?
    Was there at one time a persistent spell feat?

    Thanks!
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    They should. It checks args(1).
    Do you have the decompilation btw? Should clear up a lot of such questions.
    http://wikisend.com/download/607822/temple3_2018_03_15.7z

    There's a list on the DLL wiki: https://github.com/GrognardsFromHell/DllDocumentation/wiki/Bonus-Types

    Message - which one exactly? Is it the "Module '{}' caused temple.dll to be loaded at a different address than usual"?

    No persistent spell feat. I might have reserved an enum for it or something like that.
     
  6. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Thanks for file!

    What I am seeing is that the AC is not updating after an attack with a two handed weapon using a buckler. Is the penalty added in the background?

    The message is the one you mentioned. I get it 1 in 4 times maybe when I run in debug.

    The link you posted looks like the second argument to the function not the third. Or am I confused?
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Buckler: tested fine when I checked it.
    upload_2018-3-16_6-33-43.png

    You can hook the Buckler AC Bonus to debug it yourself. My guess would be that perhaps the character is considered not to be attacking two handed somehow.

    Message: what module is (are?) mentioned? The thing with ToEE is that sometime the memory image can get rebased by the OS, which causes some of the early DLL hacks to go to hell. Or at least used to, not sure anymore ;) We tried to prevent that by reserving the memory range normally used by ToEE, but evidently sometimes that's not enough. Paging @DarkStorm :)

    Bonus List: Right, that's the second arg, but that arg is called the bonus type ;) The third arg controls what gets printed in the log - it's a line ID pointing to bonus.mes (or its extension file, inside tpmes\bonus.mes).
     
  8. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Thanks for looking into it. I'll try to figure out what's going on on my end.

    I'll send you some info next time I get that message.
     
  9. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Here is the dialog I get.

    DLLIssue.png
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Does it actually produce a crash BTW?
    IIRC the original problem was something with UiPcCreation, which we hooked anyway.
     
  11. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Generally I just kill it and run again. It rarely happens the second time. It will crash on shutdown for sure if you press OK and continue. Not sure if there are other issues or not.
     
  12. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    Yet another question: In the method bonus_list.add_from_feat() what are the 2nd and 3rd parameters. The second seems to be a number associated with the feat but I don't see where I should reserve the number.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Example:
    add_from_feat(bon_val, bon_type_mwm, 114, "Melee Weapon Mastery")

    The last arg is a feat reference. The one before is a bonus.mes line (usually this is line 114 - Feat X).
     
  14. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    290
    Likes Received:
    117
    OK Thanks! How do you figure out what the value of "bon_type_mwm" should be so it does not collide with any other damage type?
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
Our Host!