Does any of you guys know how to reference to an actor attached to a certain unit? I'm asking because I have a trigger that picks every unit in a group and adds an actor to them as an effect. Then whenever one of the units in teh group triggers an event that units specific attached actor should be killed.
afaik there's currently no way. If you kill/ remove the unit that actor was attached to, it will be killed. Then you can create the unit again ( this time without an attaching actor)
Actually, there is a pretty simple way to accomplish this.
First, when you add the actor, you need to add an alias, like so:
Actor - Attach *Actor/Model* to Overhead on (*Your Unit*)
Actor - Send message (AliasAdd "*any name you wish*") to actor (Last created actor)
Now, to destroy it later:
Actor - Kill actor model (Actor connected to (Actor for (*Your Unit*)) via reference "*the alias you gave it*")
You don't have to have a different reference name for each unit. In fact you can have multiple models with the same name on a unit and the Kill Model function will remove all of them in one go.
To do this in the data editor, in the actor's aliases field add something (like _Attachment) and then in the events field of the main actor if you want to send a message to the attached actor, set the Target field to "_Attachment" or whatever alias you used.
This works both ways, you can have the attachment send messages to the host this way using the _Selectable alias.
hm I ended up using Progammer's workaround, since it visually it almost looks the same, except for a very quick animation jump. I do however really like the other input and will remember it for another time :)
[code]Actor - Kill actor model (Actor connected to (Actor for (*Your Unit*)) via reference "*the alias you gave it*")[/code]
references this:
[code]Actor - Attach *Actor/Model* to Overhead on (*Your Unit*)[/code]
Because I think the kill actor model string you have here can only kill an actor that has been "created" - or stored in a variable (which i can't get to work either) ... sigh
Does any of you guys know how to reference to an actor attached to a certain unit? I'm asking because I have a trigger that picks every unit in a group and adds an actor to them as an effect. Then whenever one of the units in teh group triggers an event that units specific attached actor should be killed.
Make a Global "Actor" Variable with an array of how many attachment actors you're making.
Put this in your attachment trigger... where *x* is how many attachment actors you are making:
Since you're attaching several actors and there's no such thing as an "Actor Group" you'll have to use variable arrays to refer to your attached actors.
edit: crap i just realized that is completely wrong... let me fix it.
edit: there we go.
Does any of you guys know how to reference to an actor attached to a certain unit? I'm asking because I have a trigger that picks every unit in a group and adds an actor to them as an effect. Then whenever one of the units in teh group triggers an event that units specific attached actor should be killed.
@MaMasToast: Go
afaik there's currently no way. If you kill/ remove the unit that actor was attached to, it will be killed. Then you can create the unit again ( this time without an attaching actor)
hmm yea didn't think of that... I'll try that thanks :)
Actually, there is a pretty simple way to accomplish this.
First, when you add the actor, you need to add an alias, like so:
Actor - Attach *Actor/Model* to Overhead on (*Your Unit*)
Actor - Send message (AliasAdd "*any name you wish*") to actor (Last created actor)
Now, to destroy it later:
Actor - Kill actor model (Actor connected to (Actor for (*Your Unit*)) via reference "*the alias you gave it*")
You don't have to have a different reference name for each unit. In fact you can have multiple models with the same name on a unit and the Kill Model function will remove all of them in one go.
Hope this helps.
To do this in the data editor, in the actor's aliases field add something (like _Attachment) and then in the events field of the main actor if you want to send a message to the attached actor, set the Target field to "_Attachment" or whatever alias you used.
This works both ways, you can have the attachment send messages to the host this way using the _Selectable alias.
hm I ended up using Progammer's workaround, since it visually it almost looks the same, except for a very quick animation jump. I do however really like the other input and will remember it for another time :)
@JPLetters: Go
This doesn't really work for me. You sure that
[code]Actor - Kill actor model (Actor connected to (Actor for (*Your Unit*)) via reference "*the alias you gave it*")[/code]
references this:
[code]Actor - Attach *Actor/Model* to Overhead on (*Your Unit*)[/code]
Because I think the kill actor model string you have here can only kill an actor that has been "created" - or stored in a variable (which i can't get to work either) ... sigh
Make a Global "Actor" Variable with an array of how many attachment actors you're making.
Put this in your attachment trigger... where *x* is how many attachment actors you are making:
In your attachment destroy variable put this:
That should do it. GL
@ArcadeRenegade: Go
Could you make a screenshot of the setup? I'd really like to follow this, but I can't seem to figure this out :(
@Namsom: Go
Since you're attaching several actors and there's no such thing as an "Actor Group" you'll have to use variable arrays to refer to your attached actors.
edit: crap i just realized that is completely wrong... let me fix it.
edit: there we go.