Add a Comparison condition and change it to Triggering Unit == supply depot(or if you don't have a preset supply depot a unit variable with supply depot in it)
Add an action Create Units Facing Angle then change the Point to Position of Unit under functions, it should set it to the triggering unit position automatically, finally change the unit created to some destructible rocks.
Triggering Unit == supply depot(or if you don't have a preset supply depot a unit variable with supply depot in it
Comparison
Value 1: Triggering Unit
Operator: ==
Value 2: (income building) Mineral Grinder [28.00, 34.00]
<< I can only make it like this, i dont know how to make it like this >>
Triggering Unit == "this type of unit"
How do i make it like you said?
It feels not nessisary to have a condition bacouse thie the condition can be made in the event
Insted of having "any unit dies" and then "if its this unit" i can as well have "if this unit type dies" but i cant figure out how to write it so that its not so picky :/
Note: Where value 2 is, you will be prompted to select a unit type from a list, or alternatively use a variable, function or whatever you want to compare it to.
Note: Where value 2 is, you will be prompted to select a unit type from a list, or alternatively use a variable, function or whatever you want to compare it to.
Next question.
The new spawning unit on that spot is to big and get moved away when ti spawn. What data should i be looking at so it get exacly the same size? does the fact that i scaled the unit have a working factor? I try to find all data to change but it feels like i'm missing something. What are the important datafields to look at?
Not sure if I totally get your question but I'll give it a shot. :D I would modify "pathing- footprint". if your unit has one already you could make it smaller. I belive this is only used with buildings though, so if your unit is not a building, you can ignore this. I would also decrease the values "inner radius", "radius" and "separation radius" and see what happens. Those things will make the unit be treated as if its smaller. To make the unit's 3-d model actually appear smaller, go to the units actor and decrease all 3 values for "scale". Keep in mind that modifying scale will make the unit look bigger or smaller but does not actually affect the game or unit collision.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Thank you for your reply. I did try this triggers with 2 barracks, 1 that died and 1 new that poped up so the same size should work. I have been trying to make it the same size and failed. I'm missing some important parts. Its good to know that model scaling does not effect it.
There should be a field when you select your Create Unit action near the bottom, double click it i think there is a check box called Ignore Placement, check that and press Ok
There should be a field when you select your Create Unit action near the bottom, double click it i think there is a check box called Ignore Placement, check that and press Ok
Edit: the field is called Flags
I can not find that under unit - flags, i can find however ignore terrain hight is that it? sound wrong.
Hmm when i try to place a barrack where a barrack have been then its working perfectly. When i try to place my building where the old building have been then it jumps away so something is wrong with the deign of the unit that gets destroyed and not with the replacement.. It have to do with how close the attacking units are and in this case zerglings. The zerglings are in the way for the new building that pop up and thats why it move away.
What option decide how close a zergling can be to the building and what decide how much space the building need to be built on? is it the footprints?
I was wrong, replacing a barrack with a new barrack MADE IT MOVE. The reason why it move is simple, the units killing it is in the way when a new is created.
Is it possible to "not" kill the building and still do it, kinda like a reverse morphing. When the unit have 0 life it morph into another building?
Well, you can either create a behavior that temporarily removes unit collision and add it to the new barracks when it's being placed and then remove it...
Or rather then morph I would do some replace unit stuff like:
EventUnit-AnyUnittakesFatalAnydamage(fromAnyeffects)Condition(Triggeringunit)==BarracksActionUnit-Replace(Triggeringunit)withaBarracksusingNewUnits's Max vitals
Might be a better wait to write that although it would work.
Event: How do i make an event that start when any friendly unit of "this" type dies (for example a supply depo owned by any ally of player 1).
Action: And then create a new unit at the spot where the dead unit was.. (for example add destructible rocks where the supply depo died)
Use the event Unit - Any Unit Dies
Add a Comparison condition and change it to Triggering Unit == supply depot(or if you don't have a preset supply depot a unit variable with supply depot in it)
Add an action Create Units Facing Angle then change the Point to Position of Unit under functions, it should set it to the triggering unit position automatically, finally change the unit created to some destructible rocks.
I did figure out how to make a new unit but i was not sure how to "Triggering Unit == supply depot" this part.
Thank you
Triggering Unit == supply depot(or if you don't have a preset supply depot a unit variable with supply depot in it
Comparison
Value 1: Triggering Unit
Operator: ==
Value 2: (income building) Mineral Grinder [28.00, 34.00]
<< I can only make it like this, i dont know how to make it like this >>
Triggering Unit == "this type of unit"
How do i make it like you said?
It feels not nessisary to have a condition bacouse thie the condition can be made in the event
Insted of having "any unit dies" and then "if its this unit" i can as well have "if this unit type dies" but i cant figure out how to write it so that its not so picky :/
@Sherlia: Go
Instead of comparing a unit against the triggering unit, use the function "Unit Type of Unit" in the comparison. It should look like this:
Note: Where value 2 is, you will be prompted to select a unit type from a list, or alternatively use a variable, function or whatever you want to compare it to.
Which, in the end, will look like this:
Unit type of (Triggering Unit) == Supply Depot
@VoidPotato: Go
Thank you, gonna try it soon.
Next question. The new spawning unit on that spot is to big and get moved away when ti spawn. What data should i be looking at so it get exacly the same size? does the fact that i scaled the unit have a working factor? I try to find all data to change but it feels like i'm missing something. What are the important datafields to look at?
Not sure if I totally get your question but I'll give it a shot. :D I would modify "pathing- footprint". if your unit has one already you could make it smaller. I belive this is only used with buildings though, so if your unit is not a building, you can ignore this. I would also decrease the values "inner radius", "radius" and "separation radius" and see what happens. Those things will make the unit be treated as if its smaller. To make the unit's 3-d model actually appear smaller, go to the units actor and decrease all 3 values for "scale". Keep in mind that modifying scale will make the unit look bigger or smaller but does not actually affect the game or unit collision.
@zeldarules28: Go
Thank you for your reply. I did try this triggers with 2 barracks, 1 that died and 1 new that poped up so the same size should work. I have been trying to make it the same size and failed. I'm missing some important parts. Its good to know that model scaling does not effect it.
@Sherlia: Go
Is it the unit, model or actor i should think about modding to the correct size?
@Sherlia: Go
There should be a field when you select your Create Unit action near the bottom, double click it i think there is a check box called Ignore Placement, check that and press Ok
Edit: the field is called Flags
I can not find that under unit - flags, i can find however ignore terrain hight is that it? sound wrong.
Hmm when i try to place a barrack where a barrack have been then its working perfectly. When i try to place my building where the old building have been then it jumps away so something is wrong with the deign of the unit that gets destroyed and not with the replacement.. It have to do with how close the attacking units are and in this case zerglings. The zerglings are in the way for the new building that pop up and thats why it move away.
What option decide how close a zergling can be to the building and what decide how much space the building need to be built on? is it the footprints?
I was wrong, replacing a barrack with a new barrack MADE IT MOVE. The reason why it move is simple, the units killing it is in the way when a new is created.
Is it possible to "not" kill the building and still do it, kinda like a reverse morphing. When the unit have 0 life it morph into another building?
Well, you can either create a behavior that temporarily removes unit collision and add it to the new barracks when it's being placed and then remove it... Or rather then morph I would do some replace unit stuff like:
Might be a better wait to write that although it would work.