memcallen Posted June 8, 2016 Share Posted June 8, 2016 First, what's the syntax for the makeplacer function/class. I know that it's something along the lines of 'MakePlacer("placername","prefab","prefab", start anim)' but I can't find it anywhere in the main code. Also, my item (which is based off of gold nuggets) doesn't have a texture. I copied the files for gold nuggets (I hope), but the item doesn't show up. This is my item file: Spoiler local assets= { Asset("ANIM", "anim/gold_nugget.zip"), } local function shine(inst) inst.task = nil inst.AnimState:PlayAnimation("sparkle") inst.AnimState:PushAnimation("idle") inst.task = inst:DoTaskInTime(4+math.random()*5, function() shine(inst) end) end local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddPhysics() MakeInventoryPhysics(inst) inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" ) inst.AnimState:SetBank("goldnugget") inst.AnimState:SetBuild("gold_nugget") inst.AnimState:PlayAnimation("idle") inst:AddComponent("edible") inst.components.edible.foodtype = "ELEMENTAL" inst.components.edible.hungervalue = 2 inst:AddComponent("tradable") inst:AddComponent("inspectable") inst:AddComponent("stackable") inst:AddComponent("inventoryitem") shine(inst) return inst end return Prefab( "common/inventory/coppernugget", fn, assets) Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/ Share on other sites More sharing options...
Mobbstar Posted June 8, 2016 Share Posted June 8, 2016 You need to set the custom icon like so: inst.components.inventoryitem.atlasname = "images/inventoryitems/coppernugget.xml" MakePlacer(name, bank, build, anim, ongroundorientation, snap, metersnap, scale) is defined in "data/scripts/prefabutil.lua". Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/#findComment-781169 Share on other sites More sharing options...
memcallen Posted June 8, 2016 Author Share Posted June 8, 2016 Thanks for prefabutil, and I got my texture to work. How do I fix 'missing name'? Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/#findComment-781176 Share on other sites More sharing options...
Mobbstar Posted June 8, 2016 Share Posted June 8, 2016 21 minutes ago, memcallen said: Thanks for prefabutil, and I got my texture to work. How do I fix 'missing name'? Missing name what? XD Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/#findComment-781183 Share on other sites More sharing options...
memcallen Posted June 8, 2016 Author Share Posted June 8, 2016 My item doesn't have a name so it defaulted to 'Missing name', and me being a noob to don't starve modding, I have no idea how to fix it. Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/#findComment-781185 Share on other sites More sharing options...
Mobbstar Posted June 9, 2016 Share Posted June 9, 2016 20 hours ago, memcallen said: My item doesn't have a name so it defaulted to 'Missing name', and me being a noob to don't starve modding, I have no idea how to fix it. You need to set a name "string" via modmain.lua like so GLOBAL.STRINGS.NAMES.ITEMNAME = "Fancy Name" Link to comment https://forums.kleientertainment.com/forums/topic/68018-syntax-for-makeplacer-and-question-about-zip-anims/#findComment-781550 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now