Bleksmits Posted September 6, 2014 Share Posted September 6, 2014 In my deerclops horn mood i can't add to play animation with my creation its always play with different item default horn or pan flute depends what is in [inst:AddTag("flute")] or [inst:AddTag("horn")]not mine. When i wrote [inst:AddTag("rags")] nothing hapen's. rags mean horn in my language:) local Assets ={ Asset("ANIM", "anim/rags_build.zip"), Asset("ATLAS", "images/inventoryimages/rags.xml"),local function onfinished(inst) inst:Remove()endlocal function TryAddFollower(leader, follower) -- no erors if leader.components.leader and follower.components.follower and follower:HasTag("beefalo") and not follower:HasTag("baby") and leader.components.leader:CountFollowers("beefalo") < TUNING.HORN_MAX_FOLLOWERS then leader.components.leader:AddFollower(follower) follower.components.follower:AddLoyaltyTime(TUNING.HORN_EFFECTIVE_TIME+math.random()) if follower.components.combat and follower.components.combat.target and follower.components.combat.target == leader then follower.components.combat:SetTarget(nil) end follower:DoTaskInTime(math.random(), function() follower.sg:PushEvent("heardhorn", {musician = leader} )end) endend -- !!local function HearRags(inst, musician, instrument) -- OK no errors if musician.components.leader then local herd = nil if inst:HasTag("beefalo") and not inst:HasTag("baby") and inst.components.herdmember then if inst.components.combat and inst.components.combat.target then inst.components.combat:GiveUp() end TryAddFollower(musician, inst) herd = inst.components.herdmember:GetHerd() end if herd and herd.components.herd then for k,v in pairs(herd.components.herd.members) do TryAddFollower(musician, k) end end endend -- OKlocal function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst:AddTag("flute") -- !!!??? MakeInventoryPhysics(inst) inst.AnimState:SetBank("horn") inst.AnimState:SetBuild("rags_build") inst.AnimState:PlayAnimation("idle") MakeInventoryPhysics(inst) inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/rags.xml" inst:AddComponent("inspectable") inst:AddComponent("instrument") inst.components.instrument.range = TUNING.HORN_RANGE inst.components.instrument:SetOnHeardFn(HearRags) inst:AddComponent("tool") inst.components.tool:SetAction(ACTIONS.PLAY) inst:AddComponent("fuel") -- ok inst.components.fuel.fuelvalue = TUNING.MED_FUEL -- ok can burn return instendSTRINGS.NAMES.RAGS = "Litle hornelio"STRINGS.CHARACTERS.GENERIC.DESCRIBE.RAGS = "Should something do but don't!"return Prefab( "common/inventory/rags", fn, Assets) Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/ Share on other sites More sharing options...
Mobbstar Posted September 6, 2014 Share Posted September 6, 2014 (edited) Tags don't change how the thing works, they only let other things know what it is. Turns out the WilsonStateGraph handles the "Play"-action by checking for the horn/flute tag to determine the animations to be played.Two ways to get your animation working is by overriding WilsonSG or changing the characters stategraph to one of your own. In both scenarios, another mod that does these ways will not work, keep yours from working or crash the game. Sorry, I can't help more. Edited September 6, 2014 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/#findComment-531954 Share on other sites More sharing options...
Bleksmits Posted September 6, 2014 Author Share Posted September 6, 2014 Tags don't change how the thing works, they only let other things know what it is. Turns out the WilsonStateGraph handles the "Play"-action by checking for the horn/flute tag to determine the animations to be played.Two ways to get your animation working is by overriding WilsonSG or changing the characters stategraph to one of your own. In both scenarios, another mod that does these ways will not work, keep yours from working or crash the game. Sorry, I can't help more. Thanks! I'll see what I can do. Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/#findComment-531962 Share on other sites More sharing options...
lynn Posted September 6, 2014 Share Posted September 6, 2014 Take a look at Puppy PrincessThere's a custom flute there, the musha_play.lua file seems to do what you are missing. Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/#findComment-531967 Share on other sites More sharing options...
Bleksmits Posted September 6, 2014 Author Share Posted September 6, 2014 Take a look at Puppy PrincessThere's a custom flute there, the musha_play.lua file seems to do what you are missing. Thanks! i very appreciate it! Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/#findComment-531975 Share on other sites More sharing options...
Bleksmits Posted September 6, 2014 Author Share Posted September 6, 2014 Success! Oh thanks very much both of you! we made it! musha_play.lua helped me out. Link to comment https://forums.kleientertainment.com/forums/topic/40436-help-how-to-replace-horn-or-flute-animation-with-different-item/#findComment-532061 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