Temple+ Modding Question

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

Remove all ads!
  1. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    This might be a really dumb question, but how do I query for the bonus an armor gives to AC?
    Code:
        wornArmor = attachee.item_worn_at(item_wear_armor)
        acValue = wornArmor.obj_get_int(obj_f_armor_ac_adj)
    and
    Code:
     acValueQuery = attachee.d20_query(Q_Armor_Get_AC_Bonus)
    return a 0 as a value no matter what armor is worn.
     
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Sorry to interrupt, but vis-a-vis the previous 'aid another' discussion, I just wanted to confirm that I tried this with Open Lock - buffed a character with many ranks in Open Lock to see if they gave the rogue party leader an 'aid another' bonus - and they didn't :(
     
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Try the query off of the armor object.

    AFAIK it's specifically coded just for search.
     
  4. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Code:
        wornArmor = attachee.item_worn_at(item_wear_armor)
        acValueQuery = wornArmor.d20_query(Q_Armor_Get_AC_Bonus)
    also returns a 0 on two different armors (scale mail and red chainmail) :(
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Oh right, you'd need a special d20 query for items.
    Why do you need this anyway?
     
  6. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
  8. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Ok thank you Sitra :)

    I've got a question about a couple core spells that are not in the game, but I've started to implement their mass versions from the spell compendium and then would also do their normal core variants.

    At the moment I've done Bless Weapon, Mass and Align Weapon, Mass.
    The Bless Weapon is listet in the constants.py as spell_bless_weapon = 39, but I double checked, I can't find it in the game. Shall I use the spell_enum 039 then for this spell?

    Align Weapon is not listed, shall I use the next free enum in my spell compendium for it then, or is there a list for core spells?
     
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    If you can find the enums in the originals, sure, use them.
    Was Align Weapon present in 3.0 ed? Perhapd it was renamed?
     
  10. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Hmm, that's a fair point. I have to admit, I did skip 3.0 entirly and directly jumped from AD&D to 3.5 so I do not have any sourcebooks from 3.0.
    A quick google search let's me belive that a cleric did not have that spell in 3.0, but could someone verify this?
     
  11. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    @Sitra Achara Can you explain to me, how exactly the radial menu entry action d20a_cast_spell works? I am currently looking into the warlock class and tried a few things. The warlock gets a feat that lets him cast detect magic at will at 2nd level. So here is what I've done:

    I created a feat called "warlock detect magic"
    Code:
    name: Warlock Detect Magic
    flags: 8
    prereqs:
    description:  Beginning at 2nd level, a warlock can use detect magic as the spell at will. His caster level equals his class level.
    prereq descr: Warlock Level 2.
    and then I added a python modifer in the warlock.py:
    Code:
    warlockDetectMagic = PythonModifier("Warlock Detect Magic", 0)
    warlockDetectMagic.MapToFeat("Warlock Detect Magic")
    warlockDetectMagic.AddHook(ET_OnBuildRadialMenuEntry, EK_NONE, warlockDetectMagicRadialMenuEntry, ())
    the radial menu entry looks like:
    Code:
    #Detect Magic as a Spell Like Ability (at will)
    def warlockDetectMagicRadialMenuEntry(attachee, args, evt_obj):
        warlockDetectMagicRadialId = tpdp.RadialMenuEntryAction("Detect Magic (at will)", D20A_CAST_SPELL, 0, "TAG_SPELLS_DETECT_MAGIC")
        spellToLink = tpdp.D20SpellData(spell_detect_magic)
        warlockDetectMagicRadialId.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Class)
        warlockDetectMagicRadialId.set_spell_data(spellToLink)
        return 0
    but this returns a "Invalid action" float in the game when I click on the menu entry(which itself is created without an error).
    I also tried:
    Code:
       
        spellToLink = tpdp.D20SpellData(spell_detect_magic)
        warlockDetectMagicRadialId = tpdp.RadialMenuEntryAction(spellToLink)
        warlockDetectMagicRadialId.add_child_to_standard(attachee, tpdp.RadialMenuStandardNode.Class)
        warlockDetectMagicRadialId.set_spell_data(spellToLink)
        return 0
    
    But this ends up in showing NULL SPELL in the radial menu.
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Hmmm, I think you might want to emulate the Arcane Archer's Imbue Arrow- there I used a python action that pretty much copies the cast spell action. Here you'd do the same except skip debitting anything.

    An alternative is to emulate detect magic via rolling your own condition. But if you think you'll run into more such cases then perhaps it's better to build the infrastructure.

    Last option is to add some sort of 'at will' designation for spells so they don't deduct charges.
    To see how spells are added to radial, see BuildStandardRadialMenu in radialmenu.cpp.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Added.
    upload_2021-4-18_5-57-28.png

    The other valid queries for this are:
    Q_Weapon_Get_Keen_Bonus (I think you needed this?)
    Q_Armor_Get_Max_DEX_Bonus
    Q_Armor_Get_Max_Speed

    I'd have recommended you get the latest dev build to make use of all that, but it's currently broken due to VS update :(
     
    Sagenlicht likes this.
  14. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Thanks alot Sitra :)

    While you are looking at the item_query, I did post this in the google doc yesterday, is it possible to get a an item query that retuns the item_conditions? At the moment it is possible to add the same item condition via item_condition_add_with_args more than once. An example for such vanilla item conditions would be 'Weapon Frost'. Quite a few cleric and paladin spells actually manipulate items and at the moment I have to use a workaround to get those enchantments going because those enchantments are permanent it seems (none of the three arguments they take seem to be the duration) and you could stack them. While I do not necessarily need to use them, if the permanency problem can't be fixed, I at least would need to check if they are already present cause my workaround would stack as well.

    PyObj.conditions_get() only works on critters not on items, on items it returns an empty string.

    Example:
    Code:
    game.leader.item_condition_add_with_args('Weapon Frost', 10, 10, 10) #Using 10,10,10 to test if one is the duration
    leads to a permanent effect on the weapon (so none of the arguments see to be the duration). You actually can see it on weapon itself, it is listed in its description. If you repeat it, it will add a second condition (also visible) and if you attack you can see it actually adds both condition to the damage bonus list.

    No worries about the dev build, I simply add the spells to my list of spells to fix when the next update is live :) (like Sniper's Shot or all spells that use the Swift Action)
     
  15. Endarire

    Endarire Ronald Rynnwrathi

    Joined:
    Jan 7, 2004
    Messages:
    987
    Likes Received:
    122
    Are immediate actions in-game? I ask since they're useful for Sagenlicht's project.
     
Our Host!