饥荒mod吧 关注:57,871贴子:235,544
  • 6回复贴,共1

『04-21』【问题求助】自制人物mod进游戏后变透明

取消只看楼主收藏回复

楼主特别喜欢夏洛克= =于是乎打算自己做一个夏洛克
根据这个贴的教程http://tieba.baidu.com/p/2389518224,完成后进入游戏,发现我做完的人物是透明的,也就是在游戏里完全看不见我的人物。。。相当于人物消失了、、玩还是能正常玩
不知道是哪一步出了问题。。。在线等待解决~~


IP属地:上海1楼2014-04-21 13:59回复
    额= =那个教程的地址发错了 是这个http://tieba.baidu.com/p/2462089633
    我怀疑是贴图除了问题 可明明是按照上面做的吖


    IP属地:上海2楼2014-04-21 14:01
    回复
      @自语着503
      灰常感谢~!!!再问最后一个问题,我想要拿着武器A时自动回复脑残值,应该添加什么代码呢?
      我找到这两个代码
      ①天生自带SAN回复 inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE
      将LARGE改为以下语句则可以调整回复速度
      ②inst:AddComponent("sanityaura")
      inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL
      第一个是用于人物角色,第二个虽然是用于武器,但却是靠近回复san值,而不是我需要的拿在手上装备回复san值。。。。


      IP属地:上海8楼2014-04-22 23:05
      收起回复
        = =原谅我真的一句都看不懂 完全没学过
        这是影刀的 不知道哪一句是管恢复脑残的
        @自语着503
        local assets=
        {
        Asset("ANIM", "data/anim/nightmaresword.zip"),
        Asset("ANIM", "data/anim/swap_nightmaresword.zip"),
        }
        local function onfinished(inst)
        inst:Remove()
        end
        local function onequip(inst, owner)
        owner.AnimState:OverrideSymbol("swap_object", "swap_nightmaresword", "swap_nightmaresword")
        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 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("nightmaresword")
        inst.AnimState:PlayAnimation("idle")
        inst.AnimState:SetMultColour(1, 1, 1, 0.6)
        inst:AddTag("shadow")
        inst:AddTag("sharp")
        inst:AddComponent("weapon")
        inst.components.weapon:SetDamage(TUNING.NIGHTSWORD_DAMAGE)
        -------
        inst:AddComponent("finiteuses")
        inst.components.finiteuses:SetMaxUses(TUNING.NIGHTSWORD_USES)
        inst.components.finiteuses:SetUses(TUNING.NIGHTSWORD_USES)
        inst.components.finiteuses:SetOnFinished( onfinished )
        inst:AddComponent("inspectable")
        inst:AddComponent("inventoryitem")
        inst:AddComponent("dapperness")
        inst.components.dapperness.dapperness = TUNING.CRAZINESS_MED,
        inst:AddComponent("equippable")
        inst.components.equippable:SetOnEquip( onequip )
        inst.components.equippable:SetOnUnequip( onunequip )
        return inst
        end
        return Prefab( "common/inventory/nightsword", fn, assets)


        IP属地:上海9楼2014-04-22 23:16
        收起回复
          @自语着503 这是我在Don't starve\data\scripts\prefabs\hats里找到的代码
          奇怪的是,海象帽、花环什么的都能回复脑残,照理说我应该能找到一段相同的代码(除了后面了SMALL、MED什么的不一样),那段代码便是回复脑残的。但是居然没有找到。。。


          IP属地:上海13楼2014-04-24 21:13
          回复
            function MakeHat(name)
            local fname = "hat_"..name
            local symname = name.."hat"
            local texture = symname..".tex"
            local prefabname = symname
            local assets=
            {
            Asset("ANIM", "anim/"..fname..".zip"),
            --Asset("IMAGE", texture),
            }
            if name == "miner" then
            table.insert(assets, Asset("ANIM", "anim/hat_miner_off.zip"))
            end
            local function onequip(inst, owner, fname_override)
            local build = fname_override or fname
            owner.AnimState:OverrideSymbol("swap_hat", build, "swap_hat")
            owner.AnimState:Show("HAT")
            owner.AnimState:Show("HAT_HAIR")
            owner.AnimState:Hide("HAIR_NOHAT")
            owner.AnimState:Hide("HAIR")
            if owner:HasTag("player") then
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")
            end
            if inst.components.fueled then
            inst.components.fueled:StartConsuming()
            end
            end
            local function onunequip(inst, owner)
            owner.AnimState:Hide("HAT")
            owner.AnimState:Hide("HAT_HAIR")
            owner.AnimState:Show("HAIR_NOHAT")
            owner.AnimState:Show("HAIR")
            if owner:HasTag("player") then
            owner.AnimState:Show("HEAD")
            owner.AnimState:Hide("HEAD_HAIR")
            end
            if inst.components.fueled then
            inst.components.fueled:StopConsuming()
            end
            end
            local function opentop_onequip(inst, owner)
            owner.AnimState:OverrideSymbol("swap_hat", fname, "swap_hat")
            owner.AnimState:Show("HAT")
            owner.AnimState:Hide("HAT_HAIR")
            owner.AnimState:Show("HAIR_NOHAT")
            owner.AnimState:Show("HAIR")
            owner.AnimState:Show("HEAD")
            owner.AnimState:Hide("HEAD_HAIR")
            if inst.components.fueled then
            inst.components.fueled:StartConsuming()
            end
            end
            local function simple()
            local inst = CreateEntity()
            inst.entity:AddTransform()
            inst.entity:AddAnimState()
            MakeInventoryPhysics(inst)
            inst.AnimState:SetBank(symname)
            inst.AnimState:SetBuild(fname)
            inst.AnimState:PlayAnimation("anim")
            inst:AddTag("hat")
            inst:AddComponent("inspectable")
            inst:AddComponent("inventoryitem")
            inst:AddComponent("tradable")
            inst:AddComponent("equippable")
            inst.components.equippable.equipslot = EQUIPSLOTS.HEAD
            inst.components.equippable:SetOnEquip( onequip )
            inst.components.equippable:SetOnUnequip( onunequip )
            return inst
            end
            local function bee()
            local inst = simple()
            inst:AddComponent("armor")
            inst.components.armor:InitCondition(TUNING.ARMOR_BEEHAT, TUNING.ARMOR_BEEHAT_ABSORPTION)
            inst.components.armor:SetTags({"bee"})
            return inst
            end
            local function generic_perish(inst)
            inst:Remove()
            end
            local function earmuffs()
            local inst = simple()
            inst:AddComponent("insulator")
            inst.components.insulator.insulation = TUNING.INSULATION_SMALL
            inst.components.equippable:SetOnEquip( opentop_onequip )
            inst:AddComponent("fueled")
            inst.components.fueled.fueltype = "USAGE"
            inst.components.fueled:InitializeFuelLevel(TUNING.EARMUFF_PERISHTIME)
            inst.components.fueled:SetDepletedFn(generic_perish)
            inst.AnimState:SetRayTestOnBB(true)
            return inst
            end
            local function winter()
            local inst = simple()
            inst:AddComponent("dapperness")
            inst.components.dapperness.dapperness = TUNING.DAPPERNESS_TINY
            inst:AddComponent("insulator")
            inst.components.insulator.insulation = TUNING.INSULATION_MED
            inst:AddComponent("fueled")
            inst.components.fueled.fueltype = "USAGE"
            inst.components.fueled:InitializeFuelLevel(TUNING.WINTERHAT_PERISHTIME)
            inst.components.fueled:SetDepletedFn(generic_perish)
            return inst
            end
            local function football()
            local inst = simple()
            inst:AddComponent("armor")
            inst.components.armor:InitCondition(TUNING.ARMOR_FOOTBALLHAT, TUNING.ARMOR_FOOTBALLHAT_ABSORPTION)
            return inst
            end
            local function ruinshat_proc(inst, owner)
            inst:AddTag("forcefield")
            inst.components.armor:SetAbsorption(TUNING.FULL_ABSORPTION)
            local fx = SpawnPrefab("forcefieldfx")
            fx.entity:SetParent(owner.entity)
            fx.Transform:SetPosition(0, 0.2, 0)
            local fx_hitanim = function()
            fx.AnimState:PlayAnimation("hit")
            fx.AnimState:PushAnimation("idle_loop")
            end
            fx:ListenForEvent("blocked", fx_hitanim, owner)
            inst.components.armor.ontakedamage = function(inst, damage_amount)
            if owner then
            local sanity = owner.components.sanity
            if sanity then
            local unsaneness = damage_amount * TUNING.ARMOR_RUINSHAT_DMG_AS_SANITY
            sanity:DoDelta(-unsaneness, false)
            end
            end
            end
            inst.active = true
            owner:DoTaskInTime(--[[Duration]] TUNING.ARMOR_RUINSHAT_DURATION, function()
            fx:RemoveEventCallback("blocked", fx_hitanim, owner)
            fx.kill_fx(fx)
            if inst:IsValid() then
            inst:RemoveTag("forcefield")
            inst.components.armor.ontakedamage = nil
            inst.components.armor:SetAbsorption(TUNING.ARMOR_RUINSHAT_ABSORPTION)
            owner:DoTaskInTime(--[[Cooldown]] TUNING.ARMOR_RUINSHAT_COOLDOWN, function() inst.active = false end)
            end
            end)
            end


            IP属地:上海14楼2014-04-24 21:15
            回复
              太长了。。。发不完。。。。。


              IP属地:上海15楼2014-04-24 21:16
              回复