I'm trying to make a behavior that, when placed on a unit, lasts for 10 seconds and starts spawning X-units outside of the player's sight, which are forced to attack only the unit with the behavior and stop spawning after the behavior is gone. Any idea how to do this?
For those of you who play L4D or L4D2, think of the Boomer's bile attack. Any survivor that gets covered in it gets swarmed by infected. In a way, I'm trying to replicate that.
A "Create Unit" effect is obviously used to create units.
A "Create Persistent" effect is able to use effects at an offset (So you can make it use a Create Unit effect far away from where the Persistent was initially cast)
An "Issue Order" effect is able to issue the Attack order. Set up the target fields correctly (Unit receiving the order should be "Target", unit targetted by the order should be "Caster") and have the Create Unit effect use this effect as its "Spawn Effect" (I think its called that, might be something else, should be very obvious though)
Using those three effects with a specific unit as a caster should allow you to create units a good distance away and immediately make them attack the "caster" (The caster by default won't use any animations or have anything else in the game indicates he's the caster). This will however make them completely ignore other units. You can make the attack order target Caster Point instead of Caster Unit, which will make them attack the first unit they see on their way to the point the caster was at the time of "casting". If you want them to attack the first best unit on their way to the caster but also track the casters location, it's gonna get a tiny bit more complicated (You're probably gonna have to mark the caster with a behavior and have the dudes have a behavior that periodically searches for enemies with that specific behavior and gives an attack order)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to make a behavior that, when placed on a unit, lasts for 10 seconds and starts spawning X-units outside of the player's sight, which are forced to attack only the unit with the behavior and stop spawning after the behavior is gone. Any idea how to do this?
For those of you who play L4D or L4D2, think of the Boomer's bile attack. Any survivor that gets covered in it gets swarmed by infected. In a way, I'm trying to replicate that.
A "Create Unit" effect is obviously used to create units.
A "Create Persistent" effect is able to use effects at an offset (So you can make it use a Create Unit effect far away from where the Persistent was initially cast)
An "Issue Order" effect is able to issue the Attack order. Set up the target fields correctly (Unit receiving the order should be "Target", unit targetted by the order should be "Caster") and have the Create Unit effect use this effect as its "Spawn Effect" (I think its called that, might be something else, should be very obvious though)
Using those three effects with a specific unit as a caster should allow you to create units a good distance away and immediately make them attack the "caster" (The caster by default won't use any animations or have anything else in the game indicates he's the caster). This will however make them completely ignore other units. You can make the attack order target Caster Point instead of Caster Unit, which will make them attack the first unit they see on their way to the point the caster was at the time of "casting". If you want them to attack the first best unit on their way to the caster but also track the casters location, it's gonna get a tiny bit more complicated (You're probably gonna have to mark the caster with a behavior and have the dudes have a behavior that periodically searches for enemies with that specific behavior and gives an attack order)