TheShadeofTheNorth Posted July 8, 2015 Share Posted July 8, 2015 So,someone knows the combat trigger of the game, when the game recognizes a combat have started? I need this to make a berseker character,who can randomly rage when a combat start. Thank you guys! Link to comment https://forums.kleientertainment.com/forums/topic/55978-combat-trigger/ Share on other sites More sharing options...
Mobbstar Posted July 8, 2015 Share Posted July 8, 2015 Um, you mean when the player attacks something or gets attacked? listen for the events "attacked" and "onhitother" Link to comment https://forums.kleientertainment.com/forums/topic/55978-combat-trigger/#findComment-652592 Share on other sites More sharing options...
TheShadeofTheNorth Posted July 8, 2015 Author Share Posted July 8, 2015 (edited) These events are in the combat component,right? I know this code isn't right, but i'm going the right way? local Rage = function(inst) inst:ListenForEvent("attacked", function(inst,data) end) end) local function ToRage() To rage this needs to happen. end Edited July 8, 2015 by TheShadeofTheNorth Link to comment https://forums.kleientertainment.com/forums/topic/55978-combat-trigger/#findComment-652658 Share on other sites More sharing options...
TheShadeofTheNorth Posted July 10, 2015 Author Share Posted July 10, 2015 (edited) local Rage = function(inst) local player = GetPlayer() local init_damage = damageinst:DoPeriodicTask(1, function() if damage > 0 and self.inst.components.health:IsInvincible() == false then local RageChance = math.random()end if RageChance > 0.5 then inst.components.combat.damagemultiplier = TUNING.WATHGRITHR_DAMAGE_MULT * 2inst.components.locomotor.walkspeed = 12 inst.components.locomotor.runspeed = 12else inst.components.combat.damagemultiplier = TUNING.WATHGRITHR_DAMAGE_MULT inst.components.locomotor.walkspeed = 4 inst.components.locomotor.runspeed = 6endend)endI'm messing with the code , no crashes, but it isn't working, i think. Edited July 10, 2015 by TheShadeofTheNorth Link to comment https://forums.kleientertainment.com/forums/topic/55978-combat-trigger/#findComment-653133 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