aboutsummaryrefslogtreecommitdiff
path: root/tutorials/tut041_not_enough_items.md
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-11-26 21:07:54 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-11-26 21:07:54 -0500
commit83af51534bf16bf048aea1cd3b74a0308ed9dd71 (patch)
treeff82f3e6dd841633b1355b73181bcae607ee1138 /tutorials/tut041_not_enough_items.md
parent25e4d04a331a6a0b9d897d4f721757730771ff97 (diff)
downloadartery-83af51534bf16bf048aea1cd3b74a0308ed9dd71.tar.gz
artery-83af51534bf16bf048aea1cd3b74a0308ed9dd71.tar.bz2
artery-83af51534bf16bf048aea1cd3b74a0308ed9dd71.zip
Started work on writing tutorials
Wrote tutorials for * Setup * Addon structure * Inventories * Items
Diffstat (limited to 'tutorials/tut041_not_enough_items.md')
-rw-r--r--tutorials/tut041_not_enough_items.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/tutorials/tut041_not_enough_items.md b/tutorials/tut041_not_enough_items.md
new file mode 100644
index 0000000..895e1fd
--- /dev/null
+++ b/tutorials/tut041_not_enough_items.md
@@ -0,0 +1,27 @@
+# Tut 0x041
+
+## Not enough items
+
+It frequently happens that you want many items with only slight variations. In this tutorial we'll see how to create a item drop for every monster. We'll find all the npc's that the game knows about, and create an item (a corpse) for each one.
+
+First, we need to find all the npc's the game knows about, then create an item for each one.
+
+garrysmod/addons/artery_routelite/data/artery/global/npc_corpses.lua
+```
+local base = {}
+
+base.Name = "Meat base"
+
+base.weight = 10
+
+function base:Serialize()
+ return ""
+end
+
+function base:DeSerialize()
+ return table.Copy(self)
+end
+
+
+
+```