- Joined
- Mar 26, 2008
- Messages
- 53
I'm attempting to make a much more suitable, streamlined and effective random impact trigger for ranged units.
For units that fire 0.70 seconds or less, The current one I have doesn't quite works.
It works simplistically, I unit is attacked, the attacker = a unit type, and based on that unit type, a dummy unit spawns in a random area around the target, then the attacker is ordered to attack the dummy instead. When the dummy dies, the attack stops, resets and assumes attacking another unit, starting the cycle all over.
It works, to a point. After so many units are firing at once, the system breaks down, never ordering the attacker to attack the dummy. Further more, its cumbersome, making it to where units firing under .70 seconds won't fire period.
I've countered it slightly by making the dummy unit move between the 2 location point variable, via patrol order. Looks great for flame throwers. Doesn't work for everything else.
The other idea I've worked on is: a unit is attacked, attacker = type of unit, and then a series of actions consisting of a generic region being created around the target, then the dummy spawning within that area. Every 0.01 seconds the dummy is moved instantly within the generic region around the target, all while the attacker is ordered to attack the dummy. It works, but, I've only gotten it to work by placing 2 units in the editor itself, then selecting them as the variables.
I can't seem to get a periodic timer to fire when I try to make it work for standard units and not specific ones. Anyone have any ideas on how to get this to work?
For units that fire 0.70 seconds or less, The current one I have doesn't quite works.
It works simplistically, I unit is attacked, the attacker = a unit type, and based on that unit type, a dummy unit spawns in a random area around the target, then the attacker is ordered to attack the dummy instead. When the dummy dies, the attack stops, resets and assumes attacking another unit, starting the cycle all over.
It works, to a point. After so many units are firing at once, the system breaks down, never ordering the attacker to attack the dummy. Further more, its cumbersome, making it to where units firing under .70 seconds won't fire period.
I've countered it slightly by making the dummy unit move between the 2 location point variable, via patrol order. Looks great for flame throwers. Doesn't work for everything else.
The other idea I've worked on is: a unit is attacked, attacker = type of unit, and then a series of actions consisting of a generic region being created around the target, then the dummy spawning within that area. Every 0.01 seconds the dummy is moved instantly within the generic region around the target, all while the attacker is ordered to attack the dummy. It works, but, I've only gotten it to work by placing 2 units in the editor itself, then selecting them as the variables.
I can't seem to get a periodic timer to fire when I try to make it work for standard units and not specific ones. Anyone have any ideas on how to get this to work?