1. Is it possible to add a validator to a weapon? I know about Target Sorts, but I need something that actually makes attacking a certain unit 'impossible' not 'as a last resort' SOLVED!
2) is easy achieved with a variable.. just use a boolean and turn it on when the trigger runs and off again when the wave starts. make sure you have a check in the conditions that the variable is off
1 The effect from the weapon accepts Validators if I remember well.
2 Probably you'll need to use a global boolean. This Is Running = false. In that trigger first do an If (This Is Running = false), then inside put This Is Running to true, do all your code, and at the end, put again This Is Running as false (you can also wait a few seconds before setting it to false again.
Okay, I thought about the boolean, but it seemed like it may not work since technically the boolean would be set to true at the same time by both of the trigger's runs.
The Weapon Effects can have validators applied, true, but that won't stop the unit from attacking, will it? It will just do 0 damage.
For #1 I believe there is a validation list on most effects (If not all), and all you have to do is add that validation to the effect of the weapon. I think the weapon filters are limited to things like "Alive", "Visible", "Flying". There is definitely a way to do this though.
For #2 my recommendation is that you put all of the units that might be dying into a unit group in some way. You can either do this by adding it to a global Unit Group on creation of the unit, or use one of the many built-in functions to get a new unit group with the members you are looking for (If they all belong to one player, or are of one unit type for example, there are functions that will create a unit group and find them all). Once you have the unit group, you should add a condition to your trigger to say "Number of [Living] Units in Unit Group(My Unit Group) == 0". even if two units die simultaneously then the trigger will only run once.
Sorry for the vague answers, I am not at home to check the exact names of methods, or I would just include some example code for you. If you are still having problems, let me know and I can post some stuff when I get home.
I had separate triggers and then had it so that when one trigger was activated, it would automatically tur off the other trigger. So it couldn't possible be run twice sine the turn off automatically stops the trigger being run twice.
The Weapon Effects can have validators applied, true, but that won't
stop the unit from attacking, will it? It will just do 0 damage.
I think I understand you know. Create a behaviour that disables the weapon of the unit. Apply/Remove it via triggers. I did something similar, so it will work.
@ Fr0d0: Is there a way to do this without triggers? I have a ton of units and I want certain ones to be unable to hit enemies with a certain buff, and I want others to ONLY be able to shoot thse buffed units.
I'll try to, for example, if in your map being Psionic doesn't mean anything, use that condition (or any other like that) to use. One can't hit psionic units, the other only can hit psionic units. Easy to do with filters. Is a workaround at least.
Yeah I considered that, but then you get the word at the bottom of the screen declaring a unit as psionic. Also, both types of unit are the same unit, I just want some of them to be buffed and invulnerable to certian attackers.
Yeah I considered that, but then you get the word at the bottom of the screen declaring a unit as psionic. Also, both types of unit are the same unit, I just want some of them to be buffed and invulnerable to certian attackers.
I guess my first answer was not clear... put a validator on the effect of the weapon.
I hope they'll be easy to answer :P.
1. Is it possible to add a validator to a weapon? I know about Target Sorts, but I need something that actually makes attacking a certain unit 'impossible' not 'as a last resort' SOLVED!
2. Solved! Thanks
Thanks ahead of time.
1) is possible. but dunno how to explain it.
2) is easy achieved with a variable.. just use a boolean and turn it on when the trigger runs and off again when the wave starts. make sure you have a check in the conditions that the variable is off
1 The effect from the weapon accepts Validators if I remember well.
2 Probably you'll need to use a global boolean. This Is Running = false. In that trigger first do an If (This Is Running = false), then inside put This Is Running to true, do all your code, and at the end, put again This Is Running as false (you can also wait a few seconds before setting it to false again.
Okay, I thought about the boolean, but it seemed like it may not work since technically the boolean would be set to true at the same time by both of the trigger's runs.
The Weapon Effects can have validators applied, true, but that won't stop the unit from attacking, will it? It will just do 0 damage.
@wingednosering: Go
For #1 I believe there is a validation list on most effects (If not all), and all you have to do is add that validation to the effect of the weapon. I think the weapon filters are limited to things like "Alive", "Visible", "Flying". There is definitely a way to do this though.
For #2 my recommendation is that you put all of the units that might be dying into a unit group in some way. You can either do this by adding it to a global Unit Group on creation of the unit, or use one of the many built-in functions to get a new unit group with the members you are looking for (If they all belong to one player, or are of one unit type for example, there are functions that will create a unit group and find them all). Once you have the unit group, you should add a condition to your trigger to say "Number of [Living] Units in Unit Group(My Unit Group) == 0". even if two units die simultaneously then the trigger will only run once.
Sorry for the vague answers, I am not at home to check the exact names of methods, or I would just include some example code for you. If you are still having problems, let me know and I can post some stuff when I get home.
I had separate triggers and then had it so that when one trigger was activated, it would automatically tur off the other trigger. So it couldn't possible be run twice sine the turn off automatically stops the trigger being run twice.
Not sure if that helps.
I think I understand you know. Create a behaviour that disables the weapon of the unit. Apply/Remove it via triggers. I did something similar, so it will work.
@wingednosering: Go
the thing with the boolean works. check if its true and set it to false as first action.
Okay, I'll use a boolean then.
@ Fr0d0: Is there a way to do this without triggers? I have a ton of units and I want certain ones to be unable to hit enemies with a certain buff, and I want others to ONLY be able to shoot thse buffed units.
@wingednosering: Go
Pretty hard.
I'll try to, for example, if in your map being Psionic doesn't mean anything, use that condition (or any other like that) to use. One can't hit psionic units, the other only can hit psionic units. Easy to do with filters. Is a workaround at least.
Yeah I considered that, but then you get the word at the bottom of the screen declaring a unit as psionic. Also, both types of unit are the same unit, I just want some of them to be buffed and invulnerable to certian attackers.
I guess my first answer was not clear... put a validator on the effect of the weapon.
Ah, no it was clear, I just thought that would result in aiming, firing, but dealing no damage. You were right, I just tried it.