ArcanaCapra Posted May 23, 2018 Share Posted May 23, 2018 So, I'm pretty new to modding and am currently working on one with my friend. I'm handling part of the code, and we would the effect that is on the title, however, I have very little experience and no idea how to make that happen: the player character unable to hit an enemy that isn't moving, missing the hit, or causing 0 damage, or something like that. So, is it possible? How would I be able to do that? Link to comment https://forums.kleientertainment.com/forums/topic/91028-solved-making-characters-attacks-miss-enemies-that-are-not-moving/ Share on other sites More sharing options...
ArcanaCapra Posted May 24, 2018 Author Share Posted May 24, 2018 Well, by trial and error I figured out how to make the ''don't damage the enemy'' part by reducing my own attack multiplier to 0. Problem is, I can't get it back to the normal state. So once I attack an idle enemy, my damage is going to be 0 for the rest of the game. Any ideas on how I can make this work? This is what I'm doing: inst:ListenForEvent ("onattackother", function (inst, data) if data.target.sg:HasStateTag("idle") then inst.components.combat.damagemultiplier = 0 return end end) Link to comment https://forums.kleientertainment.com/forums/topic/91028-solved-making-characters-attacks-miss-enemies-that-are-not-moving/#findComment-1037638 Share on other sites More sharing options...
K1NGT1GER609 Posted May 24, 2018 Share Posted May 24, 2018 I'll eye ball it and say try this inst:ListenForEvent ("onattackother", function (inst, data) if data.target.sg:HasStateTag("idle") then inst.components.combat.damagemultiplier = 0 else inst.components.combat.damagemultiplier = 1 return end end) Link to comment https://forums.kleientertainment.com/forums/topic/91028-solved-making-characters-attacks-miss-enemies-that-are-not-moving/#findComment-1037639 Share on other sites More sharing options...
ArcanaCapra Posted May 24, 2018 Author Share Posted May 24, 2018 Yeah, it worked! Thanks a million! Link to comment https://forums.kleientertainment.com/forums/topic/91028-solved-making-characters-attacks-miss-enemies-that-are-not-moving/#findComment-1037644 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