Page 1 of 1

Knockback.

Posted: 18 Nov 2011, 20:09
by smoth
I am unfamilar with the lua move control.. What I want to do is have a large explosion, throw the units around it in a radius away from it. Also I want to trigger an animation when the get knocked back and land to make it look convincing. I also want to allow units to be knocked down and get back up.

How can I get started on this?

Re: Knockback.

Posted: 18 Nov 2011, 20:53
by knorke
but i was never gone?
Spring.AddUnitImpulse, Spring.SetUnitPhysics, looking at gadgets that use movectrl (jumpjets, CT's falling rocks), rotate base piece of units while wiggling the arms so it looks like it has fallen over, set their speed to zero while they recover.

Spring.GetUnitsInSphere (center of explosion)
Spring.MoveCtrl.Enable(unitID)
Spring.MoveCtrl.SetPosition (unitID, x, y, z)

Re: Knockback.

Posted: 18 Nov 2011, 20:56
by smoth
Spring.AddUnitImpulse
I would try this but spring units bounce around like fucking rubber balls(frustrating as hell!)

Spring.AddUnitImpulse
so I just translate the unit?

Re: Knockback.

Posted: 18 Nov 2011, 21:07
by zwzsg
Good luck, doing it right won't be an easy task.

Re: Knockback.

Posted: 18 Nov 2011, 21:11
by smoth
yeah, well someone has to, I am tried of watching units amble around while taking hits from 360mm rockets.

Re: Knockback.

Posted: 18 Nov 2011, 21:17
by knorke
Good luck, doing it right won't be an easy task.
doing it wrong is enough for 99%
Though last person to try was emmanuel and he got banned :shock:

Re: Knockback.

Posted: 18 Nov 2011, 21:21
by smoth
emanuel was unbanned and came back a much better behaved person. I don't know if he is banned again though.

Re: Knockback.

Posted: 18 Nov 2011, 22:38
by FLOZi
Just use weapon impulse with sensible values, and HitByWeapon callin in cob/LUS for the animation.

Re: Knockback.

Posted: 18 Nov 2011, 23:08
by PicassoCT
You could animate it hard, by adding a empty piece as parent, rotating the whole unit while sending it "flying".. but thats very hackish... will look shitty if terrain is rough (unit sinking into the floor)

You could make the unit a projectile and recreate it upon landing... that way you have full controll on the ballistic curve and everything.. including nice dust-sfx when landing..

Re: Knockback.

Posted: 18 Nov 2011, 23:19
by smoth
FLOZi wrote:Just use weapon impulse with sensible values,
And the units bounce when they land.. like a fucking rubber ball.
FLOZi wrote:and HitByWeapon callin in cob/LUS for the animation.
I didn't say they would be knocked back by a weapon, what if I want to have a unit be thrown by another. The gouf custom can lift a section of concrete bridge...
PicassoCT wrote:You could make the unit a projectile and recreate it upon landing... that way you have full controll on the ballistic curve and everything.. including nice dust-sfx when landing..
no animation...

Re: Knockback.

Posted: 18 Nov 2011, 23:37
by knorke
smoth wrote:I didn't say they would be knocked back by a weapon, what if I want to have a unit be thrown by another.
you said "large explosion, throw the units around it in a radius away from it."
Maybe decide what you want or start something and then ask for help on details, no use in guessing or spamming ideas.

Re: Knockback.

Posted: 18 Nov 2011, 23:52
by smoth
would be cinematic in nature.. as in a guy roaring or a building blowing up.. not a weapon persay..

Re: Knockback.

Posted: 19 Nov 2011, 01:25
by FLOZi
You could call it via a gadget if you wanted to, in addition to any particular weapons triggering any particular animations in it.

Tweaking mass vs impulse should minimise rubber-ballery?

Re: Knockback.

Posted: 19 Nov 2011, 01:35
by smoth
I have given them masses >1mil and bounce was not effected. Unless you know something I don't nope they bounce all the same :(

Re: Knockback.

Posted: 19 Nov 2011, 01:49
by Niobium
You could look for hitting-the-ground damage in :PreDamaged, and if it was high enough (Indicating its going to have a noticible bounce) you could destroy it instead, or maybe use MoveCtrl to stop/slow it.