Jump to content

Scripted items access throug lua


francogp

Recommended Posts

22 minutes ago, EnigmaGrey said:

Take a look at ScriptManager in the Lua files. You can then use it to get an Item or Recipe object and alter its properties directly. Hopefully I'm not wrong about that. :P

I can't find any lua file using that ScriptManager  :(

Link to comment
Share on other sites

 

Search "scriptmanager" (9 hits in 7 files)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\ISUI\ISInventoryPaneContextMenu.lua (1 hit)
	Line 1501: 	local item = ScriptManager.instance:FindItem(itemType)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\LastStand\ISUI\ISChallenge2VariousItemWindow.lua (1 hit)
	Line 71: 	local item = ScriptManager.instance:getItem(itemType)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\LastStand\ISUI\ISChallenge2WeaponUpWindow.lua (1 hit)
	Line 61: 	local item = ScriptManager.instance:getItem(itemType)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\Tests\RecipeTests.lua (3 hits)
	Line 316: 	local recipe = ScriptManager.instance:getRecipe("Base.Make Mattress")
	Line 350: 	local recipe = ScriptManager.instance:getRecipe("Base.Clean Bandage")
	Line 377: 	local recipe = ScriptManager.instance:getRecipe("Base.Rip sheets")
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\TimedActions\ISDumpContentsAction.lua (1 hit)
	Line 49: 	local item = ScriptManager.instance:FindItem(itemType)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Farming\ScavengeDefinition.lua (1 hit)
	Line 245: 	local item = ScriptManager.instance:FindItem(v.type)
  C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\ItemPicker.lua (1 hit)
	Line 247:     local item = ScriptManager.instance:FindItem(itemname)

 

 

Link to comment
Share on other sites

Just now, ShuiYin said:

If only we can override recipes too and avoid duplicate recipes. Pls if someone know how to do it will really make modding much easier and less conflicting.

in the pinned tutorial there's a way to override scripted items. If you only want to modify them, you should use the code that I post in this thread.

Link to comment
Share on other sites

19 hours ago, francogp said:

in the pinned tutorial there's a way to override scripted items. If you only want to modify them, you should use the code that I post in this thread.

Really? Ill check again. Last time i looked i cant find a way to override vanilla recipes using lua. I can override object properties in game tho using lua.

 

I remember now i can get the recipes but there is no set method that can change the recipe properties. If you can  i think many modders want to know this

 

or we can approach from another angle: is there a way through lua to delete current existing recipe? i think this one should be easier to do, ill post in help section hopefully someone can come up with something

Edited by ShuiYin
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...