General > Developers Corner
Help build a game mode!
Megiddo:
Hah, I'm also horrible with names. After all, ULX as a name was a rip-off from AMX/AMXX...
LuaTenshi:
I have added yet another update, now there is a place for us to start building the Garry's-mod game modification that is called...
The Unity Within
Yep, I went with that name, I hope you all like it.
-----------
My friend was to lazy to create an account so I asked him if it was OK if I put what he said as a quote...
--- Quote from: Teh Engineer ---I like the name GaP better, it just fits better then then the one you have now.
--- End quote ---
LuaTenshi:
This is my script for the damage effects, I do not understand hooks at all, and hook.call has no explanation on the Gmod wiki.
--- Code: ---function GM:EntityTakeDamage( ent )
if ent:IsPlayer() then
Hp = ent:Health()
if(Hp <= 41) then
Mult = (200 - Hp - 159)
hook.Call( "RenderScreenspaceEffects", RenderEFunc, Hp, Mult )
end
end
end
--- End code ---
---
--- Code: ---local function RenderEFunc(Hp, Mult)
local tab = {}
tab[ "$pp_colour_addr" ] = 5 * Mult
tab[ "$pp_colour_addg" ] = 0
tab[ "$pp_colour_addb" ] = 0
tab[ "$pp_colour_brightness" ] = 0
tab[ "$pp_colour_contrast" ] = 1
tab[ "$pp_colour_colour" ] = 1
tab[ "$pp_colour_mulr" ] = Hp * 2
tab[ "$pp_colour_mulg" ] = 1
tab[ "$pp_colour_mulb" ] = 1
DrawColorModify( tab )
DrawMotionBlur( 0.5, 0.5, 0.1)
DrawBloom( 1, Hp/100, 3, 9, 9, 1, 255, 0, 0 )
end
hook.Add( "RenderScreenspaceEffects", "RenderEFunc", RenderEFunc )
--- End code ---
Megiddo:
You don't need to use hook.Call for this, you only need to register the hook. (using hook.Register)
LuaTenshi:
--- Quote from: Megiddo on August 06, 2011, 10:53:31 PM ---You don't need to use hook.Call for this, you only need to register the hook. (using hook.Register)
--- End quote ---
How would I use that? Its not even on the Gmod Wiki...
Are you telling me to use it the same way that I am using hook.Call?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version