I seem to be running into an issue with hooking limits with hook.Add(..) on the event 'RenderScreenspaceEffects'. I have a few drugs written using parts of DurgzMod, all of which work fine. I coded another today, same style as the rest, and the new one refuses to work fully. Every part of the code works except the 'RenderScreenspaceEffects' hook, which never fires.
However, if I remove every other hook to 'RenderScreenspaceEffects', and only leave the new one, it works fine. Leading me to believe that events have a hook limit.
Anyone know whats up with this or had a similar issue?
I have issues with other hooks sometimes as well, such as 'KeyPress' has given this problem before when hooking it more then 3 times, which lead me to have to use a single hook for all purposes of it.
[i]Edit: On a side note, with all hooks in-place I have checked the return value, which is nil on the newest hook to 'RenderScreenspaceEffects' which as the Wiki states is fine, so in theory it should be getting called, but it's not.[/i]
NEVER return without a condition in a hook. What I mean by this is don't do something like:
[lua]
hook.Add( "Hook", "CustomName", function( args )
-- Do some shit
return -- BAD BAD BAD. This will break most hooks to this hook.
end )
[/lua]
If your RenderScreenSpaceEffects hook has a return in it somewhere, remove it, unless it's in a conditional statement. The "returns nil" on the wiki means that if you call the function GM:RenderScreenSpaceEffects() it won't return anything.
[QUOTE=Chief Tiger;21849082]NEVER return without a condition in a hook. What I mean by this is don't do something like:
[lua]
hook.Add( "Hook", "CustomName", function( args )
-- Do some shit
return -- BAD BAD BAD. This will break most hooks to this hook.
end )
[/lua]
If your RenderScreenSpaceEffects hook has a return in it somewhere, remove it, unless it's in a conditional statement. The "returns nil" on the wiki means that if you call the function GM:RenderScreenSpaceEffects() it won't return anything.[/QUOTE]
Ah had a lose return in one of the other hooks, totally overlooked it. Working fine now, thanks. :)
Sorry, you need to Log In to post a reply to this thread.