A Dummy unit with the model of a Powerup and 100 HP.
When any unit comes close to this unit except for structure and only biological units within a range of 3,
it should apply a behavior (dummy buff) which I can use as a condition in triggers,
while dealing 100 damage to itself (or better yet just instantly kill itself).
The target unit should then get a red tint (Is that even possible? I could only find player colour),
and scale to 200% size.
I tried using a modified medic heal and a set of Apply behavior and Damage to do this, but I always get
an error and the unit instantly disappears without applying any buff. (Maybe it targeted the structure on
which it spawned, who knows)
However a solution to this would be much appreciated.
Have a look at the powerups in the campaign. They are units, which have an ability on autocast with a low range. When a valid unit comes in range, the ability is casted on that unit. The ability then executes a Set effect, which executes more effects, one of them kills the powerup (the Suicide effect usually), and another effect executes the desired action, in your case this would be an Apply Behavior effect.
You can easily exclude structures and only allow biological units within the target filters of the ability, also you can make a buff set the tint color and scaling of the unit by using its actor events. If the buff itself should not have any animation itself, only modify the unit, you would create a new actor, type Model, based on ModelAddition, set the Model- field to Invisible and use events similar to this:
Behavior.MyBehavior.on
Create
Behavior.MyBehavior.off
Destroy
ActorCreation
SetTintColor
ActorCreation
SetScale
ActorDestruction
ResetTintColor (set to original value)
ActorDestruction
ResetScale
To make the actor messages affect the unit actor instead of itself, use the Target field for the message. If you select the message, it is the topmost field. It is usually empty, and you have to enter a string. Enter ::Main or _Selectable to make it affect the unit actor. Do this for every SetScale and every SetTintColor message.
So I tried creating this:
A Dummy unit with the model of a Powerup and 100 HP. When any unit comes close to this unit except for structure and only biological units within a range of 3, it should apply a behavior (dummy buff) which I can use as a condition in triggers, while dealing 100 damage to itself (or better yet just instantly kill itself). The target unit should then get a red tint (Is that even possible? I could only find player colour), and scale to 200% size.
I tried using a modified medic heal and a set of Apply behavior and Damage to do this, but I always get an error and the unit instantly disappears without applying any buff. (Maybe it targeted the structure on which it spawned, who knows)
However a solution to this would be much appreciated.
Have a look at the powerups in the campaign. They are units, which have an ability on autocast with a low range. When a valid unit comes in range, the ability is casted on that unit. The ability then executes a Set effect, which executes more effects, one of them kills the powerup (the Suicide effect usually), and another effect executes the desired action, in your case this would be an Apply Behavior effect.
You can easily exclude structures and only allow biological units within the target filters of the ability, also you can make a buff set the tint color and scaling of the unit by using its actor events. If the buff itself should not have any animation itself, only modify the unit, you would create a new actor, type Model, based on ModelAddition, set the Model- field to Invisible and use events similar to this:
To make the actor messages affect the unit actor instead of itself, use the Target field for the message. If you select the message, it is the topmost field. It is usually empty, and you have to enter a string. Enter ::Main or _Selectable to make it affect the unit actor. Do this for every SetScale and every SetTintColor message.
Thanks I will try this.
EDIT: Ok it worked :P