You can force a units actor to attach to another units actor like it is any other actor. Doing so will dissociate the actor with the unit's position, so it is recommended you make the unit follow the other unit around somehow, eg as an item carried by it, otherwise it might look very weird being able to attack the component nowhere near what it is attached to.
This is done simply by sending the unit actor you want to attach the other unit actor to an "Attach" actor message referencing the unit actor you want to attach and the appropriate attach location (direct, message and site op all are allowed and work so this really is flexible). Should work with both data and triggers. The problem with data is referencing the unit actor you want to attach with respects to the unit actor you want to attach it to. This is where triggers are much more flexible as you can pull both actors from unit references and then send the attach actor method using triggers. In either case you need to use a global actor reference, setup by a "RefSet" (Reference Set) message on the unit actor you want to attach, to instruct the Attach message what actor you want to attach.
You can undo the attachment and return the unit actor back to following its unit as normal by sending an invalid attachment, eg attaching to itself. This produces an error message which is sub optimal. As such there is likely a better way to do this which does not produce an error message however I am currently unaware of one.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
You can force a units actor to attach to another units actor like it is any other actor. Doing so will dissociate the actor with the unit's position, so it is recommended you make the unit follow the other unit around somehow, eg as an item carried by it, otherwise it might look very weird being able to attack the component nowhere near what it is attached to.
This is done simply by sending the unit actor you want to attach the other unit actor to an "Attach" actor message referencing the unit actor you want to attach and the appropriate attach location (direct, message and site op all are allowed and work so this really is flexible). Should work with both data and triggers. The problem with data is referencing the unit actor you want to attach with respects to the unit actor you want to attach it to. This is where triggers are much more flexible as you can pull both actors from unit references and then send the attach actor method using triggers. In either case you need to use a global actor reference, setup by a "RefSet" (Reference Set) message on the unit actor you want to attach, to instruct the Attach message what actor you want to attach.
You can undo the attachment and return the unit actor back to following its unit as normal by sending an invalid attachment, eg attaching to itself. This produces an error message which is sub optimal. As such there is likely a better way to do this which does not produce an error message however I am currently unaware of one.