Beginner Question on Functions
Okay, so I am fairly new to working in LUA and definitely in programming with Fantasy Grounds. I want to make a simple change to a function within the CoreRPG ruleset function addEffect. The original funtion:
Code:
function addEffect(sUser, sIdentity, nodeCT, rNewEffect, bShowMsg)
...
end
does its thing. I want to make effects placed to be GM only. I realize you can do this from within FGC, but I want to do it just to learn. From what I understand, the code I wish to add would look like:
Code:
rNewEffect.nGMOnly = 1;
This seems to do what I want, but I am modifying the CoreRPG ruleset directly, which I don't want to do.
SO, the question is, how to I hijack this function to add my own code? Is there a tutorial about doing this?
I would really appreciate a point in the right direction, thanks!