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.
UnitBumped()
Moderator: Moderators
Re: UnitBumped()
Hmm, a ramming attack would be easy to code with that.
Re: UnitBumped()
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.
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()
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.
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.