Jump to content

Recommended Posts

I can't seem to make anything work...

Can anyone help?

 

Don't expect someone to help you when you didn't provide any detials on the problem and didn't upload what you have done so far.

Your thread is pure spam without that info and code.

Don't expect someone to help you when you didn't provide any detials on the problem and didn't upload what you have done so far.

Your thread is pure spam without that info and code.

 

Sorry, you are right.

 

The problem i have is making the armor craftable. 

The other problem i have is the item has no logo in my inventory.

 

Both of are them the same case: I have absolutely NO idea how to fix it.

Sorry, you are right.

 

The problem i have is making the armor craftable. 

The other problem i have is the item has no logo in my inventory.

 

Both of are them the same case: I have absolutely NO idea how to fix it.

The inventory imge (I think that what you mean by logo) is in this example prefab:

http://forums.kleientertainment.com/files/file/202-sample-mods/

You need to declare image atlas in assets:

Asset("ATLAS", "images/inventoryimages/mech_"..data.name.."_item.xml"),

then use i

inst:AddComponent("inventoryitem")		inst.components.inventoryitem.atlasname = "images/inventoryimages/mech_"..data.name.."_item.xml"			    		

t in your prefab function

 

Making something craftable you need to add things into your modmain file:

local Ingredient = GLOBAL.Ingredientlocal RECIPETABS = GLOBAL.RECIPETABSlocal TECH = GLOBAL.TECHlocal mech_hay_item = GLOBAL.Recipe("mech_hay_item", {Ingredient("wall_hay_item", 1), Ingredient("goldnugget", 2),Ingredient("gears", 1)}, RECIPETABS.TOWN, TECH.SCIENCE_TWO, nil, nil, nil, 1)mech_hay_item.atlas = "images/inventoryimages/mech_hay_item.xml"

something lile above but with your item and things needed to craft it

 

 

Crafting (modmain.lua):

local rep1= GLOBAL.Recipe("ARMOR", {Ingredient("marble", 4)}, GLOBAL.RECIPETABS.WAR, GLOBAL.TECH.SCIENCE_ONE)rep1.atlas = "images/INVENTORYICON.xml"

Icon (Prefab file):

local assets={--other stuff    Asset("ATLAS", "images/inventoryimages/darktool_inv.xml"),    Asset("IMAGE", "images/inventoryimages/darktool_inv.tex"),}--stufflocal function fn(Sim)    local inst = CreateEntity()    --stuff    inst:AddComponent("inventoryitem")    inst.components.inventoryitem.atlasname = "images/inventoryimages/darktool_inv.xml"    inst.components.inventoryitem.imagename = "darktool_inv"    --stuff    return instend

EDIT: Got ninja'ed :wilson_resigned:

Edited by Mobbstar

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...