UnitBumped()

UnitBumped()

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

UnitBumped()

Post 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.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: UnitBumped()

Post by yuritch »

Hmm, a ramming attack would be easy to code with that.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: UnitBumped()

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: UnitBumped()

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

Return to “Feature Requests”