From faa8312074e6ea8a96efd70d6188ef592f81e579 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 4 May 2019 15:52:00 -0400 Subject: Updated tutorials Various fixes and updates for the tutorials --- tutorials/tut041_not_enough_items.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tutorials/tut041_not_enough_items.md') 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 " Meat" + item.Name = k.Name .. " Corpse" --Give it a name of " 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! - -- cgit v1.2.3-70-g09d2