Jump to content

looter

Member
  • Posts

    3
  • Joined

  • Last visited

looter's Achievements

  1. I would like to request that ScriptManager.ModuleMap be retrievable, and that all of the fields within ScriptModule be readable as well. This would allow Lua scripts to read, write and interact with every item loaded into the game. For instance to store a reference to every available item in the game you could use the following code. local gameMods = getScriptManager():getModuleMap() local gameItems = {} for modName, modObj in pairs( gameMods ) do for itemID, itemData in pairs( modObj:getItemMap() ) do local tbl = { mod: modName, id: itemID, data: itemData } table.insert( gameItems, tbl ) end end for _, gameItem in pairs( gameItems ) do print( string.format( "Mod: %s Item: %s\n", tostring( gameItem.mod ), tostring( gameItem.id ) ) ) end This would eliminate the need for members of the community to manually parse individual mods media/scripts/<script>.txt files to build compatibility with each-other. Alternatively TIS can simply implement getAllItems() , similar to getAllRecipes().
×
×
  • Create New...