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
    Added a flag to inherit the value from the base race. I turned it on for all but drow and svirfneblin. At this point I am done for this version unless I run into something else...
     
  2. sirchet

    sirchet Force for Goodness Moderator Supporter

    Joined:
    Dec 6, 2003
    Messages:
    3,721
    Likes Received:
    49
    Lolth does have non-drow followers and some drow don't worship Lolth.
     
  3. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Question about calculating distances: I am using the distance_to() method of the character in an attempt to calculate the distance between the character's current location and where they started the round. When I pass the location and offset of their position at the beginning of the round, I get an answer that is different than the path length the first time the character moves. This makes me think that I am doing something wrong. Do you know how I should calculate that distance?
     
  4. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    I think distance_to is subtracting the character radius.
     
  5. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    It seemed to be off by a small amount (2 feet or s0) regardless of how far the character moved so that would make sense. is there a way to get the character radius? Or should I try adding a second method that calculates path distance?
     
  6. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Yeah, obj.radius ;)
     
  7. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Thanks for the help! I got things working the way I want now.

    Another Question: Is temple+ allowing sneak attack on invisible opponents a bug or does it intentionally not follow the SRD on this? If it is indeed a bug, I can go ahead and change it with what I am working on.
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Isn't that a rules interpretation thing? I want to be careful with that sort of thing. If it's controversial, make it a House Rules option. Also don't forget See Invisibility (I think there's a related query)
     
  9. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Here is what the rules say. The SRD seems straightforward unless I am missing something:

    A rogue cannot sneak attack while striking a creature with concealment or striking the limbs of a creature whose vitals are beyond reach.

    I think I could use the CanSense() method for the check which should take care of the details like See Invisibility.
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Yeah, CanSense is apt.
     
  11. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    I am now trying to add a damage bonus to spells for warmage edge. For weapon like spells this seems to work fine via ET_OnDealingDamageWeaponlikeSpell. However for other spells like fireball and magic missile, I am having difficulty doing this. I was planning to add a new event that would be dispatched in Damage:: DealSpellDamage() but it seems that it does not get called for those spells. The only thing that does seem to get called is DispatcherSystem:: DispatchDamage() but I don't think that is the right place for me to add a new event. Any thoughts on how I could do this?
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Yeah it looks like DealSpellDamage needs to be hooked for it to affect those two spells (and perhaps others).

    Magic Missile currently calls the original DealSpellDamage and Fireball uses ReflexSaveAndDamage, which internally calls DealSpellDamage for spells.

    DealSpellDamage is currently not hooked, just called from the Temple+ re-implementation of the python functions. Hooking it should fix the issue. I'll check that in.
     
  13. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    Thanks! Looks like you've already got the fix in there.
     
  14. _doug_

    _doug_ Established Member

    Joined:
    Jul 9, 2009
    Messages:
    316
    Likes Received:
    143
    I've run into a similar circumstance with CheckSpellResistance() . I want TOEE to always call the method in LegacySpellSystem since I added a change for beguiler. I tried to hook to the function but it is not getting called even though replaceFunction() is returning success. Could this be due to it not using a standard calling convention?
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Yeah, exactly. You need to hook it with a wrapper function that converts the ESI register to the stack. Search for "usercall" in the code for examples.
     
Our Host!