GMod - What are you working on? - June 2014 (#34)

[sp]Hopefully this hasn’t been posted before I write out this one, as I dont have a waywo generator. if I’ve missed something, please PM me the quote to avoid shitting this thread up. This content is some of the most rated stuff from the first and last few pages, if you believe there’s something further I can add please also PM me that.[/sp]

Here goes :v:
Highlights from the previous thread

I made a pretty cool looking hexagon based menu yesterday. Let me go record it
I didn’t record my cursor on accident, but the ‘tiles’ support clicking and such. The red one is a exit button.
EDIT:

PS: Anyone know how to draw text at an angle that doesn’t look really bad?

Credits to kirby for base hexagon function :v:

You can use -condebug to save the console output to console.log or so; then monitor that file by file.Reading it every now and again; new lines can be printed.

Granted, this is costly, but without a dll this is the only way to do it.

Bullet system without the parabola trajectory, gravity, etc effects yet.

Simply shows a round traveling at 800 feet per second, rotating at ~1800 revolutions per second. Would be average .45 ACP except for the rotations. Barrels will have an effect on rotation, velocity, etc based on gasses built behind them, also type of action will affect it too.

Obligatory “New thread smell” comment.

That’s a horrible idea.
I thought there is some more efficient way, other than creating a separate function and adding it to each hook that I am interested in logging info abou and other than the one you mentioned.

I agree; the only way we could possibly do it without a dll is a terrible idea. file io is expensive, and regardless of whether its done on the client or server, it’ll cause some lag, especially with how large the file can become.

Here, request it and I’ll +support it too: https://github.com/Facepunch/garrysmod-requests/issues?state=open

I think it is a great idea, we really should have a way to read console output, with the option to suppress the message if its something like vertex spam, etc…

So, PreConsoleOutput, PostConsoleOutput hooks, or better names. Pre should allow us to return false to stop the message. One argument, text, for the entirety of the message, even if it is multi-line like an error.

It really should be a native feature.

I think there are some reasons that we don’t know of yet as to why we don’t have a hook for console output yet.

For example there was this lua driven console 2.0 once in some beta version of gmod but that got removed. That wouldn’t have worked without a hook (or similar) for that.

Nobody added it, that’s why. It’s easy to make a spew function in C++ to get what’s being printed in the console and as a matter of fact i’ve done it already once. But it would be nice if we had one forwarded to lua.

If you really want to, I may be able to make a pull request sometime. I’d have to revise my code, make it neater and more organized, etc before it was ready to be a pull request.

Or you could add me to steam and we could discuss. http://steamcommunity.com/id/Divran/

[editline]1st June 2014[/editline]

radio is silent, blame gm_video, doesn’t capture sound.PlayURL

As I stated, it was added once but it got removed. Here is what I’m talking about http://youtu.be/-zfwxKHGO4I?t=5m35s

The reason Console 2.0 got removed is because too many people complained of lag. I wish there was an option whether or not to use it; maybe we should request it?

There was an old addon called Engine Spew - it worked amazing and it allowed more than ONE filter, you could remove the vertex spam without using the console command to filter the console messages.

Having fun reclaiming people’s code?

Опубликовано: 26 апр. 2014 г.
(Published at 26 apr. 2014):

Base code for hexagons, uploaded by BlueKirby @ Apr 28th, 2014: http://pastebin.com/PmFCG4Vh

Just made a forum ban bot!

My ban plugin uses tmysql4 for ploppin stuff into my forum:

Fixing the old swep_bases for GMod13

I still need someone to code the hl2 viewmodel movement for me tough.

You should use the c_ models and SWEP.UseHands

If the video in the other thread wasn’t a hint enough, I’m working on an rpg plugin similar to the one for Sven Coop. One of the skills you can take is the ability to increase your max armor, which changed how much you spawned with and how much you could regenerate, but you run into the limit of the engine enforcing a soft cap on the armor.

I started to work around it because I really don’t want to replace entities. I was able to get batteries working:


local meta = FindMetaTable( "Player" )

AccessorFunc( meta, "m_iMaxArmor", "MaxArmor" )

local sk_battery = GetConVar( "sk_battery" )
	
local function PlayerCanPickupItem( pl, item )
	local amt
	
	if not pl:GetMaxArmor( ) then
		pl:SetMaxArmor( 100 )
	end

	if item:GetClass( ) == "item_battery" then
		if pl:Armor( ) + sk_battery:GetInt( ) <= pl:GetMaxArmor( ) then
			return
		end
		
		amt = math.min( pl:GetMaxArmor( ) - pl:Armor( ), sk_battery:GetInt( ) )
		
		pl:SetArmor( pl:Armor( ) + amt )
		pl:EmitSound( "items/battery_pickup.wav" )
		item:Remove( )
		return false
	end
end

hook.Add( "PlayerCanPickupItem", "Change armor cap - batteries", PlayerCanPickupItem )

This is abstracted from the code I am using ( which doesn’t account for lower than normal values ) and probably won’t work out of the box, but it gets the idea across.

You can do something similar to this with ammo if you are willing to track the default ammo amounts, which instead of running on convars are scaled by a difficulty one.

I think I’m going to have to end up replacing the suit charger entity, though, since I’d be doing just as much work to go around it.

I wanna stabilize a first release before adding c_hands.
My point is making a sweppack that as close as Half-Life 2 as possible.
Before i do a release, i still want the viewmodel sway stuffs, i tried to replicate the C++ one, but i have failed miserably. Thats why i was asking for someone.

It would be nice if there was a way to improve the ban notice the client receives in game. Then you would have a nice clean system all round. Would be difficult if not impossible due to it being clientside.