rons0n Posted November 29, 2015 Share Posted November 29, 2015 (edited) So I've asked similar things like this before and they all worked great. Special effects on crafting itemsSpecial effects on weaponsSpecial effects when opponents are attackedSpecial effects when just moving around but I haven't a single idea how to give special effects just by regularly punching things with your fist.Someone toss me a bone here? Would appreciate it very much! Example: When my character punches the target I want the "mossling_spin_fx" on the target that's being hit. I hate asking for more but is it also possible for my character to do ZERO damage when using anything on his hand-slot(Aka all hand-equippable items that cause damage) Edited November 29, 2015 by rons0n Link to comment Share on other sites More sharing options...
Mobbstar Posted November 29, 2015 Share Posted November 29, 2015 Try "onattackother" event/callback-function, then test for whether the player holds something in the hands slot (inventory component). As for the second question, maybe you could set the default damage to negative weapon damage upon switching gear? Or the multiplier to zero? You'd have to listen for changes from the inventory component. Link to comment Share on other sites More sharing options...
DarkXero Posted November 29, 2015 Share Posted November 29, 2015 -- Effect on naked attack inst:ListenForEvent("onattackother", function(inst, data) if data.target ~= nil and data.weapon == nil then local pos = data.target:GetPosition() local fx = SpawnPrefab("mossling_spin_fx") fx.Transform:SetPosition(pos.x, pos.y, pos.z) end end) -- No damage with weapons local _od = inst.components.combat.CalcDamage inst.components.combat.CalcDamage = function(self, target, weapon, multiplier) if weapon ~= nil then multiplier = 0 end return _od(self, target, weapon, multiplier) end Link to comment Share on other sites More sharing options...
rons0n Posted November 29, 2015 Author Share Posted November 29, 2015 (edited) @Mobbstar, Thanks Mobbstar for the Idea! And Thanks @DarkXero for literally making that idea work! I appreciate both of you helping me out! But out of curiosity: What If I wanted the effect to follow the target? For example I have:local function onattack(inst, attacker, target) local atkfx = SpawnPrefab("mossling_spin_fx") if atkfx then local follower = atkfx.entity:AddFollower() follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0 ) endendSo the effect follows the target as it moves. But I only applied this to a weapon. I tried doing the same thing with your code but I seemed to have derped. Why did I derp? Edited November 29, 2015 by rons0n Link to comment Share on other sites More sharing options...
DarkXero Posted November 29, 2015 Share Posted November 29, 2015 So the effect follows the target as it moves. -- Effect on naked attack inst:ListenForEvent("onattackother", function(inst, data) if data.target ~= nil and data.weapon == nil then local fx = SpawnPrefab("mossling_spin_fx") local follower = fx.entity:AddFollower() follower:FollowSymbol(data.target.GUID, data.target.components.combat.hiteffectsymbol, 0, 0, 0) end end) Link to comment Share on other sites More sharing options...
rons0n Posted November 29, 2015 Author Share Posted November 29, 2015 @DarkXero, Thanks! As usual, my greatest Gratitude! Link to comment Share on other sites More sharing options...
rons0n Posted November 30, 2015 Author Share Posted November 30, 2015 I know I'm asking far too much questions but I hope 1 more doesn't kill anyone: So my Caped Baldy is almost finished, but I want to add one more trait into him. Is there any way he can cause radius damage per hit? Something like the Abigail ghost except rather it being ticks it'd be per attack. If this is too far-fetched I apologize but I'd appreciate the input! Link to comment Share on other sites More sharing options...
Mobbstar Posted November 30, 2015 Share Posted November 30, 2015 (edited) @rons0n,--this goes to the "onattackother" partlocal pt = inst:GetPosition()for k,v in pairs(TheSim:FindEntities(pt.x,pt.y,pt.z,RADIUS)) do if v and v:IsValid() and v.components.combat then --blablabla you can do this part on your own can't you? endend EDIT: Nice pun, just noticed it. And when I did, it hit me hard... *cricket noise* Edited November 30, 2015 by Mobbstar Link to comment Share on other sites More sharing options...
DarkXero Posted November 30, 2015 Share Posted November 30, 2015 You can also use something like the Deerclopsinst.components.combat:SetAreaDamage(RANGE, MULTIPLIER)so if RANGE equals 30, and MULTIPLIER equals 1, your normal damage attack will extend all over the screen. Link to comment Share on other sites More sharing options...
rons0n Posted November 30, 2015 Author Share Posted November 30, 2015 @DarkXero, @Mobbstar, Thank you both so much for your Advice and Help! Now a certain Hobby Super-Hero can take down enemies with one fatal swoop! I wish I could do more than just shout out you guys every time! Link to comment 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