[QUOTE=MPan1;49688852]Well, it's not really the same- when that function (render.PopFilterMag) crashes the game, it gives an error before closing, but not an ingame error- a popup box. Would it really be that hard to change that error into a Lua one?[/QUOTE]
Errors that end the game do so because the error in question puts the game in an unrecoverable state - or at least that's what the functionality is there for.
[QUOTE=highvoltage;49691488]Before I type up a explanation of the playercolor system, do you just want to be able to set the color of a model with one texture or one with multiple textures?[/QUOTE]
Not really textures but yeah, I want to re-color multiple parts of a model much like you can change Breen's suit color but it doesn't change his face color.
You will have to edit the models texture(s) to do it, as well as make a custom material proxy.
The texture needs an alpha channel, areas with white alpha will be colored fully, black won't be colored, you can use shades of grey to make the color less vibrant.
Here is a basic .vmt for the texture:
[code]"VertexLitGeneric"
{
"$basetexture" "my/material/with/alpha"
"$blendtintbybasealpha" "1" // alpha channel of $basetexture: color mask.
"$blendtintcoloroverbase" "0" // blend mode. anything =/= 0 is ugly!
Proxies
{
MyColorProxy
{
resultVar $color2 // When the material proxy changes resultVar it also changes color2
default 0.23 0.35 0.41 // unused for now.
}
}
}[/code]
You also need to make your own material proxy:
[lua]matproxy.Add( {
name = "MyColorProxy",
init = function( self, mat, values )
-- Store the name of the variable we want to set
self.ResultTo = values.resultvar
end,
bind = function( self, mat, ent )
if ( !IsValid( ent ) ) then return end
-- Pretty much you want a way to retrieve the color vector you want to use on the entity
-- This example just grabs it from a varable set on the entity
-- mat:SetVector( self.ResultTo, col ) sets the resultvar in the materials vmt
if ( ent.ColorForMaterialToUse ) then
local col = ent.ColorForMaterialToUse
if ( isvector( col ) ) then
mat:SetVector( self.ResultTo, col )
end
else
mat:SetVector( self.ResultTo, Vector( 0,0, 0 ) ) -- Default is white, but can be anything you want
end
end
} )[/lua]
So when your model has the above .vmt and you set the ColorForMaterialToUse variable on it clientside it will color your desired spots only
Here are some links to hopefully useful stuff:
https://developer.valvesoftware.com/wiki/$blendtintbybasealpha
[url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/matproxy/player_color.lua[/url]
[url]http://wiki.garrysmod.com/page/matproxy/Add[/url]
Also have a look at the the playermodels textures and vmts to get a better idea
Hopefully this makes sense, I apologize if it doesn't and will fix it if needed
Can we save the stencil buffer to a variable so we can push and pop it? Right now two stencil operations being performed in the same frame have a good chance of overwriting each other.
When a user goes through lag, how come if someone talks in chat at that time instead of their normal name Console as the name is shown?
[QUOTE=dezamb;49694729]When a user goes through lag, how come if someone talks in chat at that time instead of their normal name Console as the name is shown?[/QUOTE]
because whatever you're using likely sends their entity which isnt valid clientside on the person lagging.
[QUOTE=StonedPenguin;49694792]because whatever you're using likely sends their entity which isnt valid clientside on the person lagging.[/QUOTE]
It occurs in vanilla Garry's Mod because of the [URL="https://github.com/garrynewman/garrysmod/blob/e552804a9353699da14c53b095b880cf5a34f4c3/garrysmod/gamemodes/base/gamemode/cl_init.lua#L159-L163"]base gamemode code[/URL].
It's actually annoying that it treats null players as Console too, rather than just something like "NULL" to differentiate that it isn't Console talking. See the numerous "Omg is that console talking??" replies that ensue after a spot of lag.
If I recall correctly from testing, there is no way we can (in our code) differentiate a null player from legitimate Console text via the OnPlayerChat hook, because both instances pass a NULL entity as the player parameter.
Would asking for a way to differentiate console from null players be a practical GMod request? E.g. making the player parameter nil for console instead of NULL?
I just wanted to thank you guys for fixing holos on Linux. :smile:
[QUOTE=Python1320;45526402]
manual refresh for lua files on Linux servers!
[T]http://i.imgur.com/i3QaW96.png[/T]
[/QUOTE]
A lua binding for manual refresh would be nice.
[url]https://github.com/garrynewman/garrysmod-requests/issues/6[/url]
Is that the correct place to put that?
[QUOTE=Ducky3426;49698866]A lua binding for manual refresh would be nice.
[url]https://github.com/garrynewman/garrysmod-requests/issues/6[/url]
Is that the correct place to put that?[/QUOTE]
[url]https://github.com/Facepunch/garrysmod-requests[/url]
What do you mean manual refresh? Can't include() be used to reload a file?
finally found the cause of broken textures on my server, i have my own packing thing that takes all materials, but the envmapmask just returns "" or error.. was just this specific case not implemented?
[lua]Material("glass/window01_sg.vmt"):GetString("$envmapmask")
Material("glass/window01_sg.vmt"):GetTexture("$envmapmask"):GetName()[/lua]
[code]Material("glass/window01_sg.vmt")[/code]
Pretty sure you do not need the ".vmt" bit in there.
[QUOTE=Robotboy655;49706481][code]Material("glass/window01_sg.vmt")[/code]
Pretty sure you do not need the ".vmt" bit in there.[/QUOTE]
it's autogenerated
doesn't matter still, all other ones like $basetexture and $bumpmap works
[QUOTE=Giraffen93;49706555]it's autogenerated
doesn't matter still, all other ones like $basetexture and $bumpmap works[/QUOTE]
Could it be related to this atrocious bug?
[url]https://github.com/Facepunch/garrysmod-issues/issues/1296[/url]
[QUOTE=Robotboy655;49707530]Could it be related to this atrocious bug?
[url]https://github.com/Facepunch/garrysmod-issues/issues/1296[/url][/QUOTE]
Well that's the same thing isn't it? Yeah.
[QUOTE=Ndsbot;49684177]Since you decided that Addons should no longer Override everything.. the only way for me to Override Workshop addons that are outdated, is gone. What do i do now?[/QUOTE]
I've managed to get the new changes to co-exist with the old setup of Legacy addons overriding Workshop addons. The change should be up on the dev branch by the end of tomorrow.
Here's some recent changes that are already on the dev branch:
[quote]
• Fix bounds check in SetBoneMatrix/GetBoneMatrix methods
• ConVars created with CreateConVar()/CreateClientConVar() now have their default value set
• Fixed memory leak in Lua-created ConVars
• VMatrix:__mul no longer crashes when given non-userdata values
• Renamed Awesomium:Stop() to Awesomium:StopLoading()
• L4D2 DLC content is now mounted
• include() now passes any returned values from the loaded file
• added File:ReadLine()
[/quote]
[QUOTE=Handsome Matt;49711689]does require do the same now too? ( for lua files that is )[/QUOTE]
It will eventually for both Lua files and binary modules.
That is actually really fucking useful.
Oh man, that include thing is so helpful, I previously used CompileFile to get values returned from include.
so.. basically a thing from [I]real[/I] lua? :v:
I've been hooking up the functions used to mount GMA files to Lua. It's pretty sweet, but I need to improve things like reloading materials/models/Lua. Stuff like this would allow addons to hot-load content straight from the workshop during runtime.
[vid]http://scrnsht.me/u/Hob/raw[/vid]
*slightly tenses*
[QUOTE=Willox;49713954]I've been hooking up the functions used to mount GMA files to Lua. It's pretty sweet, but I need to improve things like reloading materials/models/Lua. Stuff like this would allow addons to hot-load content straight from the workshop during runtime.
[vid]http://scrnsht.me/u/Hob/raw[/vid][/QUOTE]
Reminds me of toybox.
[editline]10th February 2016[/editline]
I fucking love you willox.
[QUOTE=geferon;49714054]Reminds me of toybox.
[editline]10th February 2016[/editline]
I fucking love you willox.[/QUOTE]
You couldn't just load random addons with this though, they'd have to be made specifically to be hot-loaded (or have code made specifically to load them properly).
[QUOTE=Willox;49714087]You couldn't just load random addons with this though, they'd have to be made specifically to be hot-loaded (or have code made specifically to load them properly).[/QUOTE]
How would that be?
Is there any reason PlayerTick is ridiculously expensive, more so than just creating your own player tick?
[QUOTE=Alex_grist;49716942]Is there any reason PlayerTick is ridiculously expensive, more so than just creating your own player tick?[/QUOTE]
I'm guessing it gets called multiple times per tick when the server has to timewarp for prediction.
Sorry, you need to Log In to post a reply to this thread.