Knockback.

Knockback.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Knockback.

Post 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?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knockback.

Post 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)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post 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?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Knockback.

Post by zwzsg »

Good luck, doing it right won't be an easy task.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post by smoth »

yeah, well someone has to, I am tried of watching units amble around while taking hits from 360mm rockets.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knockback.

Post 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:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post by smoth »

emanuel was unbanned and came back a much better behaved person. I don't know if he is banned again though.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Knockback.

Post by FLOZi »

Just use weapon impulse with sensible values, and HitByWeapon callin in cob/LUS for the animation.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Knockback.

Post 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..
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post 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...
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knockback.

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post by smoth »

would be cinematic in nature.. as in a guy roaring or a building blowing up.. not a weapon persay..
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Knockback.

Post 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?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Knockback.

Post 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 :(
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Knockback.

Post 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.
Post Reply

Return to “Lua Scripts”