Digi_056 Posted September 7, 2021 Share Posted September 7, 2021 (edited) I'm trying to get these butterflies to attack but they only go to the target and do no damage also as of right now you've gotta manually set them as followers, like with the too many items mod littleshadowbrain.lualittleshadow.lua Edited September 8, 2021 by Player_056 Link to comment https://forums.kleientertainment.com/forums/topic/133381-solvedadding-attack-to-butterfly-followers/ Share on other sites More sharing options...
Monti18 Posted September 8, 2021 Share Posted September 8, 2021 This is a shot in the dark, but did you already add the attack state to the stategraph? It could be that this is preventing them from really attacking. State{ name = "attack", tags = {"attack", "busy"}, onenter = function(inst, target) inst.Physics:Stop() inst.components.combat:StartAttack() inst.AnimState:PlayAnimation("atk") inst.sg.statemem.target = target end, timeline= { TimeEvent(10*FRAMES, function(inst) inst.SoundEmitter:PlaySound(SoundPath(inst, "Attack")) end), TimeEvent(10*FRAMES, function(inst) inst.SoundEmitter:PlaySound(SoundPath(inst, "attack_grunt")) end), TimeEvent(25*FRAMES, function(inst) inst.components.combat:DoAttack(inst.sg.statemem.target) end), }, events= { EventHandler("animover", function(inst) inst.sg:GoToState("idle") end), }, }, This is from SGspider, as you can see the DoAttack function is called in the timeline. 1 Link to comment https://forums.kleientertainment.com/forums/topic/133381-solvedadding-attack-to-butterfly-followers/#findComment-1492238 Share on other sites More sharing options...
Digi_056 Posted September 8, 2021 Author Share Posted September 8, 2021 i haven't done anything with stategraphs yet so that might be my problem exactly, i'll try that YES MUAHAHAHAHA Thanks! Spoiler --added EventHandler("doattack", function(inst) if not (inst.sg:HasStateTag("busy") or inst.components.health:IsDead()) then inst.sg:GoToState("attack") end end), --and State{ name = "attack", tags = { "attack" }, onenter = function(inst, cb) inst.Physics:Stop() inst.components.combat:StartAttack() inst.AnimState:PlayAnimation("flight_cycle") end, timeline = { TimeEvent(15 * FRAMES, function(inst) inst.components.combat:DoAttack() end), }, events = { EventHandler("animover", function(inst) inst.sg:GoToState("idle") end), }, }, Link to comment https://forums.kleientertainment.com/forums/topic/133381-solvedadding-attack-to-butterfly-followers/#findComment-1492336 Share on other sites More sharing options...
Digi_056 Posted September 9, 2021 Author Share Posted September 9, 2021 ok looks like this might be a good reference so here's the fixed up files littleshadowbrain.lua littleshadow.lua SGlittleshadow.lua (should be all) the modmain stuff (except images) Spoiler PrefabFiles = {"littleshadow"} local require = GLOBAL.require local STRINGS = GLOBAL.STRINGS local RECIPETABS = GLOBAL.RECIPETABS local CUSTOM_RECIPETABS = GLOBAL.CUSTOM_RECIPETABS local Recipe = GLOBAL.Recipe local Ingredient = GLOBAL.Ingredient AddRecipe("littleshadow", {Ingredient("nightmarefuel", 1), Ingredient("butterflywings", 1), Ingredient(GLOBAL.CHARACTER_INGREDIENT.SANITY, 5)}, RECIPETABS.MAGIC, TECH.NONE).sortkey = -1 GLOBAL.STRINGS.RECIPE_DESC.LITTLESHADOW = "Swarm your foes in darkness." GLOBAL.STRINGS.NAMES.LITTLESHADOW = "Shadowfly" Link to comment https://forums.kleientertainment.com/forums/topic/133381-solvedadding-attack-to-butterfly-followers/#findComment-1492832 Share on other sites More sharing options...
Fluxistence Posted September 9, 2021 Share Posted September 9, 2021 Thanks, I was genuinely making the additions you wrote when I got the notification that you made this new post with the finished files. Link to comment https://forums.kleientertainment.com/forums/topic/133381-solvedadding-attack-to-butterfly-followers/#findComment-1492835 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