[release][b]HEV Extensions[/b]
[tab]Download:[/tab] [url]http://www.garrysmod.org/downloads/?a=view&id=82923[/url]
[/release]
I appreciate many elements of Crysis, and one of them is their HUD, in this first release of HEV Extensions, here, I have built the grenade indicator as seen in this video:
[media]http://www.youtube.com/watch?v=MmQfJl59k0c[/media]
In the future, I may implement the Source SDK functions for HEV sound notifications and so forth, but for now, this is just a small addon for the fun of coding it.
[b]Screen shots:[/b]
[media]http://img.photobucket.com/albums/v308/flaming-gummy-bear/gm_construct0006.jpg[/media]
[media]http://img.photobucket.com/albums/v308/flaming-gummy-bear/gm_construct0009.jpg[/media]
[media]http://img.photobucket.com/albums/v308/flaming-gummy-bear/gm_construct0010.jpg[/media]
[b]New HUD Elements:[/b]
[i]"CHUDProjectileIndicator"[/i] - A projectile and grenade indicator
[b]New CVars:[/b]
[i]r_drawhud <0/1>[/i] - Toggles HEV aspects of the HUD.
ooooo i wanted to "attempt" to make this, it looks cool, nice job!
Add one where we can see weapons too, something like L4D or where it was.
Can you finish one project before starting one ?
But nice Idea !!
Good god, turn your graphics up for pictures! D:
It's decent...
Why is he getting dumbs? This is quite a cool addon.
[QUOTE=Occlusion;18241842]Why is he getting dumbs? This is quite a cool addon.[/QUOTE]
We are on Facepunch, that's why.
Good job.
[QUOTE=R4zzer;18238418]ooooo i wanted to "attempt" to make this, it looks cool, nice job![/QUOTE]
Thanks. :smile: I made it in the middle of the night, I couldn't sleep.
[QUOTE=Python1320;18238566]Add one where we can see weapons too, something like L4D or where it was.[/QUOTE]
Could you give me a screenshot to work off of? I was thinking about weapon indicators over the ammo, showing two icons for your current weapon and your last. If you can give me a reference to look at and joggle my memory, I'll add it in the next release. I haven't played L4D or Crysis in a while. I did this first element off video alone, but it worked out considering that I code everything to be HEV styled.
[QUOTE=lotus006;18238858]Can you finish one project before starting one ?
But nice Idea !![/QUOTE]
I have a really hard time with that, so I make new stuff when I want to relax, I try my best, though.
[QUOTE=LauIsFun;18241827]It's decent...[/QUOTE]
Yeah, I know, it's kinda just a small nifty thing, but definitely not something I was shooting to be awesome. I liked the HUD element, so I created it. Just that simple.
[QUOTE=Occlusion;18241842]Why is he getting dumbs? This is quite a cool addon.[/QUOTE]
Thanks, but yeah, this [i]is[/i] Facepunch. You just have to put up with rude people. It's fine.
And thanks Jamie.
[QUOTE=Occlusion;18241842]Why is he getting dumbs? This is quite a cool addon.[/QUOTE]
It's because he keeps releasing a bunch of shit from his mega pack because nobody ever wanted the whole thing and never would have. Although this is sort of cool.
Also..
[lua]
local function R_DrawHud( name )
if ( r_drawhud:GetBool() ) then return end
// So we can change weapons
if (name == "CHudWeaponSelection") then return true end
if (name == "CHudChat") then return true end
if (name == "CHudGMod") then return true end
return false;
end
hook.Add( "HUDShouldDraw", "R_DrawHud", R_DrawHud )
[/lua]
Why do you feel it necessary to override every other HUDShouldDraw hook with your own for something like this? You do this in every single addon you release that has a HUD feature.
Why insult my work and then ask me a question? Work on your manners. It doesn't "override every HUDShouldDraw hook" .
[QUOTE=CptFuzzies;18257519]It doesn't "override every HUDShouldDraw hook" .[/QUOTE]
Yes, it does.
If you return anything but nil in a hook, it automatically ignores all other hooks and the gamemode function.
[editline]10:31AM[/editline]
[lua]/*---------------------------------------------------------
Name: Call( name, args )
Desc: Called by the engine to call a gamemode hook
---------------------------------------------------------*/
function Call( name, gm, ... )
local b, rA, rB, rC, rD, rE, rF, rG, rH
local HookTable = Hooks[ name ]
if ( HookTable != nil ) then
for k, v in pairs( HookTable ) do
if ( v == nil ) then
ErrorNoHalt("Hook '"..tostring(k).."' tried to call a nil function!\n")
HookTable[ k ] = nil // remove this hook
break;
else
// Call hook function
b, rA, rB, rC, rD, rE, rF, rG, rH = pcall( v, ... )
if (!b) then
ErrorNoHalt("Hook '"..tostring(k).."' Failed: "..tostring(rA).."\n")
HookTable[ k ] = nil // remove this hook
else
[/lua]
this is the very important bit.
[lua]
// Allow hooks to override return values
if (rA != nil) then
return rA, rB, rC, rD, rE, rF, rG, rH
end
[/lua] Point proven. [lua]
end
end
end
end
if ( gm ) then
local GamemodeFunction = gm[ name ]
if ( GamemodeFunction == nil ) then return nil end
if ( type( GamemodeFunction ) != "function" ) then
Msg( "Calling Non Function!? ", GamemodeFunction, "\n" )
end
// This calls the actual gamemode function - after all the hooks have had chance to override
b, rA, rB, rC, rD, rE, rF, rG, rH = pcall( GamemodeFunction, gm, ... )
if (!b) then
gm[ name .. "_ERRORCOUNT" ] = gm[ name .. "_ERRORCOUNT" ] or 0
gm[ name .. "_ERRORCOUNT" ] = gm[ name .. "_ERRORCOUNT" ] + 1
ErrorNoHalt( "ERROR: GAMEMODE:'"..tostring(name).."' Failed: "..tostring(rA).."\n" )
return nil
end
end
return rA, rB, rC, rD, rE, rF, rG, rH
end[/lua]
[URL=http://luabin.foszor.com/code/lua/includes/modules/hook.lua#63]source[/url]
My apologizes, I wasn't thinking about that. I thought he meant to say that I was creating a function within a global scope rather than a local scope, thus overriding every hook this way.
I was never aware that returning nil values would do such a thing. I just use that practice to stop calling the rest of the code, rather than wrap the entire thing in an if-than-else statement.
Would it be more beneficial not to do this anymore? Or are there circumstances where it is acceptable? If so, I'll just wrap the code from now on.
Thank you for showing me this.
[QUOTE=CptFuzzies;18265979]My apologizes, I wasn't thinking about that. I thought he meant to say that I was creating a function within a global scope rather than a local scope, thus overriding every hook this way.
I was never aware that returning nil values would do such a thing. I just use that practice to stop calling the rest of the code, rather than wrap the entire thing in an if-than-else statement.
Would it be more beneficial not to do this anymore? Or are there circumstances where it is acceptable? If so, I'll just wrap the code from now on.
Thank you for showing me this.[/QUOTE]
[lua]
hook.Add("PlayerSpawn","Racist Test #1",function(ply)
if (ply:IsBlack()) then
return false; -- This will stop any other PlayerSpawn hooks from being called.
end
-- Do stuff for white people
end)
hook.Add("PlayerSpawn","Racist Test #2",function(ply)
if (ply:IsBlack()) then
return nil; -- This will end the current function, but will still let all other hooks run.
end
-- Do stuff for white people
end)
hook.Add("PlayerSpawn","Racist Test #3",function(ply)
if (ply:IsBlack()) then
return; -- Return on it's own is equivilent to return nil.
end
-- Do stuff for white people
end)[/lua]
You were doing the first, either of the second would be fine.
Ah, brilliant. I didn't see it that way, thank you very much. :smile:
Apparently this thing doesn't like alternative HUD stuff that you didn't make, it's crashed afew things I have on some servers. Only other problem is the odd name format ('sent_grenade_frag", "rpg_missile") that looks weird when the stuff is flying at you.
Otherwise, while it's currently just a small-time thing, it's certainly interesting. Only suggestion I can give is the L4D item highlight style that was already suggested. Too lazy to find screenshots, but when you have a gun or item in the world and you look at it, a white outline appears around it to highlight it better and such.
I thought it was npc_grenade_frag
Meh, nice work, are you gonna add physical changes (Like the sprint and flashlight) or leave it at visual stuff.
[QUOTE=pedroion;18337151]I think this addon looks pretty nice with deathmatch gamemodes.
Though this weird SENT_GRENADE_FRAG and RPG_MISSILE aren't exactly [i]pretty[/i].[/QUOTE]
He could easily make it get the actual name of those items by checking if it is a frag then put "Frag Grenade" and if it is a RPG then put "RPG Missile" etc
[QUOTE=jonney934;18337572]He could easily make it get the actual name of those items by checking if it is a frag then put "Frag Grenade" and if it is a RPG then put "RPG Missile" etc[/QUOTE]
language.Add ?
[QUOTE=MGinshe;18340202]language.Add ?[/QUOTE]
No. In actuality, I was going to do this, but got lazy/stopped. Localize() doesn't do the trick, but I'm pretty sure I can find out how this is done by looking in the killicon coding. I tried prefixing "#" to the string values, as this does the trick in certain specific instances, but that's no good here.
Can't you just make it so that if the string it found had rocket or grenade like your table has, it would show the appropriate text? Maybe you could do a system like "ROCKET", "Rocket" in the tables so that the first part would be what to search for and the second is what to display?
No. Because it's designed to dynamically pick up entities. Not just one entity, just as the npc_grenade_frag.
As you can see in the screenshots above, it can detect my sent_grenade_frag from the SWEP Bases project.
What it should really be coded to do is show the same text that would display on a death notice (sans attacker).
[editline]04:59PM[/editline]
A little shout out to my box stalker.
[media]http://www.youtube.com/watch?v=_fcEnJic__4[/media]
Herp derp, I'm a 14 year old stalker who spends his days after school rating CptFuzzies dumb, because I have nothing better to do.
I'm rating you dumb because you care about it so much.
That said, it's a cool thing you've made. Just bother making it display correct names.
this has been done before i used to have it but it was horrible because it flashed red and was big
[QUOTE=pedroion;18349898]It's like you just threw something undone at our faces.[/QUOTE]
[QUOTE=CptFuzzies;18237617]...but for now, this is just a small addon for the fun of coding it.[/QUOTE]
[IMG]http://www.facepunch.com/fp/rating/book_error.png[/IMG]
[editline]08:58AM[/editline]
Cloak Engaged.
[media]http://img.photobucket.com/albums/v308/flaming-gummy-bear/gm_construct0018.jpg[/media]
[QUOTE=CptFuzzies;18351643][IMG]http://www.facepunch.com/fp/rating/book_error.png[/IMG]
[editline]08:58AM[/editline]
Cloak Engaged.
[media]http://img.photobucket.com/albums/v308/flaming-gummy-bear/gm_construct0018.jpg[/media][/QUOTE]
While that is [fucking] awesome, that also reminds me that I hate Source AI because you can't sneak up on them from shadows or such. You have to be directly behind them at all times or they go 'lol i c u' and, if the map's properly noded, chase you down to kill you - even after respawning.
Fuck you, Valve. Fuck. You. *rage emote here*
[QUOTE=RikohZX;18352063]While that is [fucking] awesome, that also reminds me that I hate Source AI because you can't sneak up on them from shadows or such. You have to be directly behind them at all times or they go 'lol i c u' and, if the map's properly noded, chase you down to kill you - even after respawning.
Fuck you, Valve. Fuck. You. *rage emote here*[/QUOTE]
HL2 doesn't have a cloak nor any other stealth mechanisms, so the AI is not designed to that end. [url=http://wiki.garrysmod.com/?title=Player.SetNoTarget]Player.SetNoTarget[/url] is what you need if you want to hide the player from NPCs.
Yep.
Also:
Maximum Strength = higher jumping, melee weapons do more damage
Maximum Armor = Faster regen than other enhancements
Maximum Speed = :flashfap:
Cloak = Self-explanatory.
[QUOTE=Nevec;18352872]HL2 doesn't have a cloak nor any other stealth mechanisms, so the AI is not designed to that end. [url=http://wiki.garrysmod.com/?title=Player.SetNoTarget]Player.SetNoTarget[/url] is what you need if you want to hide the player from NPCs.[/QUOTE]
What I mean is, there's no use of shadows or such in the Source coding the hide yourself from AI - not even distance. Maybe it's possible to code in lua a side-system that activates notarget depending upon how dark the shadows you're in are or such, but it'd probably be wonky as hell. .. Hm, I think I have a future request in mind.
Anyway, this replication of the Crysis stuff seems cool and all, but I noticed, Fuzzies, that you seem to not be able to bind yourself to one thing - you're all over the place, man. No offense, but I think you need to find one project and stick with it until you're satisfied, then concentrate on another, you know?
Sorry, you need to Log In to post a reply to this thread.