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:
    316
    Likes Received:
    143
    OK Cool. I'll take 857 for improved favored enemy.

    But is there really a need for a new bonus type or could I just go with type 0 which stacks with everything?
     
  2. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Most of the time you can use 0, yes.
     
  3. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Cool. I'll just go with 0 then. I suppose I need to reserve a bonus number in the future if there are stacking concerns?
     
  4. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Yes. I can reserve a range for you, e.g. 100-150.
     
  5. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    OK cool. 100 to 150 (or whatever you think is best) sounds good to me. :)
     
  6. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Done! Let me know if/when you use any.
     
  7. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Next Question: Is there a way to use the TempleFix class replaceFunction method so that the replacing function calls the original version of the function. Something like:

    replaceFunction(0xDEADBEEF, MyFix);

    ....

    int MyFix(DispatcherCallbackArgs args)
    {
    //Do Some Stuff
    CallOriginalVersion()
    //Do some other stuff
    }
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
  9. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Thank You! Somehow I missed that it returns a callable version of the old function. I should be able to do what I wanted now.
     
  10. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Removing those calls in initClass broke my python extenders. For example, extra smiting stopped working.

    However if I make the following change to initFeats things start working again:

    if (_GetCondStructFromFeat(featList, &cond, &arg))
    {
    //_ConditionAddToAttribs_NumArgs2(dispatcher, cond, featList, arg);
    _ConditionAddToAttribs_NumArgs2(dispatcher, conds.GetByName(cond->condName), featList, arg);
    }

    It seems like _GetCondStructFromFeat is returning an incorrect condition. Any thoughts on how I can fix this correctly?

    BTW: Good find on those wrong BAB values. Should the BAB always be checked by the text file even if a python script is used?
     
  11. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Ah, you didn't do a MapToFeat on the extended feat. That's the reason why it's not working. If it doesn't appear in the new Temple+ dictionary (which is what MapToFeat does), then it uses the old hardcoded vanilla mapping. This points to the old, un-extended CondStruct, hence why your python hooks won't work.

    edit: like so
    Code:
    powerAttackExtender.MapToFeat(feat_power_attack)
    Re. BAB, it's the intended way to check it, yes. You could also write a char_editor version of stat_base_get for special handling of stat_attack_bonus (which is more or less what goes on in the feat prereq checker).
     
    Last edited: Apr 18, 2018
  12. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    I understand now. I had tried using MapToFeat() with extended feats but I had not been doing it right. That's why I went with the brute force method.

    I just added a pull request that should fix the issues. Thanks for the help.

    BTW: The DM menu is now opening up when pressing escape.
     
  13. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Is there an event that is triggered any time a spell is cast? I am adding a feat that should do something whenever a spell is cast.
     
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    I don't think there's a global event, but there are various d20 signals being sent that could possibly suit your purpose. What did you have in mind?
     
  15. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Thanks. I was looking for events not signals...

    Could use S_Spell_Cast? Is that called before or after the spell casting logic is done?
     
Our Host!