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!
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. 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.
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!
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.
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?
Buckler: tested fine when I checked it. 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).
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.
Does it actually produce a crash BTW? IIRC the original problem was something with UiPcCreation, which we hooked anyway.
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.
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.
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).
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?
Pick a random integer and notify me so I can update this list: https://github.com/GrognardsFromHell/DllDocumentation/wiki/Bonus-Types