Ok, after some tests, i've got a matter to be solved :
By hooking, it supposes that the original function is called before or after the moded code.
- Code: Select all
local OldModFunction = ModFunction
function ModFunction()
OldModFunctions()
-- my added code
end
or
- Code: Select all
local OldModFunction = ModFunction
function ModFunction()
-- my added code
OldModFunctions()
end
or
- Code: Select all
local OldModFunction = ModFunction
function ModFunction()
-- my added code
OldModFunctions()
-- my added code
end
This add a constraint if some of my code need to be called
into the original function.
So if i want to solve this matter i'm seeing 2 solutions :
1. I try to solve this by architectural modification on my mod in order to make my code called before or after the original code.
2. If it can't be possible, i need to do some destructive hooking by modifying the function.
- Code: Select all
function ModFunction()
-- modifiying and adding my code
end
With Destructive Hooking, if i understand well, i may need to make
2 versions of my mod (if FAF changed the original FA modded file) : FA friendly and FAF friendly. Destructive Hooking will modify FA and FAF different files.
Am i wrong ? thanks for your help.