aboutsummaryrefslogtreecommitdiff
path: root/tutorials/tut041_not_enough_items.md
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2019-05-04 15:52:00 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2019-05-04 15:52:00 -0400
commitfaa8312074e6ea8a96efd70d6188ef592f81e579 (patch)
tree5b2d47dae86a2f5fd96c379a20163177b44e20ea /tutorials/tut041_not_enough_items.md
parent984401ce1f84581786f9e3241caf96bda718940b (diff)
downloadartery-faa8312074e6ea8a96efd70d6188ef592f81e579.tar.gz
artery-faa8312074e6ea8a96efd70d6188ef592f81e579.tar.bz2
artery-faa8312074e6ea8a96efd70d6188ef592f81e579.zip
Updated tutorials
Various fixes and updates for the tutorials
Diffstat (limited to 'tutorials/tut041_not_enough_items.md')
-rw-r--r--tutorials/tut041_not_enough_items.md7
1 files changed, 2 insertions, 5 deletions
diff --git a/tutorials/tut041_not_enough_items.md b/tutorials/tut041_not_enough_items.md
index 7b8a65f..650f6f6 100644
--- a/tutorials/tut041_not_enough_items.md
+++ b/tutorials/tut041_not_enough_items.md
@@ -4,14 +4,12 @@
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\_rougelite/data/artery/global/npc\_corpses.lua
local reg = nrequire("core/inventory/item.lua")
local base = {}
- base.Name = "Meat base"
+ base.Name = "Corpse base"
base.weight = 10
@@ -27,10 +25,9 @@ garrysmod/addons/artery\_rougelite/data/artery/global/npc\_corpses.lua
for k,v in pairs(allnpcs) do
if k.Name then
local item = table.Copy(base) --Make a copy of the above "base" table
- item.Name = k.Name .. " Meat" --Give it a name of "<something> Meat"
+ item.Name = k.Name .. " Corpse" --Give it a name of "<something> Corpse"
reg.RegisterItem(item) --Add it to the game
end
end
That's it! Restart the gamemode, and use `artery_printitems` to see the items in console!
-