I assumed you were talking about Dispatcher events. D20 signals are basically a category of those. S_Spell_Cast is called inside the perform function of D20A_CAST_SPELL (d20.cpp, line 2808). It comes after the spell has been successfully registered and target list compiled, but before the action frame callback and the python begin_spell script. It's sent to caster and spell targets.
Cool! I bet I can make that do the trick. On another note, could you explain the difference between redirectCall and replaceFunction? Thanks!
replaceFunction completely replaces a function. Every call to it is redirected. It is accomplished by writing a jump instruction at the beginning of the function itself. redirectCall replaces a single call to a function. It's useful when you don't want to rewrite an entire function for your changes (e.g. if it has a chain of functions that are not of CDECL calling convention).
OK cool. That was about what my understanding was. Do they work together? For example can I modify a function with redirectCall, then override it with replaceFunction and in my new function call the modified version after or before doing some stuff?
If you're replacing a whole function, why do that? If I understand correctly: Void foo (){ abc... bar() ...def } void bar(){ } void bar_hook(){ } void foo_hook(){ abc... bar_hook() ...def } redirectCall(0x..., bar_hook) replaceFunction(0x...., foo_hook)
What I would like to do is insert some code at the beginning of the TurnUndead method without rewriting the whole thing (it is complex) or messing up the redirectCall() that was already used. I could do that with replaceFunction if doing that won't mess up the redirectCall(). Or is there a better way? Maybe I could stick my code in the redirectCall() function even though it really doesn't belong there...
If you prepend code via calling the original replaced function it won't interefere. I.e. orgTurnundead = replaceFunction(..., [](){ New code... orgTurnundead() } Is fine.
That did indeed work great. Now I see a use for redirectCall(). Is there more decompile data you can send me. The C file does not give me the addresses necessary for using redirectCall on the functions I want to replace. BTW: Do you know if the metamagic value for feat definitions just add them to the wizard bonus list or does it do something more?
You can use a debugger like Ollydbg, or IDA. I can send you my database. I think metamagic is more hardcoded, will have to look for it.
I downloaded OllyDbg. Please send me the database when you get a chance. Metamagic is definitely mostly hardcoded. I was wondering if the feat flag did anything more than add the feat to the wizard bonus list.
Another question quick question: Does D20A_CLASS_ABILITY_SA always refer to wild shape or does something else use it?
After pulling the latest, I am getting lots of the following error: error C2955: 'gsl::span': use of class template requires template argument list (compiling source file movies.cpp) BTW: When you get a chance, please do send me that database file. Thanks!
@DarkStorm made some updates recently, I think to use c++17 features. Maybe the dependencies need to be updated.
Doesn't seem like an issue with the dependencies. Maybe something was committed that wasn't suppose to be committed yet.