GMod - What are you working on? October 2014 (#38)

PM me if anything else needs to be added, as always.

Highlights from the previous thread

(this was obligatory)

Awesome work on the highlights!
I liked the NSFW tag better so guests couldn’t view.

I fucking love that the monitor post made it to the highlights.

I made a module similar to what gm_preproc did back in the day to basically get all a callback every time lua gets run on you.
Integrated it into ‘my’ clientside lua viewer to let me override clientside files servers send me for funsies.

before

http://a.pomf.se/kfahoy.jpg[/t]

after
[t]http://a.pomf.se/eenque.jpg[/t]

[t]http://a.pomf.se/tqcnev.png

(tell me if you mind me “leaking” a config file of some paid addon)

Changing the color of something is obviously just a small thing you could do

Man, I wish I could do stuff like that…

I’m really glad my first time in WAYWO highlights is fucking that

oh my thing is on there
intriguing.

Dayum, LinkTwilight got all them super epic TTT traps.

[sp] It’s not RDM if they’re shitty addons [/sp]

I’m making a client side script, so when I kill addons they get deleted/unsubbed.
Everything is done, besides the detection of me killing someone due to no PlayerDeath client side :confused:

I had to go through the source to find out how to get the preview image, took me a little bit because I couldn’t find anything.

Once the script is done, I’ll get a list of sv_allowcslua 1 servers and go RDM crazy till most are gone.

Nice concept for your 15k addons you have to download.

If you don’t mind that your death messages are broken, you could replace the receiver of the killfeed:
[lua]
local function RecvPlayerKilledByPlayer()

local victim 	= net.ReadEntity();
local inflictor	= net.ReadString();
local attacker 	= net.ReadEntity();

    --snip--

end

net.Receive( “PlayerKilledByPlayer”, RecvPlayerKilledByPlayer )
[/lua]

Or you don’t break it, since




local function RecvPlayerKilledByPlayer()

	local victim 	= net.ReadEntity();
	local inflictor	= net.ReadString();
	local attacker 	= net.ReadEntity();

	if ( !IsValid( attacker ) ) then return end
	if ( !IsValid( victim ) ) then return end
			
	GAMEMODE:AddDeathNotice( attacker:Name(), attacker:Team(), inflictor, victim:Name(), victim:Team() )

end
	
net.Receive( "PlayerKilledByPlayer", RecvPlayerKilledByPlayer )



meaning: overwrite AddDeathNotice

example:




local bak_deathnotice = GAMEMODE.AddDeathNotice

function GAMEMODE:AddDeathNotice( attacker_name, attacker_team, inflictor, victim_name, victim_team )

	print( attacker_name ... " killed " .. victim_name .. " !")

	return bak_deathnotice( attacker_name, attacker_team, inflictor, victim_name, victim_team )
end



-snip-

Just wanted to share an useful function I made today.
[lua]
function VDFtoTable( str, toArray )
local func = (toArray == true) and util.KeyValuesToTablePreserveOrder or util.KeyValuesToTable
local t = {}
for name, data in str:gmatch( [[(%b"")%c*(%b{})]] ) do
t[ name:gsub(""", “”) ] = func( name … "
" … data )
end
return t
end
[/lua]

Example:
[lua]
local f = file.Open( “surfaceproperties.txt”, “r”, “DATA” )
local str = f:Read( f:Size() )
f:Close()
PrintTable( VDFtoTable( str ) )
[/lua]

as posted by BigBadWilly on the old forum, the heart I used for that HUD element did look a little weird, so I’m fishing for a new image to photoshop a heart out of. I will upload a (much shorter) video of it using a better heart texture.

I would love to actually render a detailed beating heart model there, but whatever.

[editline]1st October 2014[/editline]

Now I may release just the heart element itself to the public, where it does not affect any other HUD elements. (I will work in a way for it to display suit energy, too)

This heart will not work properly if your health is above the player’s max health setting, and the armor representation might look rather odd as well for values above your max suit armor above the player’s max armor limit.

Perhaps one could be animated rather the photo shopped in?

Yes, I thought of that, many times, but any and every time I try to make an animated texture I fail miserably. On top of that, I don’t know how I’ll sync the animation with the actual heart beat! I would love to have a realistic beating model to do it with, though. It could have real time environment lighting!

Well anyway, despite being just a static growing VMT, you’ll most likely appreciate the video I’m about to post, with the new texture, and a new little effect.

The heart is a little smaller than last time, though.

I think I perfer the one in the video then your previously shown ones.

In my opinion, using a realistic heart for this seems a little creepy…

Staring at it started changing my breathing patterns.