I have been trying for much time to create a slowly flying projectile that can be dodged by strafing. Generally, I did it: the missile flied towards the unit and hit it (disappeared near it) if close enough (I set Impact Range to 0.2). But impact damage always behaved strangely. Sometimes it damaged the unit, sometimes not. I added splash damage area to the Damage effect, but it didn't solve the problem: if the unit stands in place or runs away, it only receives "splash" part of damage, if it runs closer to the attacker, it receives both base and splash damage. How to make the missile always cause the same damage on impact?
Neither am I familiar with Movers. I found somewhere here on the forum the solution for such mechanics: Driver - Throw, Throw Rotation Type - Throw Forward, Throw Forward - 0,-1,0, Throw Vector - 0,-1,0. Maybe the problem is with the mover? Anyway, I have a question considering the mover: how to make it treat correctly the height difference between attacker and target positions? Now, if the attacker is on the upper level cliff, it just throws the projectile forward, and it flies over the target's head. If the attacker is on the lower level cliff, the projectile "jumps" up the cliff. How to make it fly in straight diagonal line towards the target (let it penetrate through the cliff edge, doesn't matter)?
Not sure how the targets manage to escape the direct damage portion. I guess the damage effect is centered on the missile location at the time the "Impact Range" kicks in and/or has a slight trigger delay for some reason. You can always exclude the primary target from the splash but that only makes sense if you can guarantee the main damage. Your damage effect is not set to occur at a Point type target by any chance?
Movers are simple to understand, but hard to flesh out the visuals. The Throw driver forces the missile to move in the given direction (Throw Vector), ignoring the actual target of the effect (though the starting coordinates are usually aligned to face the target at the time of launch, -Y direction is towards the target). Movers seem to need a Guided phase or the Throw may just fly straight into the ground for some reason.
First of all you should explain exactly what kind of behavior you want: a dumbfire projectile that doesn't change trajectory mid-flight like a real-life bullet, one that does track but with limited capability like a modern seeking missile, or something else (magic-always-hit-bullet is the default Guided phase)
For a preset trajectory (dumbfire) note you can aim the Launch Missile effect at Target Point and stick to a guided phase, the missile will always hit where the target was at the time of launch. There are plenty tutorials on colliding missiles if you want it to hit the first/any target in its path (by itself the missile will fly right through any obstacles and always hit the intended target location)
For a slow seeking projectile try to stick with a guided phase and simply limit the turning speed on the mover. The mover also has Timeout field which defines the maximum life time of the missile, you'll have to reduce that or it'll make a huge arcing turn and hit its mark 20 seconds later. Again use colliding missiles if needed, gameplay-wise it's still a magic bullet that zeroes in on one target only it can fail to hit in time.
Thanks for such a detailed answer. It made me try to find tutorials and to extend my experiments (I fear a little to touch something I'm not familiar with :] ), and it seems that it works now as I wanted. Though it differs from your solutions.
I needed simple dumbfire missile that is launched directly towards the initial target and hits the first target on its linear trajectory. Guidance to target point is not a very good choice because target can avoid damage just by stepping back (and it's not realistic). What perfectly solved movement part of the problem is still Throw driver with Look At Target as Throw Rotation Type.
As for damage... You asked if my Damage effect wasn't set to occur at target point. No - I had checked it. But to solve damage issue I had just to use the opposite way - I set Impact Location to Target Point and added an Area (with relatively large Radius and Fraction of 1) to the Damage effect. As far as I tested, it seems to work well - it impacts on unit and deals always the same damage. I suppose that it still can do double damage if unit's position matches center point of the effect, but it looks like the possibility of that is low.
Make a unit. This will be your missile. Make a behavior that constantly orders the unit to move forward.
Make an ability. Have the ability create the unit with an offset that is slightly infront of the caster (use a persistent effect to achieve the offset).
Make a weapon. Give the weapon to the unit. The weapon will deal damage (splash if needed) and suicide the unit.
Sounds simple. It's not. It'll take some time to get everything hooked up properly. Good luck!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have been trying for much time to create a slowly flying projectile that can be dodged by strafing. Generally, I did it: the missile flied towards the unit and hit it (disappeared near it) if close enough (I set Impact Range to 0.2). But impact damage always behaved strangely. Sometimes it damaged the unit, sometimes not. I added splash damage area to the Damage effect, but it didn't solve the problem: if the unit stands in place or runs away, it only receives "splash" part of damage, if it runs closer to the attacker, it receives both base and splash damage. How to make the missile always cause the same damage on impact?
Neither am I familiar with Movers. I found somewhere here on the forum the solution for such mechanics: Driver - Throw, Throw Rotation Type - Throw Forward, Throw Forward - 0,-1,0, Throw Vector - 0,-1,0. Maybe the problem is with the mover? Anyway, I have a question considering the mover: how to make it treat correctly the height difference between attacker and target positions? Now, if the attacker is on the upper level cliff, it just throws the projectile forward, and it flies over the target's head. If the attacker is on the lower level cliff, the projectile "jumps" up the cliff. How to make it fly in straight diagonal line towards the target (let it penetrate through the cliff edge, doesn't matter)?
Thanks in advance for your ideas.
Not sure how the targets manage to escape the direct damage portion. I guess the damage effect is centered on the missile location at the time the "Impact Range" kicks in and/or has a slight trigger delay for some reason. You can always exclude the primary target from the splash but that only makes sense if you can guarantee the main damage. Your damage effect is not set to occur at a Point type target by any chance?
Movers are simple to understand, but hard to flesh out the visuals. The Throw driver forces the missile to move in the given direction (Throw Vector), ignoring the actual target of the effect (though the starting coordinates are usually aligned to face the target at the time of launch, -Y direction is towards the target). Movers seem to need a Guided phase or the Throw may just fly straight into the ground for some reason.
First of all you should explain exactly what kind of behavior you want: a dumbfire projectile that doesn't change trajectory mid-flight like a real-life bullet, one that does track but with limited capability like a modern seeking missile, or something else (magic-always-hit-bullet is the default Guided phase)
For a preset trajectory (dumbfire) note you can aim the Launch Missile effect at Target Point and stick to a guided phase, the missile will always hit where the target was at the time of launch. There are plenty tutorials on colliding missiles if you want it to hit the first/any target in its path (by itself the missile will fly right through any obstacles and always hit the intended target location)
For a slow seeking projectile try to stick with a guided phase and simply limit the turning speed on the mover. The mover also has Timeout field which defines the maximum life time of the missile, you'll have to reduce that or it'll make a huge arcing turn and hit its mark 20 seconds later. Again use colliding missiles if needed, gameplay-wise it's still a magic bullet that zeroes in on one target only it can fail to hit in time.
Thanks for such a detailed answer. It made me try to find tutorials and to extend my experiments (I fear a little to touch something I'm not familiar with :] ), and it seems that it works now as I wanted. Though it differs from your solutions.
I needed simple dumbfire missile that is launched directly towards the initial target and hits the first target on its linear trajectory. Guidance to target point is not a very good choice because target can avoid damage just by stepping back (and it's not realistic). What perfectly solved movement part of the problem is still Throw driver with Look At Target as Throw Rotation Type.
As for damage... You asked if my Damage effect wasn't set to occur at target point. No - I had checked it. But to solve damage issue I had just to use the opposite way - I set Impact Location to Target Point and added an Area (with relatively large Radius and Fraction of 1) to the Damage effect. As far as I tested, it seems to work well - it impacts on unit and deals always the same damage. I suppose that it still can do double damage if unit's position matches center point of the effect, but it looks like the possibility of that is low.
Make a unit. This will be your missile. Make a behavior that constantly orders the unit to move forward.
Make an ability. Have the ability create the unit with an offset that is slightly infront of the caster (use a persistent effect to achieve the offset).
Make a weapon. Give the weapon to the unit. The weapon will deal damage (splash if needed) and suicide the unit.
Sounds simple. It's not. It'll take some time to get everything hooked up properly. Good luck!