Help:Editing

From Garry's Mod
Jump to: navigation, search

Contents

Requirements

In order to maintain consitency on the wiki, we require you to follow next rules:

  • All function/content links must use templates:
    • For class methods:
    • For library functions:
      • Code: {{LibraryFunction|ents|Create}}
      • Preview: ents.Create

    • For global functions:
      • Code: {{GlobalFunction|AddCSLuaFile}}
      • Preview: AddCSLuaFile

    • For hooks:
    • For enumerations:
    • For structures:
    • For types, classes and panels:
    • For libraries:
    • For shaders:
  • It's Lua, not LUA, LUa, lua or LuA.
  • It's SENT, not SEnt.
  • It's SWEP, not SWep.
  • It's TOOL, not STOOL.

  • If output of an example is not available, don't put N/A, just leave the field empty.
  • If you don't know an argument name or description, don't put UNKNOWN, just leave it blank.
  • Put proper descriptions for arguments and return values, not just their names with one word.
  • Argument names must start with a lower case letter.
    • Position is bad, pos is good.
  • Do not put type indentifier as first letter.
    • iNum is bad, num is good.

  • Try to match coding style of your examples with coding style of other examples on other pages.
    • Do not put any semicolons.
    • Keep underscores to minimum.
    • Use Entity( 1 ) for player.
    • Use Vector( 0, 0, 0 ) and Angle( 0, 0, 0 ) for arguments, not just something like vPos.
    • Use Player1 in place of a player's nickname in example output. Additional players can be Player2, Player3, and so on.
    • Avoid useless globals.
    • Use --, not //.
    • Try to make the example be ready for use by other people, so that they can throw it into their Lua file or use lua_run and it works.
    • Try to space out function arguments, put a space after each coma, bracket like so:
function ENT:Think()
	self:MyFunction( "test argument", 1, false )
end

Special Pages

Page Creation Templates

To edit a page using a template - please click on the "edit with form" link on the top left.

Useful Pages

Ways to contribute

Formatting Guide

Screenshots

  • Special:Upload -- Allows the uploading and embedding of images into pages.

Lua Code

Wrap your Lua code in <pre></pre> tags.

local function Test()
	print( "Kittens" )
end

Stubs

  • Code: {{Note|This is a note}}
  • Preview:
NOTE This is a Note


  • Code: {{Deprecated|Feature removal notes here}}
  • Preview:
This feature is deprecated.

You should avoid using it as it may be removed in a future version.

Feature removal notes here


Tutorials

Tutorials submitted to the wiki should be short and sweet where possible.
They should focus only on the subject they're covering - and not try to cover too much.

Title

Tutorials should not contain slashes in their names. They should be titled as the subject they're covering, with appropriate capitals and spaces.

Try to give your page a name starting with the letter that a user might be searching for. For example, if your page is about developing for the Kinect - call it "Kinect Development" - not "Developing For Kinect". This way when the page is in an alphabetical list it's listed under K and not D.

Categories

You can see a list of categories here. You should add your page to all appropriate categories by ticking the category boxes on the edit page.

Personal tools
Navigation