Jump to content

Any way to get a list of game items?


garymevs

Recommended Posts

Can you specify what exactly you're trying to do to clear up the question? If you simply need a static list of the possible in-game items, view items.txt and newitems.txt in the  ProjectZomboid/media/scripts folder.

Link to comment
Share on other sites

I wanted to do something similar to zSpawn as a first step into modding but I didn't want to manually list every single item :/ I would parse the item files but I also wanted to keep support for other mods, any ideas on what I could do?

Link to comment
Share on other sites

Well, the list of items available for the game to use appears to be contained in <THashMap> ItemMap which is generated within an instance of ScriptModule.

 

Edit: I know that may not seem terribly useful, but looking through the java files is starting to make me dizzy. >_< It's somewhere to start. Actually, I'm not sure if a particular module contains all the entries from a particular text file or if each entry is its own module where the parameters are the entries in the hashmap and oh no I've gone crosseyed. . . 

Link to comment
Share on other sites

I have a function in my modding utilities, which converts arrays to lua tables:

 

----- Converts a java arrayList to a lua table. Remember-- that lua tables start at index 1. Thanks to lemmy101.---- @param _arrayList - The arrayList to convert---- @author RoboMat-- @since 1.5.0--function Utility.convertArrayList(_arrayList)	local list = _arrayList;	local itemTable = {};	for i = 0, list:size() - 1 do		table.insert(itemTable, list:get(i));	end	return itemTable;end
Maybe that helps.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...