Page 1 of 1

UnitBumped()

Posted: 04 Mar 2009, 03:17
by Argh
Lua callin. Would return the unitID that has bumped into something, and the ID of the Unit or Feature bumped into.

Could be used for all sorts of physical interactions between Units- everything from physics (pushing) to knocking over Units used as trees, etc.

I'm currently using some code that's cyclical in nature, it's not terribly expensive, but I think that this might be a more effective way of handling such things.

Re: UnitBumped()

Posted: 04 Mar 2009, 08:20
by yuritch
Hmm, a ramming attack would be easy to code with that.

Re: UnitBumped()

Posted: 04 Mar 2009, 16:06
by smoth
we already have unit tags for that yuritch

MinCollisionSpeed - The minimum net impact speed that will cause damage to the unit.

I am not sure but I believe mass also effects this tag.

Re: UnitBumped()

Posted: 04 Mar 2009, 19:28
by Argh
Doesn't work for static objects, Smoth. I'd have to go look at the formula, but my guess is that it's velocity1 * velocity2 * mass1 * mass2 * speed1 * speed2 * someVariable, and that any zeroes mean the damage result is zero.

Moreover, it's not manipulatable via Lua, so it's pretty useless for special work, like building a bumper-car sim or whatever. We don't want damage to result from all collisions, imo- we want an event to happen, that we can then manipulate.