Thread: Creating Class Kits
-
July 14th, 2021, 16:52 #1
- Join Date
- Jan 2021
- Posts
- 39
Creating Class Kits
I'm currently trying to create class kits for all classes and I can't find where to write the class name in the item entry for the tracker to add it when prompting a player to add it automatically.
class_kit_item.png
I've tried writing it on category, after "Class Kit", before "Class Kit", and all other text boxes and nothing seems to work.
-
July 15th, 2021, 13:35 #2
- Join Date
- Jan 2021
- Posts
- 39
Solved.
I found the script that manages it and I found out that the item name must be [class name] + class kit.
function addClassKit(_, nodeChar)
GlobalDebug.consoleObjects("CharManager.addClassKi t. nodeChar = ", nodeChar);
local sClassLevel = DB.getValue(nodeChar, "classlevel", "");
if sClassLevel ~= "" then
local sClass = string.match(sClassLevel, "^(.+)%s+%d+");
if (sClass or "") ~= "" then
local sItemName = sClass .. " class kit";
local aItemPaths = { "reference.equipment", "reference.weapon", "reference.armor", "reference.magicitems", "item" };
local nodeItem = nil;
-- Get item nodes globally
local itemMatchNode = ManagerGetRefData.getRecordGlobally(sItemName, aItemPaths);
if itemMatchNode then
nodeItem = ItemManager.addItemToList(DB.createChild(nodeChar, "inventorylist"), "item", itemMatchNode, false, 1);
-- Trigger new_item automation on the added item
AutomationManager.processAutomation(nodeChar, nodeItem, "new_item");
end
end
end
end
-
July 15th, 2021, 19:59 #3
Good investigative skills!
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks