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.

xavier2119

[Help Modding] "I can't do that."

Recommended Posts

xavier2119    2

So I get into game to test out a new mod that I am working on and I have the icon show up on the side of the Fight tab that shows me what I need for my item.  I get all the materials and build it, and after it takes my items (as in it would successfully craft it) Wilson says "I can't do that."  

 

 

Any help would be amazing and I greatly appreciate it.  

 

This is also my first mod and I would love to add other things to it as well. 

 

If you need to see code just let me know, im not sure where this error would happen and I will keep a close eye on this thread to fix this issue. 

 

Thanks for your help in advance :)

 

 

 

--Troubled Noob

Share this post


Link to post
Share on other sites
Rosten    928

The best way to get help in this forum is to upload your mod, knowing the issue won't help us much without the code causing it :)

Share this post


Link to post
Share on other sites
xavier2119    2

Alright this is my modmain.lua file 

 

 

-----------

local STRINGS = GLOBAL.STRINGS
local RECIPETABS = GLOBAL.RECIPETABS
local Recipe = GLOBAL.Recipe
local Ingredient = GLOBAL.Ingredient
local TECH = GLOBAL.TECH
GLOBAL.CHEATS_ENABLED = true
GLOBAL.require( 'debugkeys' )
 
 
GLOBAL.STRINGS.NAMES.DBSCYTHE = "Double-Bladed Scythe"
GLOBAL.STRINGS.RECIPE_DESC.DBSCYTHE = "Careful... its a double edged sword?"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.DBSCYTHE = "I am responsible for death!.... Oh wait."
 
PrefabFiles = {
"dbscythe",
}
 
Assets = {
Asset("IMAGE", "images/inventoryimages/dbscythe.tex"),
}
 
local dbscythe = GLOBAL.Recipe("dbscythe", {Ingredient("walrus_tusk",2),Ingredient("rope",2),Ingredient("twigs",4), Ingredient("nightmarefuel", 1)}, RECIPETABS.WAR, TECH.SCIENCE_ONE)
dbscythe.atlas = "images/inventoryimages/dbscythe.xml"
 
--------------------------
 
this is the scripts/prefabs/dbscythe.lua
 
local assets=
{
--Asset("ANIM", "anim/dbscythe.zip"),
--Asset("ANIM", "anim/swap_dbscythe.zip"),
Asset("ANIM", "images/inventoryimages/dbscythe.tex"),
Asset("ANIM", "images/inventoryimages/dbscythe.xml"),
}
 
local function onfinished( inst )
inst:Remove()
end
 
local function onequip(inst, owner)
owner.AnimState:OverrideSymbol("swap_object", "swap_dbscythe", "swap_nightmaresword")
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
 
end
 
local function onunequip( ints, owner )
owner.AnimState:Show("ARM_carry")
owner.AnimState:Hide("ARM_normal")
end
 
local function onattack(inst, attacker, target)
 
end
 
local function fn(Sim)
local inst = CreateEntity()
local trans = inst.entity:AddTransform()
local anim = inst.entity:AddAnimState()
    MakeInventoryPhysics(inst)
 
    inst.AnimState:SetBank("nightmaresword")
    inst.AnimState:SetBuild("dbscythe")
    inst.AnimState:PlayAnimation("idle")
    inst.AnimState:SetMultiColour(1,1,1,1)
 
    inst:AddTag("sharp")
    inst:AddTag("shadow")
 
    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(80)
 
inst:AddComponent("finiteuses")
inst.components.finiteuses:SetMaxUses(200)
inst.components.finiteuses:SetUses(150)
 
inst.components.finiteuses:SetOnFinished( onfinished )
 
inst:AddComponent("inspectable")
 
inst:AddComponent("inventoryitem")
inst.components.inventoryitem.atlasname = "images/inventoryimages/dbscythe.xml"
 
inst:AddComponent("equippable")
inst.components.equippable.walkspeedmult = 2.00
inst.components.equippable:SetOnEquip( onequip )
inst.components.equippable:SetOnUnequip( onunequip )
 
return inst
end
 
--------
 
Hopefully this is what you need. 

Share this post


Link to post
Share on other sites
Rosten    928

Here, try replacing 

Assets = {Asset("IMAGE", "images/inventoryimages/dbscythe.tex"),} local dbscythe = GLOBAL.Recipe("dbscythe", {Ingredient("walrus_tusk",2),Ingredient("rope",2),Ingredient("twigs",4), Ingredient("nightmarefuel", 1)}, RECIPETABS.WAR, TECH.SCIENCE_ONE)dbscythe.atlas = "images/inventoryimages/dbscythe.xml"

With this, also i must ask, what is  inst:AddTag("shadow") im not entirely familiar with all the tags, but what exactly does "shadow" do?

local function load()--[local dbscythe = GLOBAL.Recipe("dbscythe", { Ingredient("walrustusk", 2), Ingredient("rope", 2), Ingredient("twigs", 4), Ingredient("nightmarefuel", 1),  }, RECIPETABS.WAR, {SCIENCE = 1})dbscythe.atlas = "images/inventoryimages/dbscythe.xml" TheSim:LoadPrefabs({"dbscythe"})local dbscythe = GLOBAL.GetRecipe("dbscythe")end

Share this post


Link to post
Share on other sites
Rosten    928

Alright I did that now and my item won't show up in game anymore, is there something else I have to change with that?

It would greatly help if you uploaded the zip of the mod, there may be some image files missing, or maybe i did some of the code wrong, its hard to tell when you only have 1 or 2 bits of the mod :/

Share this post


Link to post
Share on other sites
Rosten    928

Uh well it won't let me upload a zip file of it.  "You aren't permitted to upload this kind of file" buhhh

You sure you're not trying to upload a .rar file? 

i might have heard something about certain things being restricted until you have a amount of forum posts, uploading zips might be one of them, if that is the case try uploading it to mediafire and posting the link here. or sending me a pm with the link

Share this post


Link to post
Share on other sites
Rosten    928

Ahhh I fixed it myself! thank you so much for your help!!!! :DDDDD

No problem, i'm glad it worked out for you, can't wait to use the mod when its released :)

Share this post


Link to post
Share on other sites