The AttachSetRotation only takes the first 3 values given to it, which are X,Y,Z coordinates, at least when the documentation is correct.
("Constructs and returns an AttachSetPosition message. Sets the position of a model's attach point (or potentially multiple attach points if you use an attach method) to the specified world coordinates.")
I think the function might even work, but the problems lies in something else: We cannot figure out to address the attached turret actor in any way. No matter what I tried it'll always send the message to either the main actor (the whole tank) or it wouldn't work at all.
I tried to access the turret through a variety of references and with different Actor messages, but none of it worked.
I'm not certain how you would use matrices with the AttachSetRotation message. I'm pretty sure I understand the way it's Rotation parameter functions as I have explained to s3rius a few posts up. Testing the inputs with the basic SetRotation message allows me to predictably rotate the unit's actor. I still have not made any progress rotating the attachments though.
I mounted a Thor unit onto the TurretZ attach point through a simple trigger to make sure that this point is rotating with the Siege Tank's barrel, it is. Sending the "AttachSetRotation TurretZ 0.707601, 0.707602, -0.000000" message does not produce any errors so the message must be legit, however it produces no noticable rotation result in either the barrel of the tank or the Thor. Sending the same Rotation parameter through SetRotation rotates my tank to face the desired relative euclidean co-ordinates 1,1,0 (North East). My best guess at the moment is either I am somehow communicating with the incorrect attach point, or there is some flag set in one of the data objects that is preventing me from manually rotating the models attach points.
To those still interested in this post, with all respect to the ingenuity of the above mappers, I am not satisfied with the proposed method of forcing the turret rotation. Undoubtably there is some inteded method of rotating turrets to face a desired point, functions/actions such as "Look At Target From Unit Attach Point"/"Create Look At Target At Unit Attach Point" would not exsist otherwise.
Like I said, we already figured out the rotation parameter yesturday. The problem is it is NOT that simple for the pure reason that it does not work. I have tried sending the rotation to Turret, TurretY, TurretZ and a number of different indexes for each of them with no result.
I removed the creation event on the Turret actor, which apparently only cut it's connection to the unit and not the creation itself. After that I was able to move and rotate the turret to my liking.
Drawback however: The turret doesn't stick to the tank anymore and has to be moved manually.
It still plays animations as normal though (firing etc).
I don't know if this has been solved in another thread but thanks to s3rius's scripts, I was able to find a method to directly effect the turret rotation.
<File Reposted Below>
I have linked the turret rotation with an FPS style camera to better control the turrets movement. All of the turret control information is in the "Turret Update" trigger. TurretPosition[3] is the x([0]), y([1]), and z([2]) values of the turret actor. Also I have found out how to make s3rius's scripts from the presets. Lastly, keep in mind that s3rius has (and I maintained this) deleted the create events from the turret actors in question, which seems to be a vital part.
Variables TurretPosition[3], xOfPolarPoint, and yOfPolarPoint are used in the turret trigger.
The rest of the triggers and variables are for unit movement via arrow pad and camera control in FPS style.
I hope this helps all those who come next.
And again, thank you s3rius.
@CrusaderHeimdall: Go
(I realize that Crusader doesn't seem to log on anymore, maybe someone else can help... s3rius?)
My turret dissapears when putting it in siege mode, I disabled every trigger in my map, copied yours over, created the tank spawn region, deleted the "create" turrent event from both the seige and non-seige turret actors. I manually set "hero" to a siege tank directly where the camera spawns when the map starts. if I leave the create event alone, the turrets just spin, exactly like your map does when I restore the create event.... (in your map, once I redelete these events everything works as should...)
little help?
(btw, changing the "HeroPosition", doesn't seem to effect the turrets behavior in your map)
@ibebusiness:
I am sorry I was not able to get back to you before you solved it yourself.
I am not sure how you fixed your map but I found that you were using a different terrain height than that of my map. I originally set the turret Z to 8.5 so that it looked right on a default map. In your map it was in the ground. I have since reworked my triggers to compensate for terrain height, now that i Know that is an issue. I have also cut out all the unnecessary stuff as well as adding a lot of commenting and a few renamed variables. When I made the triggers I did not expect to be used as a baseline by so many people.
Creation Actors To Delete so far:
Si Ta Turret
Si Ta Sieged Turret
Mi Tu Turret
For anyone still needing the Turret Rotation Triggers, here you go. New and condensed.
Link Removed: http://www.mediafire.com/file/6x4fpmmepx6ld3g/Turret Rotation Essentials.SC2Map
I do not log on here often. If you have questions, click my name and send me an email. I will get back to you that way.
PS. This should be the updated file with Missile Turret support. Something I plan to do in the near future is adapt this for other turreted units.
@xhatix: Go
The AttachSetRotation only takes the first 3 values given to it, which are X,Y,Z coordinates, at least when the documentation is correct.
("Constructs and returns an AttachSetPosition message. Sets the position of a model's attach point (or potentially multiple attach points if you use an attach method) to the specified world coordinates.")
I think the function might even work, but the problems lies in something else: We cannot figure out to address the attached turret actor in any way. No matter what I tried it'll always send the message to either the main actor (the whole tank) or it wouldn't work at all.
I tried to access the turret through a variety of references and with different Actor messages, but none of it worked.
I'm not certain how you would use matrices with the AttachSetRotation message. I'm pretty sure I understand the way it's Rotation parameter functions as I have explained to s3rius a few posts up. Testing the inputs with the basic SetRotation message allows me to predictably rotate the unit's actor. I still have not made any progress rotating the attachments though.
I mounted a Thor unit onto the TurretZ attach point through a simple trigger to make sure that this point is rotating with the Siege Tank's barrel, it is. Sending the "AttachSetRotation TurretZ 0.707601, 0.707602, -0.000000" message does not produce any errors so the message must be legit, however it produces no noticable rotation result in either the barrel of the tank or the Thor. Sending the same Rotation parameter through SetRotation rotates my tank to face the desired relative euclidean co-ordinates 1,1,0 (North East). My best guess at the moment is either I am somehow communicating with the incorrect attach point, or there is some flag set in one of the data objects that is preventing me from manually rotating the models attach points.
To those still interested in this post, with all respect to the ingenuity of the above mappers, I am not satisfied with the proposed method of forcing the turret rotation. Undoubtably there is some inteded method of rotating turrets to face a desired point, functions/actions such as "Look At Target From Unit Attach Point"/"Create Look At Target At Unit Attach Point" would not exsist otherwise.
@Kalekin: Go
simple ...
AttachSetRotation 1,0,0 0,1,0
and as i stated that aint rotation-matrices that are 2 3d-vectors ... and it calculates the angle between them
Like I said, we already figured out the rotation parameter yesturday. The problem is it is NOT that simple for the pure reason that it does not work. I have tried sending the rotation to Turret, TurretY, TurretZ and a number of different indexes for each of them with no result.
@Kalekin: Go
Well it does not work because the Host is setting the rotation ...
Try it out with Immortal Turret,
and the turret is facing 90° in the sky (but is lying around like a dead one)
so you have to find a method to cut of the connection of Turret & Unit
I also did some more research and managed to get it working somehow.
Link Removed: http://www.mediafire.com/?tntetkywhdi
I removed the creation event on the Turret actor, which apparently only cut it's connection to the unit and not the creation itself. After that I was able to move and rotate the turret to my liking.
Drawback however: The turret doesn't stick to the tank anymore and has to be moved manually.
It still plays animations as normal though (firing etc).
That map does not load any names for me. All the triggers and variables are blank.
Mind posting some text-code? Something is definitely wrong with the strings displaying in the editor. I opened it up in MPQ editor just fine.
Also @s3rius:
Create a tank, then reference the turret via "SiegeTankTurret" by using (Actor From Actor) sub-function in triggering.
Then order the turret to Destroy.
The turret does not disappear, it only detaches from the tank.
How is he actually rotating head of unit ? Or Turret ? What is he rotating ? Bone ? Actor ?
So, how do you rotate the turret?! T.T
Cant you just rotate the turret actor with "Send Actor Message"
@SouLCarveRR: I dunno, but probably... If anyone figures out how to do it please post a reply :3
I NEED TO KNOW!!! :C
bumping
also want to know it
I don't know if this has been solved in another thread but thanks to s3rius's scripts, I was able to find a method to directly effect the turret rotation.
<File Reposted Below>
I have linked the turret rotation with an FPS style camera to better control the turrets movement. All of the turret control information is in the "Turret Update" trigger. TurretPosition[3] is the x([0]), y([1]), and z([2]) values of the turret actor. Also I have found out how to make s3rius's scripts from the presets. Lastly, keep in mind that s3rius has (and I maintained this) deleted the create events from the turret actors in question, which seems to be a vital part. Variables TurretPosition[3], xOfPolarPoint, and yOfPolarPoint are used in the turret trigger.
The rest of the triggers and variables are for unit movement via arrow pad and camera control in FPS style.
I hope this helps all those who come next. And again, thank you s3rius.
@CrusaderHeimdall: Go (I realize that Crusader doesn't seem to log on anymore, maybe someone else can help... s3rius?)
My turret dissapears when putting it in siege mode, I disabled every trigger in my map, copied yours over, created the tank spawn region, deleted the "create" turrent event from both the seige and non-seige turret actors. I manually set "hero" to a siege tank directly where the camera spawns when the map starts. if I leave the create event alone, the turrets just spin, exactly like your map does when I restore the create event.... (in your map, once I redelete these events everything works as should...)
little help? (btw, changing the "HeroPosition", doesn't seem to effect the turrets behavior in your map)
isnt´it able to force a actor to look at a unit/point?
maybe you can select the turretactor and force it to watch at a point
xSteamGearx, forcing the actor will make the tank itself face the point, not the turret by itself. Thank you though.
Got it working!