-
January 8th, 2025, 15:55 #1
- Join Date
- Feb 2021
- Posts
- 449
NPCs added to CT have attack weapons set to unidentified
Having attacks set to identified causes problems, I am trying to find out how to make sure they are all set to identified when added to the CT. There is a function in the manager_combat2.lua in my ruleset called "onNPCPostAdd"
-- Setup Attacks
for _, nodeWeapon in pairs(DB.getChildren(tCustom.nodeCT, "weapons")) do
if DB.getValue(nodeWeapon, "name", "") == "" and DB.getValue(nodeWeapon, "type", "") == "" then
nodeWeapon.delete();
else
ItemManager2.UpdateToCoreRPG(nodeWeapon);
DB.setValue(nodeWeapon, "open", "windowreference", "item", "");
DB.setValue(nodeWeapon, "locked", "number", 0);
end
end
Any ideas on how I would set the weapons to "identified" and make sure that the DB.xml is populated with the information as if I clicked on "identified" icon? Thanks. unident.PNG
-
January 9th, 2025, 00:55 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,685
Why not just fix the code in the attacks that has problems with the identification state?
"isidentified" is the name of the field that controls the identification state. You can force by using DB.setValue(node, "isidentified", "number", 1).
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks