Wiki - Edit. Help the community and help contribute to the wiki!

[release]We should all know about the Gmod lua Wiki, more to the point, the lack of content in the wiki.

Sure lots of common functions are listed, with full description and even examples. But lots of common pages that are very simple to fill in remain blank. Functions and hooks that some of us are very familiar with remain undocumented. So why don’t you start doing it?

Aright, it takes a touch of time to fill in a few pages. But right here i’m going to give you a template where all you have to do is fill in the blanks, and copy it into the page! Don’t worry if what you fill in might be a bit wrong.

You don’t need to add hundreds of lines to a page. You don’t even have to give a full fledged example. Just a line of how to call a function is enough.

So how should I contribute?
[release]If you haven’t signed up to the wiki, do so! You will not be able to edit the wiki without an account. This isn’t a long process.
Now all you need to do is start filling in blank pages. But where should you start?
A good place would be the Derma Controls Section. Some of the main reasons being, it’s the most undocumented collection of links. Sounds like a lot of work doesn’t it, I mean really, look at all those

red links

. But honestly, it isn’t. For each page you only need to fill in a few lines of the template I shall provide, post it to the relevant page, and it’s done! Was it hard? Well find out for yourself!

Here I’ve created a template, more specifically for Derma controls, however if you want to see better formatting guide see Wiki Templates for text formatting.

{{Lua_function |
  function_name     = Panel:InsertFunctionNameHere |
  lua_state            = {{Client}} |
  description          = Describe what this function does, try keeping it simple.

{{Lua example |
  description = Describe what this example does. |
  useOn       = {{Client}} |
  code        = <lua>Place in your lua code here of the example you'd like to share.</lua> |
  output      = What this example will output/return when run.}}

==Additional Notes==
* Add some notes you think might be useful for some one else related to this function.

Pretty easy to fill in right?

What if I don’t know what a function does?
[release]Some of you might be looking through the red links, thinking I don’t know how to use that function, i’ll let some one else come along and fill it in. Why not learn how to use that function, then spread your wisdom onto the page.
Just for the sake of saving you time, have this lua file I use for testing out derma Controls.

[lua]function testingDermaElem()

local Frame = vgui.Create("DFrame")
Frame:SetTitle("This is testing for derma elements")

	local DermaButton = vgui.Create( "DButton", Frame )
	DermaButton:SetText( "Run function on TestElement" )
	DermaButton:SetPos( 25, 50 )
	DermaButton:SetSize( 150, 20 )

	local TestElement = vgui.Create( "", Frame )
	TestElement:SetPos( 25, 125 )
	DermaButton.DoClick = function ()


concommand.Add(“TestingDermaElements”, testingDermaElem)[/lua]
[li]Fill in the gap on line 15 and start adding some test functions you want to try out. I even made a button with a click function so you can call things at your own time.
[/li][li]Save it into “garrysmod/lua” as DermaTesting.lua
[/li][li]Open up Garrys Mod, start a game, then just use the command “lua_openscript_cl DermaTesting.lua” to reload the file on the fly.
[/li][li]Run command “TestingDermaElements” to run the file and test it out!
If you’re unsure if the function you are about to run needs parameters, don’t hesitate to look at and search the functions name to see how it is being used else where. Or you could see how the function is made within its own file, example all DButton functions are listed in “garrysmod/lua/vgui/DButton.lua

Anything else I should know?
[release]Yes. Even if you think what you are filling in is a bit wrong, just like garry said, it will give others motivation to fix it.

Some useful pages to look at if you want to fill in specific kinds of content are:

Wanted PagesThese pages need to be created and add content to them.
Need an exampleThese pages only need an example added.
Need workThese ones, need some work. There’s isn’t many pages either you can fill in. Most of these just need a touch of formatting and description.
Need ReviewingIf you want to review pages, making sure the content on them is up to par, you can remove the tag (Usually at the top in ‘Edit’ text box)
StubsFor all the pages that have content, but not really enough to call it complete.
Missing StateThese pages don’t have what state the function is run on (Server/Shared/Client)
Bad FunctionsThese pages use the templates incorrectly. See top of page for more details.

The Garry’s Mod source code is the number one way to find out how a function works if it’s not documented, especially with Derma.

Fun fact: Most Derma elements have a function called ‘GenerateExample’ that will create a sample of it’s use if you pass it the element’s classname, a propertysheet and dimensions.

That’s true, but it demonstrates far from every method of the control.

True, but you can generally just steal the code and use it as your example in the wiki page. :v:

Yes this is true. But I have seen many times when people have made some crazy ass mod that uses functions, which they found out how to use, but never documented after.

This is also true, although like Overv said, it doesn’t show full use of all the functions and/or how to use them without looking at the source. Not to mention there’s no GenerateExample for functions like Entity:SetBoneMatrix

Added DLabel.GetColor

I added one or two things.

I’ve been a pretty active wiki-editor since 2007, here’s my contributions list just for showing off how a no-lifer I am :clint:

I vote for dlaor as wiki co-president

Convinient. I too added 2 missing functions to the wiki just yesterday.

Wow… Thanks JSharpe, the lack of info on the wiki always did bug me. I’ll try to contribute when I can as well.

Thanks for the template it should help me out with adding some functions.

I think this could prove useful to some.

It outputs a vector containing the directional force damage taken on an entity.

I used to help with the Wiki until uptight people had problems with me tagging the code samples i would add (hey i get credit for taking the time, so why not add my name to it!?!). So fuck’em, i ain’t going to help anymore.

I don’t know much Lua but I do update the Patches page :smiley:

The wiki is not a show off of your code, it’s a global informative source. Your name is already shown on the history page, what more do you want?

If people cant handle me putting a small little “-MadDog” next to the page i spent time working on, time i did not get paid for, nor had to do anything with, then im not going to waste my time. How often do people look at the history page to see who took the time to work on it?! No one.

I occasionally add an example if one is missing. Glad to see a topic about it though as a lot of stuff is missing which could take someone a few minutes to fill in.

Only thing is nobody gives a shit who wrote the example unless they really want to know, and then they open the history page.

How sad.