First I would like to thank you for this tutorial : it is the only one I found concerning turrets !
I was adding footprints to units to turn them into Towers of a tower defense game, but I realized that it was blocking the rotation of units. It seems logic after all, because it is a kind of anchor in the ground... Anyway, it is why I need to add a turret to my units, in order to have them rotate even with a footprint.
I wrote here to require assistance on a curious point I did not manage to solve even with your tuto :
So what I do :
- creating unit form marine
- creating actor from marine
- creating turret object
- attaching turret object to marine unit for his weapon c-14 gauss rifle.
-> at this point, the unit is displayed stuck on the ground, but the turret is firing 360°. I need only to add a model to the turret.
So what I do :
- at Unit birth (Marine) I set visibility of Marine Actor to hidden
- create a model actor for the turret
- create a turret actor.
When turrets enable, turret actor create. Turret actor is attached to model actor for the turret.
-> at this point, the unit model is hidden, the model actor of the turret is displayed, but it still does not rotate !
I do not understand how the turret can be rotating (it shoots 360°) and not the model, whereas it is attached...
A turret can only rotate a model, which has a TurretZ attachment point. Unfortunately, very few models do have this (siege tank, immortal, phoenix...). You can look up the available attachment points in the previewer.
For units without such an attachment, the common workaround is to add an invisible phoenix as a turret model and attach your own model to it, so the phoenix turns with the turret, and your model turns with the phoenix. Not sure, if there are better alternatives, I don't know of any.
But I' am not sure of a thing. I did not manage to reproduce it even if I managed it yesterday T_T.
Now when I add the event to hide my unit actor (the one that will never rotate) with UnitBirth.Marine -> Set Visibility, it is hiding both models ! (unit model and turret model, generated with the turret model actor))
How to hide a model in particular ?
How to attach marine rotation to phenix model rotation ?
But I' am not sure of a thing. I did not manage to reproduce it even if I managed it yesterday T_T.
Now when I add the event to hide my unit actor (the one that will never rotate) with UnitBirth.Marine -> Set Visibility, it is hiding both models ! (unit model and turret model, generated with the turret model actor))
I would like to have my unit actor hidden, my phenix hidden, and my marine model attached to the penix displayed and moving !!
Any advice ?
Do not use Set Visibility, it also messes up attachments etc. Use Set Opacity instead. If your attachment still becomes invisible, look for its Inherited Properties - field and uncheck Opacity.
Also, I am not sure, what your setup actually is or how it should look like in the end, but if you just want a marine tower, with the marine being the unit and turnable, you can actually attach the unit actor to the phoenix, even though technically it is the unit, which creates the phoenix as an attachment. So you wouldn't need unit -> phoenix attachment-> marine attachment, you could just go marine unit attached to phoenix.
I kept an additionnal marine model actor attached to the phoenix model actor because when I attached directly the marine unit actor to the phoenix, I had a lot of error messages
(CActorUnit marine trying to exclude phoenix model whereas it is already done - did not understand)
So I have 3 models displayed : one for the marine unit, one is the phoenix turret (correctly facing ennemies) and one for the marine "turret" that I want to attach to Phoenix Model.
I tried with SOP Actor "Explicit Rotation" as explained in the other tuto
so my Marine model actor as Phoenix as an host, with SOP : explicit rotation.
But it still doesn't work. I can just flip my turret marine with the xyz variables in SOP Explicit rotation, but it still doesn't rotate... 3 days I am trying to have a turret marine... My motivation is fading lol...
First, Thank you for this tutorial and the Ueberlisk tutorial.
As soo many people I also have an issue that a missile type weapon does not want to fire from the Turret.
It is very easy for a beam type weapons. You just set the Launch Site for the weapon attack actor and then set the weapon with turrent for the unit.
example code:
Attack Actor ( in this tutorial named NE Beam Attack)
set Launch Site: NE Site (Actor)
Unit (in this tutorial named Turret Hub)
set Weapons + and add NE Turret (Weapon and Turret)
This does not work for a missile type weapon. I want to ask what is different and what needs to be set for it to work.
I posted a map where I show this issue I have and would like to ask for help. There is a Battlecruiser with 2 turret attachments 1 weapon is archon psy attack (beam) attack the building to see that it works fine. Second weapon is the missile type weapon (air only), attack the Banshee to see that it does not work :(.
First, Thank you for this tutorial and the Ueberlisk tutorial.
As soo many people I also have an issue that a missile type weapon does not want to fire from the Turret.
It is very easy for a beam type weapons. You just set the Launch Site for the weapon attack actor and then set the weapon with turrent for the unit.
example code:
Attack Actor ( in this tutorial named NE Beam Attack)
set Launch Site: NE Site (Actor)
Unit (in this tutorial named Turret Hub)
set Weapons + and add NE Turret (Weapon and Turret)
This does not work for a missile type weapon. I want to ask what is different and what needs to be set for it to work.
I posted a map where I show this issue I have and would like to ask for help. There is a Battlecruiser with 2 turret attachments 1 weapon is archon psy attack (beam) attack the building to see that it works fine. Second weapon is the missile type weapon (air only), attack the Banshee to see that it does not work :(.
Thx.
You have to check the "Launch Force Site" Action Flag in the Action Actor.
He ProzaicMure, is there a way on making turrets attack individually?, I explain, each turret attack a different target, so the unit can attack 4 targets at the same time.
All my Cannons Fire after I had the same error as BobTHJ.... I disabled the Linked Cooldown, and all the Cannons fired. There is still a message that pops up when i RESAVE any of my Turret Models. The error I get is
USER: [ 35 28] CActorTurret[NETurretActor] A CActorTurret must host off of a CActorModel. Culprit host: [ 35 28] CActorTurret[NETurretActor] Game Forward[ -0.000 -1.000 -0.000] Up[ 0.000 0.000 1.000].
I have an air unit with a large amount of turrets and weapons. However if there is 1 stalker it will only fire one weapon even if there are 5 zerglings on the ground.
If there is no stalker it will shoot at all 5 zerglings.
What can I do to ensure it attacks everything that is not an ally?
It has 12 attachment points, 16 turrets and 16 weapons. I'm probably going to reduce it to 7.
It's basically the Gorgon from the HotS Campaign.
Friend enlightened me on info I should give you:
Only one turret shoots at the one stalker and the rest of the turrets ignore the zerglings. It should fire on the Zerglings too.
Currently all the turrets acquire separate targets if there are multiple targets and I like that. They should probably converge if there aren't enough targets though.
So if 4 turrets then 2 fire at one and 2 at the other or something. Not just only 1 for 1.
Hi there,
First I would like to thank you for this tutorial : it is the only one I found concerning turrets !
I was adding footprints to units to turn them into Towers of a tower defense game, but I realized that it was blocking the rotation of units. It seems logic after all, because it is a kind of anchor in the ground... Anyway, it is why I need to add a turret to my units, in order to have them rotate even with a footprint.
I wrote here to require assistance on a curious point I did not manage to solve even with your tuto :
So what I do :
- creating unit form marine
- creating actor from marine
- creating turret object
- attaching turret object to marine unit for his weapon c-14 gauss rifle.
-> at this point, the unit is displayed stuck on the ground, but the turret is firing 360°. I need only to add a model to the turret.
So what I do :
- at Unit birth (Marine) I set visibility of Marine Actor to hidden
- create a model actor for the turret
- create a turret actor.
When turrets enable, turret actor create. Turret actor is attached to model actor for the turret.
-> at this point, the unit model is hidden, the model actor of the turret is displayed, but it still does not rotate !
I do not understand how the turret can be rotating (it shoots 360°) and not the model, whereas it is attached...
Would you have any idea ??
Thanks for reading !
A turret can only rotate a model, which has a TurretZ attachment point. Unfortunately, very few models do have this (siege tank, immortal, phoenix...). You can look up the available attachment points in the previewer.
For units without such an attachment, the common workaround is to add an invisible phoenix as a turret model and attach your own model to it, so the phoenix turns with the turret, and your model turns with the phoenix. Not sure, if there are better alternatives, I don't know of any.
thank you very much ! I will try that !
But I' am not sure of a thing. I did not manage to reproduce it even if I managed it yesterday T_T.
Now when I add the event to hide my unit actor (the one that will never rotate) with UnitBirth.Marine -> Set Visibility, it is hiding both models ! (unit model and turret model, generated with the turret model actor))
How to hide a model in particular ?
How to attach marine rotation to phenix model rotation ?
Thanks again
Do not use Set Visibility, it also messes up attachments etc. Use Set Opacity instead. If your attachment still becomes invisible, look for its Inherited Properties - field and uncheck Opacity.
Also, I am not sure, what your setup actually is or how it should look like in the end, but if you just want a marine tower, with the marine being the unit and turnable, you can actually attach the unit actor to the phoenix, even though technically it is the unit, which creates the phoenix as an attachment. So you wouldn't need unit -> phoenix attachment-> marine attachment, you could just go marine unit attached to phoenix.
thanks again ! the opacity tip works fine !
But sorry for being slow but how can I do the attachment trick ?
I suppose I have to add an Host to my marine actor
Host + : My phenix model actor
and then make a Site Operation in the marine actor, such as SOP 2D rotation ? (but this one doesn't work )
or should I create a dedicated site operation actor ?
Thx
Hi again,
I tried with the tuto on attachments, but my marine still not rotate.
http://www.sc2mapster.com/forums/resources/tutorials/8926-data-working-with-attachments-beginner-difficulty/?page=3#p59
I kept an additionnal marine model actor attached to the phoenix model actor because when I attached directly the marine unit actor to the phoenix, I had a lot of error messages
(CActorUnit marine trying to exclude phoenix model whereas it is already done - did not understand)
So I have 3 models displayed : one for the marine unit, one is the phoenix turret (correctly facing ennemies) and one for the marine "turret" that I want to attach to Phoenix Model.
I tried with SOP Actor "Explicit Rotation" as explained in the other tuto
so my Marine model actor as Phoenix as an host, with SOP : explicit rotation.
But it still doesn't work. I can just flip my turret marine with the xyz variables in SOP Explicit rotation, but it still doesn't rotate... 3 days I am trying to have a turret marine... My motivation is fading lol...
This is how I would do it. Not sure, where your errors come from, maybe you can figure it out.
@Kueken531: Go
So simple in your file... Thanks a lot
in a nutshell : site operation on the marine unit actor with pre-existing site operation actor "SOP attach turret", host : the phoenix model actor.
Thx
First, Thank you for this tutorial and the Ueberlisk tutorial.
As soo many people I also have an issue that a missile type weapon does not want to fire from the Turret.
It is very easy for a beam type weapons. You just set the Launch Site for the weapon attack actor and then set the weapon with turrent for the unit.
example code:
Attack Actor ( in this tutorial named NE Beam Attack)
Unit (in this tutorial named Turret Hub)
This does not work for a missile type weapon. I want to ask what is different and what needs to be set for it to work.
I posted a map where I show this issue I have and would like to ask for help. There is a Battlecruiser with 2 turret attachments 1 weapon is archon psy attack (beam) attack the building to see that it works fine. Second weapon is the missile type weapon (air only), attack the Banshee to see that it does not work :(.
Thx.
You have to check the "Launch Force Site" Action Flag in the Action Actor.
@Bommes: Go
It Works!!!!! And it is soo simple.
Thank you soo much.
Bommes
I would have another question.
In this case 4 weapons are displayed in the unit UI with the same stats that in the end 1 icon in the UI would be enough.
Is it possible to somehow hide 3 of the 4 weapon icons in the UI so only one icon is visible?
Thanks.
Check the Hidden flag for the weapon
@Kueken531: Go
Awesome. Thank you alot.
Weapon
Worked perfectly
He ProzaicMure, is there a way on making turrets attack individually?, I explain, each turret attack a different target, so the unit can attack 4 targets at the same time.
Help
All my Cannons Fire after I had the same error as BobTHJ.... I disabled the Linked Cooldown, and all the Cannons fired. There is still a message that pops up when i RESAVE any of my Turret Models. The error I get is
USER: [ 35 28] CActorTurret[NETurretActor] A CActorTurret must host off of a CActorModel. Culprit host: [ 35 28] CActorTurret[NETurretActor] Game Forward[ -0.000 -1.000 -0.000] Up[ 0.000 0.000 1.000].
Is there any explanation to this?
Seems you are setting the host to be the wrong model.
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
I have an air unit with a large amount of turrets and weapons. However if there is 1 stalker it will only fire one weapon even if there are 5 zerglings on the ground.
If there is no stalker it will shoot at all 5 zerglings.
What can I do to ensure it attacks everything that is not an ally?
How is it set up?
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
I'm not sure about your question.
It has 12 attachment points, 16 turrets and 16 weapons. I'm probably going to reduce it to 7.
It's basically the Gorgon from the HotS Campaign.
Friend enlightened me on info I should give you:
Only one turret shoots at the one stalker and the rest of the turrets ignore the zerglings. It should fire on the Zerglings too.
Currently all the turrets acquire separate targets if there are multiple targets and I like that. They should probably converge if there aren't enough targets though.
So if 4 turrets then 2 fire at one and 2 at the other or something. Not just only 1 for 1.