Unit weapon range buffer question.

Unit weapon range buffer question.

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

Unit weapon range buffer question.

Post by smoth »

Ok so a unit when it goes to fire at a unit, the target must be within it's max range. this is normally ok but for some things this is an issue. Say a unit that has to setup to fire, because that is what I am about to do. Certain units like say the xamel have to use a setup animation before firing.

Image
So take the above picture.
step A: unit sees target goes just into his range(red) and begins aiming animation..
step B: target moves out of range edge. Unit has to move to fire at target.

What happens is a unit moving, stopping, moving stopping over and over again.

so is there a way to have C, a minimum range(represented by green) to unit before it starts aiming to fire at target?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Unit weapon range buffer question.

Post by smoth »

The reason I am asking is I have artillery units which I want to have a 3 second setup animation before they can fire. but the problem is they want to start the animation as soon as A is reached.. which is not close enough..
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Unit weapon range buffer question.

Post by knorke »

dummy weapon and slaveTo?
or get targetID in WeightShot/Blockshot or what the lus callin is called and do some distance calc there.
so is there a way to have C, a minimum range(represented by green) to unit before it starts aiming to fire at target?
I think what you actually want is the unit to start aiming before the target is in range, so the gun will by ready once the enemy is near enough.
Post Reply

Return to “Game Development”