How do I attach the model to turret Z? My only reference to Turret Z in my turret is on the turret actor via Yaw Query. I couldn't find a SOpAttachTurretZ, only a SOpAttachTurret.
If I can't figure out how to attach this model to turret z... maybe I failed to use turret Z correctly? How should I have selected turret Z for the turret?
Look at the SOpAttachTurret actor, you will find it does exactly that under the Attachment - Attachment Query - Methods field. TurretZ (as opposed to TurretY) is an attachment point. The model either has it or it does not.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Alright, I created the marker. I think I accidentally applied it to every unit since every unit had one, but this picture shows the problem a bit clearer.
Again, I'm shooting at the barracks. The projectile is created and follows the correct trajectory (it goes from the Phoenix to the barracks). However, the Phoenix and Marker are both pointing 90 degrees to the right of its target.
Well I am out of ideas. Last hope is to redo everything for that unit from scratch. Unless there is some flag under the weapon that is not right. Sure you only gave the marker the SOpAttachTurret SOp?
If I was to rebuild this from scratch, is there a tutorial I can use that's more relevant to what I'm doing? I originally used Prozaic's beginner's tutorial on turrets. However, he used a beam in his and I wanted to use a missile. I thought it would be a simple change to just use a missile actor instead of a beam actor and make a few small adjustments but I think that's where I went wrong.
I'm going to go through that tutorial again too. Maybe I didn't do something quite right.
I looked through the weapon too. Weapon: Allowed Movement is set to Moving, and Weapon Options is set to just Can Initiate Attack. I tried enabling the standard "Only Fire While Attacking" and "Only Fire At Attack Target", but the problem persists.
I also tried restoring the unit's attack animation to normal. That didn't fix it either, however. The unit goes back to playing its attack animation and the turret continues to turn its wing to the target.
I found the problem and I have no idea how I'm going to about fixing it. On a hunch, I replaced the model I'm using (custom model I got from the art assets here on SC2Mapster) with Nova (Terran Ghost). Several things happened.
1) The attack is no longer attached properly. It's shooting from Nova instead of the turret.
2) Nova has some weird animation for attacking (expected, since I disabled the attack animation on the model I'm using and I don't know what Nova's default animations are)
3) The Phoenix now points exactly the right direction.
Something is up with the model I downloaded. Maybe the attachment point on it is rotated, or perhaps the model itself is rotated (although I haven't noticed problems anywhere else). At this point I'm not sure how I'd go about fixing this. :(
EDIT: Just tested, the model is facing the same direction as every other model. I set it to face 90 degrees (top of the screen), switched the models, and it still faces the same way. However, there's two differences.
1) With the custom model, the Phoenix is positioned behind the unit and to the right. With the normal model, the Phoenix is positioned to the front of the unit and to the right.
2) You probably guessed this already, with the custom model the Phoenix is facing 90 degrees right, while with the normal mode the Phoenix is facing straight forwards. This explains everything except how I change this angel, taking a look at the attachment points now. Is there some way to "turn" the way something is attached by any chance?
EDIT2: Found the problem exactly. Standard SC2 Units have an origin that points straight up. However, when viewed in the previewer, the flat side is to the front and back, with the sharp sides to the left and right. The custom model I downloaded still has it pointing straight up, but the flat side is to the left and right, and the sharp side is to the front and back. In other words, the origin attachment point is adjusted 90 degrees to the right, so of course, anything attached to the origin point is turned 90 degrees to the right as well.
Is there a viable workaround to this? I'm pondering creating a dummy model with ordinary attachment points, but if I attach said model to the custom model, it'll be turned sideways too leaving me with the same predicament.
I'm supposed to add it to the site right? For some reason once I add it, the projectile goes back to launching from the unit instead of the turret (Launch Force Site is still on). Also, how does this particular actor work? I figured a rotation would be done in angles, but it's asking for x/y/z values instead for "forward" and "up".
EDIT: Oh. Even with it gone, the missile is launching from my unit... so I broke something again, probably while poking around yesterday. :(
I rebuilt all the actors / turrets and such in a new map as a test to see if it would work if I simply started from scratch. It doesn't work... but this one I can post in case it helps anyone sort out where the problem is.
For some reason I'm getting an action actor error too but I don't think that's too relevant since I've gotten those before. Usually it just means I forgot a .Start or .End somewhere.
WELCOME TO ACTORS!! WW2 Diplo has over 500 of them >.>
Now that thats said. Lets check the following:
Go to the phoenix in the models tab, go to the model link and view it in previewer. Lower right hand window and look for attachments. Make sure it has a TurretZ attachment. If it doesn't then you can go to case 1. If it does, go to case 2.
Case 1:
You need the following: 3ds, the .m3 import/export tools. An MPQ reader. You can get 3ds max 2012 student version for free from the 3ds website.
First, pull out the .m3 model for the pheonix using the MPQ. Then import it into 3ds (you can probably avoid having to port the textures into the maps folder in the 3ds root folder). Go to the helper objects, add an attachment. Make it a custom type, name it Ref_TurretZ and make sure the other field is also Ref_TurretZ. Put it where ever and make sure that its rotation is 0,0,0 (otherwise the attachment point comes out funny). Be sure to link all geometry and attachments to the TurretZ attachment. Otherwise funny stuff happens.
Then import it (with all animations) back into sc2. Use assets/textures/ texture path. Make sure you have "export hidden objects" selected when you export.
Then go to Case 2:
Case 2:.
Make it a model (modeladdition).
Events:
Unitbirth.Unit
Create
Then Host+ to your core unit actor.
Then SOpAttachOrigin , a Local Offset, and whatever explicit rotation you need.
Then go to turrets tab:
Create a turret. make its rotation 360. Set its rotation rate to something like 5000.
Then create an actor type turret.
Set the turret body to the attachment model, set the turret pitch query to TurretZ (both in the direct attachment type and the fallback) - this is why you need the TurretZ attachment, it will not be able to chose any any other attachment that will work.
Then for the events+
turretenable.(turret from turrets tab)
-Create
Then create a Site actor.
Events+
UnitBirth.CoreUnit)
-Create
Host+ = The attached model
Hosted Site Ops = SoPAttach(whatever), Localoffset
Then in the attack actor.
Launch Force Site
Host Supporter+= The turret modelattachment
Launch Site: Your site actor.
Then to units tab:
In the Combat-Weapons: Set the turret to your created turret from the turrets tab. Then the weapon thats linked to the attack actor.
THIS is where the weapon and turret are linked. Combat-Turrets is for passive turrets (such as mothership rotation or that one babylon 5 warship who's center rotates). That is for some neat tricks with actors. Use Combat-Weapons to link and turret and a weapon. Until you do this, they are seperate and unlinked. Once you set that they ought to be linked.
so using autogun and not pheonix model does not solve the issue?
I haven't tried autogun, but I've tried Siege Tank and something else per your last recommendation.
I'm kind of confused cause I solved this problem once already, but it somehow got... unsolved. And for some reason, the re-creation in the new map doesn't work either. o.O
I went through all the data objects in my project and checked everything. I did basically everything you said except that on the Site Actor, I didn't include the Hosted Site Op for the local offset and on the attack actor I didn't have Host Supporter set.
I made both the changes, and it's still not working. Let me try it again on the test map and if it doesn't work I'll re-upload it.
EDIT: Attached the updated testing map. Still doesn't work with the changes.
WELCOME TO ACTORS!! WW2 Diplo has over 500 of them >.>
:)
I think my submission for the creature contest used about 400 actors (including site operations n stuff), and that is one unit.
As for your error: You use the default Karass psi weapon thingy, which already has an action actor and add another action actor on top of it; however one effect can only support one action actor. Either disable the default actor or modify it and delete the new one, or copy the effects for the weapon.
Interesting. I fixed that, and now the testing map is working fine. Now to figure out what exactly I need to do to make my real mod file work fine too...
By the way, how do explicit rotation site operation actors work? It doesn't seem to have an angle of rotation field, only coordinate based (forward and up).
Okay, I got the attack to shoot from the turret again. I finally decided I wasn't going to save the action actor I had made, so I deleted it and re-made it from scratch, meticulously copying the working one. It now works like a charm.
I just need to figure out the whole explicit rotation.
So, for some reason, the model I'm using has an origin point that's rotated 90 degrees relative to the standard origin points for SC2 models. For that reason, anything attached to the origin point is similarly rotated by 90 degrees. An odd side-effect of this is that when the turret rotates to attack a target, it rotates until it faces 90 degrees to the right of the target.
I think what I need to do is add Site Operation (Explicit Rotation) to the model addition actor. How do I tell the Explicit Rotation actor to rotate 90 degrees though? Do I need to add this Site Operation to the Site Actor as well, like I did for the Site Operation (Local Offset)?
EDIT: After some googling I found a topic where someone said to rotate it to face west, use values of 0, -1, and 0. I tried doing so, but now I've got very odd results. If my unit is facing 90 degrees (straight north), the turret turns and points its weapon at the target. However, if my unit is facing 270 degrees (straight south), the target turns and points its back-end at the target. I tested some more angles and it seems like if the core unit is not facing 90 degrees, the turret turns by however many degrees off the unit is. Is this what explicit rotation is supposed to do? o.O
Explicit Rotation sets the forward and up vectors of an actor to your specified vectors. Imagine yourself standing still. The direction you would look would be your forward vector, speaking in SC2 coordinates, this would be (0,-1,0). The up vector points from your feet to your head, (0,0,1) in coordinates.
If you use those values for an explicit rotation site operation, it should not rotate the model at all. If you change these vectors, obviously you should only use orthogonal vector pairs, since you cannot deform the model. If you use linear dependant vectors, you produce strange and basically uncontrollable results.
Now, if you want the model to turn, you would need to change the forward vector, for example to (1,0,0). Imagine yourself not looking forward anymore, but in the direction of this new vector, which would be 90 degrees right.
Same goes for the up vector, except it does not change the direction you look, but the way your head points at. So, if you would use (1,0,0) as an up vector (and still the default (0,-1,0) forward vector), your body would bend to the right.
Also, for these vectors, only the direction counts. There is no difference in using (0,1,2) or (0,10,20)
Unfortunately, the rotation rotates the entire turret, independend of the turret rotation, so if you flip a turret, it will turn in the wrong direction. In some cases, you might be able to simulate correct turning by using a second, un-flipped and invisible turret and attaching the real one.
@DrSuperEvil: Go
How do I attach the model to turret Z? My only reference to Turret Z in my turret is on the turret actor via Yaw Query. I couldn't find a SOpAttachTurretZ, only a SOpAttachTurret.
If I can't figure out how to attach this model to turret z... maybe I failed to use turret Z correctly? How should I have selected turret Z for the turret?
Look at the SOpAttachTurret actor, you will find it does exactly that under the Attachment - Attachment Query - Methods field. TurretZ (as opposed to TurretY) is an attachment point. The model either has it or it does not.
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
@DrSuperEvil: Go
Alright, I created the marker. I think I accidentally applied it to every unit since every unit had one, but this picture shows the problem a bit clearer.
Again, I'm shooting at the barracks. The projectile is created and follows the correct trajectory (it goes from the Phoenix to the barracks). However, the Phoenix and Marker are both pointing 90 degrees to the right of its target.
Well I am out of ideas. Last hope is to redo everything for that unit from scratch. Unless there is some flag under the weapon that is not right. Sure you only gave the marker the SOpAttachTurret SOp?
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
@DrSuperEvil: Go
Yep, that's the only Site operation I used.
If I was to rebuild this from scratch, is there a tutorial I can use that's more relevant to what I'm doing? I originally used Prozaic's beginner's tutorial on turrets. However, he used a beam in his and I wanted to use a missile. I thought it would be a simple change to just use a missile actor instead of a beam actor and make a few small adjustments but I think that's where I went wrong.
I'm going to go through that tutorial again too. Maybe I didn't do something quite right.
I looked through the weapon too. Weapon: Allowed Movement is set to Moving, and Weapon Options is set to just Can Initiate Attack. I tried enabling the standard "Only Fire While Attacking" and "Only Fire At Attack Target", but the problem persists.
I also tried restoring the unit's attack animation to normal. That didn't fix it either, however. The unit goes back to playing its attack animation and the turret continues to turn its wing to the target.
!@#$
I found the problem and I have no idea how I'm going to about fixing it. On a hunch, I replaced the model I'm using (custom model I got from the art assets here on SC2Mapster) with Nova (Terran Ghost). Several things happened.
1) The attack is no longer attached properly. It's shooting from Nova instead of the turret. 2) Nova has some weird animation for attacking (expected, since I disabled the attack animation on the model I'm using and I don't know what Nova's default animations are) 3) The Phoenix now points exactly the right direction.
Something is up with the model I downloaded. Maybe the attachment point on it is rotated, or perhaps the model itself is rotated (although I haven't noticed problems anywhere else). At this point I'm not sure how I'd go about fixing this. :(
EDIT: Just tested, the model is facing the same direction as every other model. I set it to face 90 degrees (top of the screen), switched the models, and it still faces the same way. However, there's two differences.
1) With the custom model, the Phoenix is positioned behind the unit and to the right. With the normal model, the Phoenix is positioned to the front of the unit and to the right.
2) You probably guessed this already, with the custom model the Phoenix is facing 90 degrees right, while with the normal mode the Phoenix is facing straight forwards. This explains everything except how I change this angel, taking a look at the attachment points now. Is there some way to "turn" the way something is attached by any chance?
EDIT2: Found the problem exactly. Standard SC2 Units have an origin that points straight up. However, when viewed in the previewer, the flat side is to the front and back, with the sharp sides to the left and right. The custom model I downloaded still has it pointing straight up, but the flat side is to the left and right, and the sharp side is to the front and back. In other words, the origin attachment point is adjusted 90 degrees to the right, so of course, anything attached to the origin point is turned 90 degrees to the right as well.
Is there a viable workaround to this? I'm pondering creating a dummy model with ordinary attachment points, but if I attach said model to the custom model, it'll be turned sideways too leaving me with the same predicament.
The SOp (Explicit Rotation) actor?
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
@DrSuperEvil: Go
I'm supposed to add it to the site right? For some reason once I add it, the projectile goes back to launching from the unit instead of the turret (Launch Force Site is still on). Also, how does this particular actor work? I figured a rotation would be done in angles, but it's asking for x/y/z values instead for "forward" and "up".
EDIT: Oh. Even with it gone, the missile is launching from my unit... so I broke something again, probably while poking around yesterday. :(
I rebuilt all the actors / turrets and such in a new map as a test to see if it would work if I simply started from scratch. It doesn't work... but this one I can post in case it helps anyone sort out where the problem is.
For some reason I'm getting an action actor error too but I don't think that's too relevant since I've gotten those before. Usually it just means I forgot a .Start or .End somewhere.
1. No host subject or SOps for your Site actor.
2. Forgot the force launch site flag in the action actor.
3. Forgot to add the turret to the Combat - Turrets field (important for turrets not on the main Unit actor).
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
Fixed all of those issues... problem still persists. Attached updated version.
so using autogun and not pheonix model does not solve the issue?
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
WELCOME TO ACTORS!! WW2 Diplo has over 500 of them >.>
Now that thats said. Lets check the following:
Go to the phoenix in the models tab, go to the model link and view it in previewer. Lower right hand window and look for attachments. Make sure it has a TurretZ attachment. If it doesn't then you can go to case 1. If it does, go to case 2.
Case 1: You need the following: 3ds, the .m3 import/export tools. An MPQ reader. You can get 3ds max 2012 student version for free from the 3ds website.
First, pull out the .m3 model for the pheonix using the MPQ. Then import it into 3ds (you can probably avoid having to port the textures into the maps folder in the 3ds root folder). Go to the helper objects, add an attachment. Make it a custom type, name it Ref_TurretZ and make sure the other field is also Ref_TurretZ. Put it where ever and make sure that its rotation is 0,0,0 (otherwise the attachment point comes out funny). Be sure to link all geometry and attachments to the TurretZ attachment. Otherwise funny stuff happens.
Then import it (with all animations) back into sc2. Use assets/textures/ texture path. Make sure you have "export hidden objects" selected when you export.
Then go to Case 2:
Case 2:.
Make it a model (modeladdition).
Events: Unitbirth.Unit Create
Then Host+ to your core unit actor.
Then SOpAttachOrigin , a Local Offset, and whatever explicit rotation you need.
Then go to turrets tab: Create a turret. make its rotation 360. Set its rotation rate to something like 5000. Then create an actor type turret.
Set the turret body to the attachment model, set the turret pitch query to TurretZ (both in the direct attachment type and the fallback) - this is why you need the TurretZ attachment, it will not be able to chose any any other attachment that will work. Then for the events+ turretenable.(turret from turrets tab) -Create
Then create a Site actor. Events+ UnitBirth.CoreUnit) -Create
Host+ = The attached model Hosted Site Ops = SoPAttach(whatever), Localoffset
Then in the attack actor. Launch Force Site
Host Supporter+= The turret modelattachment
Launch Site: Your site actor.
Then to units tab:
In the Combat-Weapons: Set the turret to your created turret from the turrets tab. Then the weapon thats linked to the attack actor.
THIS is where the weapon and turret are linked. Combat-Turrets is for passive turrets (such as mothership rotation or that one babylon 5 warship who's center rotates). That is for some neat tricks with actors. Use Combat-Weapons to link and turret and a weapon. Until you do this, they are seperate and unlinked. Once you set that they ought to be linked.
Let me know how all of that turned out.
I haven't tried autogun, but I've tried Siege Tank and something else per your last recommendation.
I'm kind of confused cause I solved this problem once already, but it somehow got... unsolved. And for some reason, the re-creation in the new map doesn't work either. o.O
@FockeWulf: Go
I went through all the data objects in my project and checked everything. I did basically everything you said except that on the Site Actor, I didn't include the Hosted Site Op for the local offset and on the attack actor I didn't have Host Supporter set.
I made both the changes, and it's still not working. Let me try it again on the test map and if it doesn't work I'll re-upload it.
EDIT: Attached the updated testing map. Still doesn't work with the changes.
:)
I think my submission for the creature contest used about 400 actors (including site operations n stuff), and that is one unit.
As for your error: You use the default Karass psi weapon thingy, which already has an action actor and add another action actor on top of it; however one effect can only support one action actor. Either disable the default actor or modify it and delete the new one, or copy the effects for the weapon.
@Kueken531: Go
Interesting. I fixed that, and now the testing map is working fine. Now to figure out what exactly I need to do to make my real mod file work fine too...
By the way, how do explicit rotation site operation actors work? It doesn't seem to have an angle of rotation field, only coordinate based (forward and up).
Okay, I got the attack to shoot from the turret again. I finally decided I wasn't going to save the action actor I had made, so I deleted it and re-made it from scratch, meticulously copying the working one. It now works like a charm.
I just need to figure out the whole explicit rotation.
So, for some reason, the model I'm using has an origin point that's rotated 90 degrees relative to the standard origin points for SC2 models. For that reason, anything attached to the origin point is similarly rotated by 90 degrees. An odd side-effect of this is that when the turret rotates to attack a target, it rotates until it faces 90 degrees to the right of the target.
I think what I need to do is add Site Operation (Explicit Rotation) to the model addition actor. How do I tell the Explicit Rotation actor to rotate 90 degrees though? Do I need to add this Site Operation to the Site Actor as well, like I did for the Site Operation (Local Offset)?
EDIT: After some googling I found a topic where someone said to rotate it to face west, use values of 0, -1, and 0. I tried doing so, but now I've got very odd results. If my unit is facing 90 degrees (straight north), the turret turns and points its weapon at the target. However, if my unit is facing 270 degrees (straight south), the target turns and points its back-end at the target. I tested some more angles and it seems like if the core unit is not facing 90 degrees, the turret turns by however many degrees off the unit is. Is this what explicit rotation is supposed to do? o.O
Explicit Rotation sets the forward and up vectors of an actor to your specified vectors. Imagine yourself standing still. The direction you would look would be your forward vector, speaking in SC2 coordinates, this would be (0,-1,0). The up vector points from your feet to your head, (0,0,1) in coordinates.
If you use those values for an explicit rotation site operation, it should not rotate the model at all. If you change these vectors, obviously you should only use orthogonal vector pairs, since you cannot deform the model. If you use linear dependant vectors, you produce strange and basically uncontrollable results.
Now, if you want the model to turn, you would need to change the forward vector, for example to (1,0,0). Imagine yourself not looking forward anymore, but in the direction of this new vector, which would be 90 degrees right.
Same goes for the up vector, except it does not change the direction you look, but the way your head points at. So, if you would use (1,0,0) as an up vector (and still the default (0,-1,0) forward vector), your body would bend to the right.
Also, for these vectors, only the direction counts. There is no difference in using (0,1,2) or (0,10,20)
Unfortunately, the rotation rotates the entire turret, independend of the turret rotation, so if you flip a turret, it will turn in the wrong direction. In some cases, you might be able to simulate correct turning by using a second, un-flipped and invisible turret and attaching the real one.