Jump to content

Recommended Posts

Also - your images are not the proper dimensions.

They must have a power of 2 instead of 120 x 104 your image should be 128 x 128

instead of 188 x 288 try 128 x 256

and instead of 3200 x 1600 maybe 4096 x 2048 (or 2048 x 1024)

 

I want to note that this /\ is not always necessary. Some people get black squares from improper dimensions. So if there aren't any problems/dead ends, ignore it for now.

Edited by Mobbstar

Also - your images are not the proper dimensions.

They must have a power of 2 instead of 120 x 104 your image should be 128 x 128

instead of 188 x 288 try 128 x 256

and instead of 3200 x 1600 maybe 4096 x 2048 (or 2048 x 1024)

 

 

finally make my weapon can be debug spawn.but still invicible and cannot attack yet

something bothers me why my weapon zips appear two atlas?

atlas-0.tex

atlas-1.tex

 

it appears by its own

I want to note that this /\ is not always necessary. Some people get black squares from improper dimensions. So if there aren't any problems/dead ends, ignore it for now.

 

I was unaware that it wasn't always a problem, it drove me batty trying to figure out why my images weren't showing up properly.

 

I was unaware that it wasn't always a problem, it drove me batty trying to figure out why my images weren't showing up properly.

 

local assets=
{
    Asset("ANIM", "anim/scissor_ground.zip"),
    Asset("ANIM", "anim/swap_scissor.zip"),
 
    Asset("ATLAS", "images/inventoryimages/scissor.xml"),
    Asset("IMAGE", "images/inventoryimages/scissor.tex"),
Asset( "IMAGE", "minimap/scissor.tex" ),
Asset( "ATLAS", "minimap/scissor.xml" ),
}
prefabs = {
}
local function fn()
 
    local function OnEquip(inst, owner)
        owner.AnimState:OverrideSymbol("swap_object", "swap_scissor", "swap_scissor")
        owner.AnimState:Show("ARM_carry")
        owner.AnimState:Hide("ARM_normal")
    end
 
    local function OnUnequip(inst, owner)
        owner.AnimState:Hide("ARM_carry")
        owner.AnimState:Show("ARM_normal")
    end
 
    local inst = CreateEntity()
    local trans = inst.entity:AddTransform()
    local anim = inst.entity:AddAnimState()
    local sound = inst.entity:AddSoundEmitter()
    MakeInventoryPhysics(inst)
 
inst:AddTag("irreplaceable")
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon( "scissor.png" )
     
    anim:SetBank("scissor")
    anim:SetBuild("scissor")
    anim:PlayAnimation("idle")
 
    inst:AddComponent("inspectable")
     
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "scissor"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/scissor.xml"
     
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip( OnEquip )
    inst.components.equippable:SetOnUnequip( OnUnequip )
 
inst:AddComponent("characterspecific")
    inst.components.characterspecific:SetOwner("rvn")
 
    return inst
end

return  Prefab("common/inventory/scissor", fn, assets, prefabs)

i manage to get the weapon(scissor) appear in my inventory but it invisible on ground or holding.

i checked the anime zip files but is nothing wrong . i don't know what missed?

local assets=
{
    Asset("ANIM", "anim/scissor_ground.zip"),
    Asset("ANIM", "anim/swap_scissor.zip"),
 
    Asset("ATLAS", "images/inventoryimages/scissor.xml"),
    Asset("IMAGE", "images/inventoryimages/scissor.tex"),
Asset( "IMAGE", "minimap/scissor.tex" ),
Asset( "ATLAS", "minimap/scissor.xml" ),
}
prefabs = {
}
local function fn()
 
    local function OnEquip(inst, owner)
        owner.AnimState:OverrideSymbol("swap_object", "swap_scissor", "swap_scissor")
        owner.AnimState:Show("ARM_carry")
        owner.AnimState:Hide("ARM_normal")
    end
 
    local function OnUnequip(inst, owner)
        owner.AnimState:Hide("ARM_carry")
        owner.AnimState:Show("ARM_normal")
    end
 
    local inst = CreateEntity()
    local trans = inst.entity:AddTransform()
    local anim = inst.entity:AddAnimState()
    local sound = inst.entity:AddSoundEmitter()
    MakeInventoryPhysics(inst)
 
inst:AddTag("irreplaceable")
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon( "scissor.png" )
     
    anim:SetBank("scissor")
    anim:SetBuild("scissor")
    anim:PlayAnimation("idle")
 
    inst:AddComponent("inspectable")
     
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "scissor"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/scissor.xml"
     
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip( OnEquip )
    inst.components.equippable:SetOnUnequip( OnUnequip )
 
inst:AddComponent("characterspecific")
    inst.components.characterspecific:SetOwner("rvn")
 
    return inst
end

return  Prefab("common/inventory/scissor", fn, assets, prefabs)

i manage to get the weapon(scissor) appear in my inventory but it invisible on ground or holding.

i checked the anime zip files but is nothing wrong . i don't know what missed?

 

well, its the animation I know that. But without looking at the scml and/or the mod, I couldn't say for certain.

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