I have a hero in my map called Birdman as you can see in the screen below he has a carrier like ability where birds will throw clusters on the ground. In my game heroes get life for every kill they make however, kills made by the "interceptor birds" do not count for birdman so its really hard to get birdmans life up :(
anyone know how i can somehow redirect the kills of the escorts like to the main unit so that it would act as if the kill was made by birdman?
I have a mechanic in my tower defense where kills are redirected. Let's say tower A has a skill that generates +$10 for each kill, and tower B can redirect any of its kills to another tower. I have a trigger that acts as a function, let's call it awardKillCredit(unit), where you pass in a unit as the parameter, which is going to be the tower that will reap the kill benefit.
I have two different triggers that detect kills. In one trigger, the event is "Unit dies" with the condition that "killing unit == tower A", then in the actions you simply call awardKillCredit(killing unit).
In the second trigger, the event is "Unit dies" with the condition that "killing unit == tower B". In this trigger you figure out which tower is being awarded the kills from tower B. I have a simple condition that sees if it's redirecting kills to tower A, then call awardKillCredit(tower A). You can even adjust the unit property to add +1 kill to tower A and -1 kill to tower B, if you care about that stat.
The only tricky part is figuring out which unit to award your kills to. In your case, I assume you have one hero. You have heroUnit[x] (x is player's number), and then when an intercepter bird gets a kill, check if heroUnit[x] is of the type Birdman, and then call the your function awardKillCredit(birdman unit).
This can all be done with the GUI triggers. If you don't know how to make a function then let us know.
Execute the effect KillsToCaster on your bird. It will place a behavior on your bird, which will automatically transfer the kills to the caster of the effect.
It doesn't matter, if the effect is executed via data or trigger; just make sure that, when you execute the effect, the bird is the target and your hero is the caster.
Hey, the kills to caster behavior sounded like a great solution but i tried applying it to the `interceptor birds` and it didnt give any kills to birdman. so im going to try the way the guy above mentioned, though if i could get the kills to caster behavior to work would be awesome.
still open to suggestions.
btw, the clusterbomb that the bird interceptors fire are also a unit on its own in the data editor, so kills to caster must also be applied to clusterbomb?
It works just fine for me on multiple occasions. How did you apply it? If the bird is spawned via a Create Unit effect, you should simply be able to set the Spawn Effect - field to the KillsToCaster Effect.
Hey, the effect which creates the interceptors doesnt have a field Effect: Effect - Spawn field it doesnt use (create unit), however i did find that particular field on the create unit cluster bomb, but changing that to kills to caster dont work.
i ran a test which indicate that the interceptors are not killing the units but the clusterbomb unit that the interceptors throw on the ground kill the unit.
maybe this gives you an idea on why kills to caster effect is not working, or how im suppose to set it up.
still trying to figure it out.
and for SkrowFunk, i dont know how the awardkillcredit(Unit) should look or works, im pretty new to functions. Anyhow i dont think your method would work on my map cause if i redirect my kills your way, everyone who has the birdman hero would get their life up? or yeh i would have to refer to the playernumber and the hero number and give them kill credit, not really sure how that works.
For now i have created something that seems to work but is very unefficient and i dont like it, if someone could pls refresh me on a better way how to do this and can help me out with it, i would really appreciate.
here is an example of how im doing it right now:
I have created a trigger that puts every birdman purchased by a player in a specific unit group for the player that bought it.
Then i have created a second trigger which says that whenever a unit dies and the type of unit that killed it is the clusterbomb and is not the clusterbomb itself, add life and kills to the unit in the unitgroup where the birdman is stored.
i would still have to make the if statements in both triggers for every player and if i have a different unit that does the same thing i have to create the whole thing over again.... :[
The Arm Magazine ability has the ammo units known as the caster for the launch effect under the Effect - Effects field so you need to use a search area effect to apply the buff from the main unit.
I'm not sure what's so inefficient about it. You're not going to notice any kind of slow-down or lag from that trigger.
Most importantly, you don't want to have variables like UnitsP1. Instead, you want to have something like playerUnits[x], where you have an array of unit groups (one for each player). When your trigger starts, set local integer playerNumber = owner of killing unit, then reference your unit group using playerUnits[playerNumber].
In general, I see a lot of people concerned about the efficiency of triggers. In reality it's not a problem unless you're doing something many times per second throughout the entire game, and even then some times it's not even a problem. Don't forget that your CPU is screaming millions of numbers per second just to run and render Starcraft 2, so going into a small unit group and updating a few integers is just no sweat.
Okay, so my main thing was worrying about this method causing lag to my game or something glad thats not the case here, but about this method not being efficient is cause if i would have a different hero that uses the same kind of thing i would have to make the same trigger and edit all the statements.
I was also wondering why if i reference a playergroup like : Unit - Set (Unit 1 from HeroUnitGroup[1]) to modify a property i am able to choose a position in the unitgroup, however when i add a unit to the unit group i cant choose the position for the unit that gets added.
Anyway i was looking into what drsuperevil said... do you mean like have the main unit apply the killtocaster behavior to units within a search area? if so would the mian unit have to apply it to the clusters or the interceptors?
You have a buff on the carrier unit that emmits a small range search area effect that then applies your buff to the interceptors only validated by a Unit Type validator.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Hi,
I have a hero in my map called Birdman as you can see in the screen below he has a carrier like ability where birds will throw clusters on the ground. In my game heroes get life for every kill they make however, kills made by the "interceptor birds" do not count for birdman so its really hard to get birdmans life up :(
anyone know how i can somehow redirect the kills of the escorts like to the main unit so that it would act as if the kill was made by birdman?
thnx
@Rice87: Go
I have a mechanic in my tower defense where kills are redirected. Let's say tower A has a skill that generates +$10 for each kill, and tower B can redirect any of its kills to another tower. I have a trigger that acts as a function, let's call it awardKillCredit(unit), where you pass in a unit as the parameter, which is going to be the tower that will reap the kill benefit.
I have two different triggers that detect kills. In one trigger, the event is "Unit dies" with the condition that "killing unit == tower A", then in the actions you simply call awardKillCredit(killing unit).
In the second trigger, the event is "Unit dies" with the condition that "killing unit == tower B". In this trigger you figure out which tower is being awarded the kills from tower B. I have a simple condition that sees if it's redirecting kills to tower A, then call awardKillCredit(tower A). You can even adjust the unit property to add +1 kill to tower A and -1 kill to tower B, if you care about that stat.
The only tricky part is figuring out which unit to award your kills to. In your case, I assume you have one hero. You have heroUnit[x] (x is player's number), and then when an intercepter bird gets a kill, check if heroUnit[x] is of the type Birdman, and then call the your function awardKillCredit(birdman unit).
This can all be done with the GUI triggers. If you don't know how to make a function then let us know.
Execute the effect KillsToCaster on your bird. It will place a behavior on your bird, which will automatically transfer the kills to the caster of the effect.
It doesn't matter, if the effect is executed via data or trigger; just make sure that, when you execute the effect, the bird is the target and your hero is the caster.
@Kueken531: Go
Hey, the kills to caster behavior sounded like a great solution but i tried applying it to the `interceptor birds` and it didnt give any kills to birdman. so im going to try the way the guy above mentioned, though if i could get the kills to caster behavior to work would be awesome. still open to suggestions.
btw, the clusterbomb that the bird interceptors fire are also a unit on its own in the data editor, so kills to caster must also be applied to clusterbomb?
mehh im confused
It works just fine for me on multiple occasions. How did you apply it? If the bird is spawned via a Create Unit effect, you should simply be able to set the Spawn Effect - field to the KillsToCaster Effect.
@Kueken531: Go
Hey, the effect which creates the interceptors doesnt have a field Effect: Effect - Spawn field it doesnt use (create unit), however i did find that particular field on the create unit cluster bomb, but changing that to kills to caster dont work.
@Kueken531: Go
Hey,
i ran a test which indicate that the interceptors are not killing the units but the clusterbomb unit that the interceptors throw on the ground kill the unit.
maybe this gives you an idea on why kills to caster effect is not working, or how im suppose to set it up. still trying to figure it out.
and for SkrowFunk, i dont know how the awardkillcredit(Unit) should look or works, im pretty new to functions. Anyhow i dont think your method would work on my map cause if i redirect my kills your way, everyone who has the birdman hero would get their life up? or yeh i would have to refer to the playernumber and the hero number and give them kill credit, not really sure how that works.
@Rice87: Go
Hey,
For now i have created something that seems to work but is very unefficient and i dont like it, if someone could pls refresh me on a better way how to do this and can help me out with it, i would really appreciate.
here is an example of how im doing it right now:
I have created a trigger that puts every birdman purchased by a player in a specific unit group for the player that bought it. Then i have created a second trigger which says that whenever a unit dies and the type of unit that killed it is the clusterbomb and is not the clusterbomb itself, add life and kills to the unit in the unitgroup where the birdman is stored.
i would still have to make the if statements in both triggers for every player and if i have a different unit that does the same thing i have to create the whole thing over again.... :[
These are the triggers:
@Kueken531: Go
The Arm Magazine ability has the ammo units known as the caster for the launch effect under the Effect - Effects field so you need to use a search area effect to apply the buff from the main unit.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@Rice87: Go
I'm not sure what's so inefficient about it. You're not going to notice any kind of slow-down or lag from that trigger.
Most importantly, you don't want to have variables like UnitsP1. Instead, you want to have something like playerUnits[x], where you have an array of unit groups (one for each player). When your trigger starts, set local integer playerNumber = owner of killing unit, then reference your unit group using playerUnits[playerNumber].
In general, I see a lot of people concerned about the efficiency of triggers. In reality it's not a problem unless you're doing something many times per second throughout the entire game, and even then some times it's not even a problem. Don't forget that your CPU is screaming millions of numbers per second just to run and render Starcraft 2, so going into a small unit group and updating a few integers is just no sweat.
@SkrowFunk: Go
Okay, so my main thing was worrying about this method causing lag to my game or something glad thats not the case here, but about this method not being efficient is cause if i would have a different hero that uses the same kind of thing i would have to make the same trigger and edit all the statements. I was also wondering why if i reference a playergroup like : Unit - Set (Unit 1 from HeroUnitGroup[1]) to modify a property i am able to choose a position in the unitgroup, however when i add a unit to the unit group i cant choose the position for the unit that gets added.
Anyway i was looking into what drsuperevil said... do you mean like have the main unit apply the killtocaster behavior to units within a search area? if so would the mian unit have to apply it to the clusters or the interceptors?
thnx for the replies
You have a buff on the carrier unit that emmits a small range search area effect that then applies your buff to the interceptors only validated by a Unit Type validator.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg