From 25e4d04a331a6a0b9d897d4f721757730771ff97 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 18 Nov 2017 16:00:29 -0500 Subject: More documentation * Documented the item table * Documented the inventory table * Started writing tutorials --- doc/examples/babysfirstaddon.md | 29 +++++++++++++++++++++++++++++ doc/examples/setup.md | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 doc/examples/babysfirstaddon.md create mode 100644 doc/examples/setup.md (limited to 'doc/examples') diff --git a/doc/examples/babysfirstaddon.md b/doc/examples/babysfirstaddon.md new file mode 100644 index 0000000..595ad77 --- /dev/null +++ b/doc/examples/babysfirstaddon.md @@ -0,0 +1,29 @@ +# Tut 0x01 - Baby's First Addon + +A quick primer on addons for Garry's Mod, and Artery. + +You may have seen on the gmod wiki, instructions on running lua code. One way is to place files in your `garrysmod/lua/autorun` directory, and they will be run automatically when you enter single player. This can get messy though, another way to run lua is by making a folder in `garrysmod/addons//lua/autorun`, and placing your scripts in that (i.e. so that `garrysmod/addons/my_first_addon/lua/autorun/hello.lua` is a valid file). As it turns out, all folders under `garrysmod/addons/` get reflected! This means that if you have a file `garrysmod/addons/data/pac3/my_pac.txt` it will appear in the pac editor and a pac you can load! + +This is the method used by addons for Artery. Since Garry's Mod loads addons's autorun BEFORE gamemodes, Artery uses the `data/artery/global/` folder to run scripts after the gamemode as loaded (and therefore has access to the nrequire() function, more on this later). + +## Lets get started + +Start by creating a new folder under `garrysmod/addons/` called `artery_rougelite`. We'll be using this folder for the rest of the tutorials to build a small rougelike gamemode to explore the different features artery provides. + +Now create another folder under the folder you just made `garrysmod/addons/artery_rougelite/data` + +Now another `garrysmod/addons/artery_rougelite/data/artery/` + +And another `garrysmod/addons/artery_rougelite/data/artery/global/` + +With the folder structure set up, we're ready to actually write some lua. + +Create a file `garrysmod/addons/artery_routelite/data/artery/global/helloworld.txt` + +and copy+paste the following code into it. + +``` +print("Hello, world!") +``` + +Now start up garrysmod with the Artery gamemode selected. Head into flatgrass or something. Open your console, you should see "Hello, world!" printed. diff --git a/doc/examples/setup.md b/doc/examples/setup.md new file mode 100644 index 0000000..2f9e0ce --- /dev/null +++ b/doc/examples/setup.md @@ -0,0 +1,22 @@ +# Tut 0x00 Setup & Installation + +This tutorial covers how to set up Artery so you can begin developing. + +First, you'll need to download the Artery gamemode base. This can be done for updates with [git](https://git-scm.com)(reccomended) or just downloaded as a zip and extracted + +## Git setup + +1. Download [git](https://git-scm.com) +2. Follow the setup instructions +3. Open command prompt and type in `git --version`, verify that version information is printed. +4. Use the `cd` command to go into your Garry's Mod directory. This is usuallly `C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod` (i.e. the command would be `cd "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod"`). You can alternatively go to this location in your file browser, then click the file path at the top, and copy+paste it into your command prompt. +5. Use `cd` again to go into your `gamemodes` directory (i.e `cd gamemodes`) +6. Clone the repository `git clone http://cogarr.net/source/cgit.cgi/artery` +7. Go back and clone the artery_editor addon (`cd ../addons` then `git clone http://cogarr.net/source/cgit.cgi/artery_editor`) +8. Another one `git clone https://cogarr.net/source/cgit.cgi/zones` _*_ Please note that this is a fork of [bobleheadbob's original api](https://github.com/Luabee/Zones), all it does is put the files into an addon format. +9. Finally, be sure you are subscribed to PAC3 on the steam workshop +10. Boot up gmod, select the artery addon, and load into gm_flatgrass to make sure it works! You can skip the next section, and go on to the next tutorial. + +## Non-git setup + +You'll be doing almost the same thing, only downloading zips instead of using the `git clone` command -- cgit v1.2.3-70-g09d2