Turrets are confusing me. As far as I can tell, there are Turret units and Turret actors, but I can't figure out how they link together or link to anything else, or what each does.
Specifically, I have a custom unit. It has no weapon or attack, but it does have offensive abilities. I want the model (the diamondback model in this case) to turn its gun when one of those abilities is used. What do I need to do with Turrets to make that happen?
What you want to do with the Diamondback is pretty complex (unless for me when I did it with the Laser Tank). What you need is a dummy weapon with a dummy effect which targets an especific type of unit (in my case I used Stasis Allowed because any unit can target units in Stasis): This is for rotating abilities (I mean starts in X=3 ends in X=10 for example so the attack covers an area of X=7) For this you need a Create Unit Effect which creates your dummy Invisible unit (make it with OP values for Life, Regen and Armor soits life doesn't decrease and it can't never be killed) which moves from X=3 to X=10 (like in the example). This is all I can tell you about it. If you need a map Kueken made one for me (I'll post it here). EDIT: as for your main question: you only have to create the Turret in the Turret data field, setting its characteristics as you like and then create a Turret Actor setting in events YourTurret.Enable and Create (a good turret tutorial here: http://www.sc2mapster.com/forums/resources/tutorials/9000-data-working-with-turrets-beginner-difficulty/
Thanks to ProzaicMuze)
Turrets are objects useable by Units, which may or may not have Weapons attached to them. Turrets are capable of rotation, either by themselves or in the direction of the attached weapon. Turrets allow their attached weapons to shoot in the direction the Turret is facing, regardless of the facing angle of the attached unit.
Turret actors are linked to these Turret objects and are capable of interacting with it, to a limited extend. They also need an associated Model or Unit actor (usually the main actor of the unit) to pass on these interactions, so you can actually see the effect of your turret.
For an actor/model to be able to function with a turret, it needs to be set up with a TurretZ attachment point. If the model is properly configured, the unit is linked to the Turret object and the Turret has an associated Turret Actor and Model Actor, the unit model, or parts of it if it is set up that way, is capable of turning with the turret, independent of the unit's real facing.
This interaction is limited to either passive rotation or rotation connected to a Weapon. To my knowledge, there is no way to affect the rotation of a turret with an ability or via trigger. There are a couple of workarounds, though. One possibility is shown in the test map in this thread: A dummy unit is spawned by the ability and attacked by a hidden weapon, which is connected to a turret. Another possibility would probably be to use triggers to send rotation actor messages constantly to simulate turret rotation.
Then there is my turret simulation map (check my data assets) where a model that your turret model faces has the host changed to the target of your ability.
Turrets are confusing me. As far as I can tell, there are Turret units and Turret actors, but I can't figure out how they link together or link to anything else, or what each does.
Specifically, I have a custom unit. It has no weapon or attack, but it does have offensive abilities. I want the model (the diamondback model in this case) to turn its gun when one of those abilities is used. What do I need to do with Turrets to make that happen?
What you want to do with the Diamondback is pretty complex (unless for me when I did it with the Laser Tank).
What you need is a dummy weapon with a dummy effect which targets an especific type of unit (in my case I used Stasis Allowed because any unit can target units in Stasis): This is for rotating abilities (I mean starts in X=3 ends in X=10 for example so the attack covers an area of X=7) For this you need a Create Unit Effect which creates your dummy Invisible unit (make it with OP values for Life, Regen and Armor soits life doesn't decrease and it can't never be killed) which moves from X=3 to X=10 (like in the example). This is all I can tell you about it. If you need a map Kueken made one for me (I'll post it here).
EDIT: as for your main question: you only have to create the Turret in the Turret data field, setting its characteristics as you like and then create a Turret Actor setting in events YourTurret.Enable and Create (a good turret tutorial here: http://www.sc2mapster.com/forums/resources/tutorials/9000-data-working-with-turrets-beginner-difficulty/
Thanks to ProzaicMuze)
Can I just get a coherent explanation of what exactly the Turret unit does VS what the Turret actor does?
Turrets are objects useable by Units, which may or may not have Weapons attached to them. Turrets are capable of rotation, either by themselves or in the direction of the attached weapon. Turrets allow their attached weapons to shoot in the direction the Turret is facing, regardless of the facing angle of the attached unit.
Turret actors are linked to these Turret objects and are capable of interacting with it, to a limited extend. They also need an associated Model or Unit actor (usually the main actor of the unit) to pass on these interactions, so you can actually see the effect of your turret.
For an actor/model to be able to function with a turret, it needs to be set up with a TurretZ attachment point. If the model is properly configured, the unit is linked to the Turret object and the Turret has an associated Turret Actor and Model Actor, the unit model, or parts of it if it is set up that way, is capable of turning with the turret, independent of the unit's real facing.
This interaction is limited to either passive rotation or rotation connected to a Weapon. To my knowledge, there is no way to affect the rotation of a turret with an ability or via trigger. There are a couple of workarounds, though. One possibility is shown in the test map in this thread: A dummy unit is spawned by the ability and attacked by a hidden weapon, which is connected to a turret. Another possibility would probably be to use triggers to send rotation actor messages constantly to simulate turret rotation.
Then there is my turret simulation map (check my data assets) where a model that your turret model faces has the host changed to the target of your ability.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg