Page 1 of 1

Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 02:21
by Zhall
Image

Keep an eye on the circled area.

I've added SFX.EXPLODE to all objects on the vehicle I am making (under function script.Killed(recentDamage, maxHealth)) and have discovered an interesting side effect.

It would appear that if these objects hit a unit in the right way it pushes the unit from it's original location.

I suppose I am just missing some collision detection flag or something?

Thanks

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 03:13
by smoth
Impulse. Set it to zero.. it isn't worth the hassle.

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 04:11
by Zhall

Code: Select all

    impulseboost = 0,
    impulsefactor = 0,
It already was set to 0??

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 04:19
by smoth
check the death explosion.

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 10:44
by Zhall
All I see is...

Code: Select all

--Weapons and related
    BadTargetCategory = "NOTAIR",
    ExplodeAs = "TANKDEATH",
    NoChaseCategory = "AIR",
You must excuse me being a newb ;/

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 11:11
by FLOZi
You need to find where the "TANKDEATH" weapon is defined

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 11:21
by Zhall
I searched through the weapons, nothing.

This unit is based off a unit taken from another mod... (therefore it must have extra callouts that don't apply to this mod?)

Is "ExplodeAs" even needed? Can I just remove that line and have it explode off it's own properties?

Thanks

Re: Unit being pushed by exploding objects?

Posted: 26 Jul 2014, 12:06
by FLOZi
explodeAs is a reference to a weapon: http://springrts.com/wiki/Gamedev:UnitD ... :explodeAs

Commenting it out or removing it would be a good first step to double check this is what is causing your impulse woes.

Re: Unit being pushed by exploding objects?

Posted: 27 Jul 2014, 11:36
by knorke
Zhall wrote:It would appear that if these objects hit a unit in the right way it pushes the unit from it's original location.

I suppose I am just missing some collision detection flag or something?
Those exploded pieces deal damage to units, maybe they also come with an impulse.
a) Give your units higher mass to make them less effected by impulse
b) use gadget for less/no damage/impulse

Re: Unit being pushed by exploding objects?

Posted: 29 Jul 2014, 23:42
by Zhall
Commenting it out has no effect.

There is no weapon defined anywhere for that explode as.

I'll try to find out where to add mass? I don't see that inside of the unit definition currently.

EDIT: Setting the unit's mass to 100 solved the problem. Is there any side effects to doing so?

Re: Unit being pushed by exploding objects?

Posted: 29 Jul 2014, 23:50
by smoth
are you mistaking units for the exploded piece maybe? that isn't a unit.

Re: Unit being pushed by exploding objects?

Posted: 29 Jul 2014, 23:51
by Zhall
Adding mass helped.

Re: Unit being pushed by exploding objects?

Posted: 30 Jul 2014, 01:29
by FLOZi
Turns out 'gibs' (unit piece projectiles) impart a (small) default impulse as well as damage.

You can erase this entirely using the UnitPreDamaged callin, but just adding mass is fine http://springrts.com/wiki/Gamedev:UnitDefs#Tag:mass, note that it defaults to metal cost, so if you set that to a sensible value as the cost of the unit you won't have to add mass.

It is also used for;