Help talk:Editing

From Garry's Mod
Jump to: navigation, search

Could someone fill this page with some guidelines on how we should properly edit the wiki. Preferably with sub-pages on functions, classes, etc and the templates we should use and how. Also how we should use internal links.
Thanks!

- TheJjokerR 23:54, 10 August 2012 (UTC)


Contents

Warning/Info Templates

I notice throughout the site there are templates such as

This is an internal function or feature.
This means you will be able to use it, but you really shouldn't.


which aren't on this page. I don't use this Wiki too much but would somebody who knows more about these templates add them here? Michaelrule4 20:10, 30 December 2016 (UTC)

I think these templates are the most used:
{{Internal|Optional text}} --> Used to highlight functions that are intended for internal use only.
{{Note|Message}} --> Is used to highlight information about bugs or similar.
{{NextUpdate|Optional text}} --> Is used to highlight things that will only come in future updates.
{{Delete|Optional text}} --> Used to nominate pages for deletion. Robotboy655 will delete them when he thinks it is correct.
{{Deprecated|Optional text}} --> Used to highlight functions that are obsolete and still never removed.
{{Stub}} --> Used to highlight incomplete pages.
{{Validate|Optional text}} --> Used to highlight pages that contain unconfirmed information so others can review and improve them.
- markusmarkusz 01:51 pm, 31 December 2016 (CET)
I'm not really sure how to incorporate these into the page, but I agree that some of them should appear. Some notes though:
Special:Templates lists all the templates.
You covered most of the templates that should actually be used when editing, but you listed a few that shouldn't. For example, you listed Template:NextUpdate but this should pretty much only be used by Robotboy655 and other devs, or an editor who really knows what he's doing, not some random stroll-in who's reading this page for the first time. Same goes for Template:Deprecated and Template:Internal.
One you missed in Template:Warning, which is nearly identical to Template:Note except it's a warning instead and appears orange instead of blue.
--NeatNit 20:46, 31 December 2016 (UTC)

How to refer to the player in examples

The page says:

Why is that? It seems like very bad practice to me. Should we change this?

Entity(1) will return the player in SP or first connected client in MP and so works in most circumstances. It's also neater than player.GetByID(1), which would provide the same result, and so is the best way to go about things, at least within example code. - TheFreeman193 18:42, 8 February 2015 (UTC)
Actually player.GetByID(1), as well as Player(1) are NOT the same as Entity(1). They both use PlayerID ( which is unique to every player, but is reset after server restart ) instead of Entity:EntIndex(), making them unreliable for wiki purposes, and pretty must everything else in my mind. --Robotboy655 09:21, 9 February 2015 (UTC)
But Entity(1) also refers to nothing when the first player leaves, even if a second player is in the server, causing lua errors. Is there no pretty, fool-proof way to refer to a player on the server? Clientside it's obviously LocalPlayer(), but serverside is the tricky bit.
Only thing I could think of is player.GetAll()[1] but I can definitely see how Entity(1) is a lot more elegant. --NeatNit 15:02, 9 February 2015 (UTC)
By same result, I was referring to getting a player object. There are indeed ways of obtaining a player consistently, but for the purposes of an example, these aren't necessary. Using Entity(1) is a fairly reliable way to get hold of a player object so an example will work ingame. -- TheFreeman193 15:44, 9 February 2015 (UTC)

Purge

I just added some previously-undocumented TOOL class functions, and they haven't been added to the sidebar yet. IIRC there is supposed to be a Purge button SOMEWHERE, I just have no idea where to look for it. It should be put in this page! --NeatNit 15:51, 20 February 2015 (UTC)

There's no such button, everything is done automatically. --Robotboy655 17:32, 20 February 2015 (UTC)
If you're talking about MediaWiki's purge action, then the Refresh button in the header is how you access this. It won't update link tables though; as pointed out above, the server will automatically update the relevant lists eventually. -- TheFreeman193 00:47, 21 February 2015 (UTC)

Special:FormEdit

This page links to Special:FormEdit/Function and Special:FormEdit/Hook, saying they can be used to create new functions and hooks respecively, but neither of them is valid. The page shows the following text:

This is the page for editing with a form. You must specify both a form name and a target page in the URL; it should look like 'Special:FormEdit?form=<form name>&target=<target page>', or 'Special:FormEdit/<form name>/<target page>'.

This is not very informative either - what are the options for <form name>? what should be put in <target page>?

It's unclear from this page how to create new pages.

--NeatNit 20:32, 29 February 2016 (UTC)

Updated the links to the ones that work. For editing pages with a form, you should just press "Edit with Form" button in the top left corner on pages that support form editing. --Robotboy655 16:02, 1 March 2016 (UTC)
Personal tools
Navigation