GMod - What are you working on? March 2016 (#55)

I wrote a crash-course tutorial if you’re interested. http://forum.facepunch.com/showthread.php?t=1450530

True… This is weird.

I’ll take a look. I know the very basics - Sine, Cosine, and Tangent. From basic Geometry.

I’ve always enjoyed math, so I’ll probably study this shit lol.

I wrote a quick and dirty reimplementation of require() for loading pure Lua libraries that depend on it:
[lua]
local _G = _G
local include_env
function require2(name)
if package.loaded[name] then
return package.loaded[name]
end
local top = REQUIRE2_PATH == nil
if top then
REQUIRE2_PATH = string.match(debug.getinfo(2).short_src:GetPathFromFilename(), “^[^/]+/(.-)$”)
end
local path = REQUIRE2_PATH … name:gsub("%.", “/”)
local possible = {
path,
path … “.lua”,
path … “/init.lua”
}
for k, v in pairs(possible) do
if file.Exists(v, “LUA”) and not file.IsDir(v, “LUA”) then
local fn = setfenv(assert(CompileFile(v)), include_env)
local ret = fn(name)
package.loaded[name] = ret or true
if top then
REQUIRE2_PATH = nil
end
return ret
end
end
if top then
REQUIRE2_PATH = nil
end
error(“require2: couldn’t load '” … name … “’”)
end
include_env = setmetatable({require = require2}, {__index = _G, __newindex = _G})
[/lua]

-snip why do i even bother posting if im just gonna get shit on by skids that do cooler shit than me-

please stop posting things that are that boring/basic in the waywo :frowning:

That’s kind of a shit attitude to have around here. People that do “boring/basic” stuff are still putting time into making things that they’re obviously proud enough to show off. It wasn’t a troll post, he wasn’t spamming - he was having a good time making some animated 3d2d stuff and you could see the clear improvement from the last post. Deterring people from posting stuff because it’s not some revolutionary script only hinders creativity.

Why not just provide some input on how to make it better if you don’t think it’s that great? This isn’t some cool-kids only thread that only the best coders can post in.

it’s what are you working on, not ‘show off and if it’s garbage don’t bother’

I’m not saying any of things, I am saying things of not most quality, such as



DrawText("Text", xpos, math.sin(SysTime()) * fluctuationmultiplier + ypos_middle)


shouldn’t really be posted in the waywo, it’s not that I am saying that only pro coders who have achieved solving the unsolvable question of life and existance can post here. I am saying things that are almost one-liners that most coders can do shouldn’t be posted here.

Please repost it. You are welcome here.

I might be wrong, but isn’t there already a mirror material/thing in gm_construct in one of those underground bits?

http://images.akamai.steamusercontent.com/ugc/307740101631029643/4657C27CDDE47434A481EA54C4528B8974803BB6/

Or are you just trying to make mirrors in Lua

I don’t understand why that is an issue? Clearly more effort than that was put in, and he wanted to show it off. What’s the harm?

Yes, I’m attempting to replicate the mirrors made within hammer. I think I’ll go pick apart the source code for how they work and work it out in lua when I get time.

If it’s any help, the texture in gm_construct is called ‘glass/reflectiveglass001’ - but I can’t seem to find it’s .vmt anywhere which is odd

Meep, this isn’t the first time you’ve posted like an absolute asshole thinking you know what everyone in the general thread wants.

Found the .vmt (in common/GarrysMod/sourceengine/hl2_misc_dir.vpk):



"lightmappedreflective"
{
	"%tooltexture" "dev/flat_normal"
	"$refracttexture" "_rt_WaterRefraction"
	"$refractamount" "0"
	"$refracttint" "[.5 .5 .6]"

	"$reflecttexture" "_rt_WaterReflection"
	"$reflectamount" "0"
	"$reflecttint" "[1 1 1]"

	"$fresnelpower" "0"
	"$minreflectivity" "0.8"
	"$maxreflectivity" "1.0"
	
	"$normalmap" "dev/flat_normal"

	"$surfaceprop" "glass"
	"$bumpframe" "0"
}


I didn’t even know lightmappedreflective was a shader
Maybe that will interest you

[editline]2nd March 2016[/editline]

Dammit automerge

gm_construct’s mirror is shitty though. It’s low resolution and it only reflects certain things.

Are you using 3D2D to draw it, by chance?

Thanks for calling me an asshole. That was necessary.
When did I say everyone in the general thread wants what I want? I am saying that because I believe that it is not needed in the waywo. A lot of people I know also agree that posting things so braindead simple or braindead stupid here is generally dumb.

I am going to stop posting so this thread gets on track. It’s my choice and opinion to ask him nicely not to post such braindead simple things in the waywo, and I am sure a lot of others agree with me. You don’t have to, but it’d be kind of nice not to see literally all of the waywo trashed with simple things that anyone could do.

It seems to get all low-res when you’re away from it, but I found that if you go up close it looks perfectly normal (at least to me)

This’ll be my last post since there is no need to keep arguments, but you needed to have this be let known.

Also lmao.

Okay, that’s fine but…

Showing that mentality there that you think people are requesting your assistance.

You posted awhile back criticizing something I did with the same exact rude behavior you are showing off now, which is absolutely uncalled for.

Learn to stop posting like a douche, even in this post you use words like “trashed”, and “braindead simple”. People made something they want to show off, it’s not your call to tell them they can’t post here, and nobody is asking for our ‘hero’ MeepDarknessM to save us.

Basically, think twice when you’re about to post, and yes, calling you an asshole was necessary.