Jump to content

I am having trouble creating custom armor... :(


QuickShot010

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...