Unit being pushed by exploding objects?

Unit being pushed by exploding objects?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Unit being pushed by exploding objects?

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

Re: Unit being pushed by exploding objects?

Post by smoth »

Impulse. Set it to zero.. it isn't worth the hassle.
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Re: Unit being pushed by exploding objects?

Post by Zhall »

Code: Select all

    impulseboost = 0,
    impulsefactor = 0,
It already was set to 0??
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Unit being pushed by exploding objects?

Post by smoth »

check the death explosion.
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Re: Unit being pushed by exploding objects?

Post 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 ;/
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Unit being pushed by exploding objects?

Post by FLOZi »

You need to find where the "TANKDEATH" weapon is defined
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Re: Unit being pushed by exploding objects?

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Unit being pushed by exploding objects?

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

Re: Unit being pushed by exploding objects?

Post 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
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Re: Unit being pushed by exploding objects?

Post 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?
Last edited by Zhall on 29 Jul 2014, 23:51, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Unit being pushed by exploding objects?

Post by smoth »

are you mistaking units for the exploded piece maybe? that isn't a unit.
Zhall
Posts: 46
Joined: 19 Jul 2014, 02:21

Re: Unit being pushed by exploding objects?

Post by Zhall »

Adding mass helped.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Unit being pushed by exploding objects?

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

Return to “Game Development”