Hit things with a fresh head this morning and made some progress.
I took turret rotation code from a test map made by s3rius, and have been attempting to adapt it.
rotateEventsGame-PlayerAnyPlayertypesachatmessagecontaining"rotate",matchingExactlyLocalVariablesc=0.0<Real[3]>
f = 0.0 <Real>
myUnit = No Unit <Unit>
turret_actor = No Actor <Actor>
Conditions
Actions
Variable - Set myUnit = Boss 1 - Three-Headed Hydra [48.90,17.90]
Variable - Set turret_actor = (Actor connected to (Actor for myUnit) via reference "::global.HydraTurretBody")
General - Custom Script:
lv_c[0]=PointGetX(UnitGetPosition(lv_myUnit));
lv_c[1]=PointGetY(UnitGetPosition(lv_myUnit));
lv_c[2]=8.5;
lv_f+=0.02;
if (lv_f>1){
lv_f=-1;
}
ActorSend(lv_turret_actor, "AttachSetRotation {TurretZ 0} -0.707107,"+FixedToString(lv_f,6)+",-0.000000");
ActorSend(lv_turret_actor, "AttachSetPosition {TurretZ 0} "+FixedToString(lv_c[0],6)+","+FixedToString(lv_c[1],6)+","+FixedToString(lv_c[2],6));
So, pre-rotate, things currently look like this:
Notice that the hydralisk, it's attached (oversized for visual ease) "head", the top of the photon cannon turret actor, and the regular unit (drone) are all facing south.
The actors for that look a little like this:
And the result after rotating looks like this:
Meaning that something is definitely wrong with the numbers I poorly tried to plug in for rotation. My first guess would be the unit coordinates, but since the turret actor is attached to the unit at the origin, I would think X,Y,Z coordinates would be the same for each...but I guess the turret head isn't at the origin anymore, since it's not "on top" of the turret, but rather "in front" of it (pointing southwards instead of upwards).
But this is just a theory, and I'm not sure what else has to be altered to compensate for changing the axis of rotation.
I did a re-scouring of ProzaicMuse's tutorials, created a turret, and successfully got the hydralisk to attach to a turret that would theoretically allow it to rotate along that axis. I then tried copying some code found around sc2mapster to rotate the turret, but have had no luck implementing it.
I'm not even 100% sure that I'm trying to rotate the right actor.
I have the unit, which has a Turret Body (type: model) attached to it, there's an actor type turret that uses that, and a model attached to the head of the turret. All of this is more or less copy-pasted from ProzaicMuse's Uberlisk tutorial, verified on turret tutorials, etc.
Okay, so there are no attachment points on the hydralisk (and I'm guessing most models) which point backwards (changing the "up" of the attachment point would change the axis of rotation).
If I could get a turret properly attached that had it's "up" changed to "backward", this could be pulled off, but I have been unsuccessful in changing facing direction.
I'm trying to create a three-headed hydra using data editor. At this point, it would have been faster to $%&# open max and do it that way.
My thinking was to have the base model, and have two other models, scaled down and rotated by about 15 or so degrees.
So, I tried to get around that and use turrets to rotate stuff. In addition to being too retarded to get the attachments to work right, I've yet to figure out how to get the turret to change by roll instead of yaw.
So. Three-Headed Hydra. Anyone?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So...still no idea how to roll a unit or properly rotate an alternative-axis turret?
Hit things with a fresh head this morning and made some progress.
I took turret rotation code from a test map made by s3rius, and have been attempting to adapt it.
So, pre-rotate, things currently look like this:
Notice that the hydralisk, it's attached (oversized for visual ease) "head", the top of the photon cannon turret actor, and the regular unit (drone) are all facing south.
The actors for that look a little like this:
And the result after rotating looks like this:
Meaning that something is definitely wrong with the numbers I poorly tried to plug in for rotation. My first guess would be the unit coordinates, but since the turret actor is attached to the unit at the origin, I would think X,Y,Z coordinates would be the same for each...but I guess the turret head isn't at the origin anymore, since it's not "on top" of the turret, but rather "in front" of it (pointing southwards instead of upwards).
But this is just a theory, and I'm not sure what else has to be altered to compensate for changing the axis of rotation.
I did a re-scouring of ProzaicMuse's tutorials, created a turret, and successfully got the hydralisk to attach to a turret that would theoretically allow it to rotate along that axis. I then tried copying some code found around sc2mapster to rotate the turret, but have had no luck implementing it.
I'm not even 100% sure that I'm trying to rotate the right actor.
I have the unit, which has a Turret Body (type: model) attached to it, there's an actor type turret that uses that, and a model attached to the head of the turret. All of this is more or less copy-pasted from ProzaicMuse's Uberlisk tutorial, verified on turret tutorials, etc.
Okay, so there are no attachment points on the hydralisk (and I'm guessing most models) which point backwards (changing the "up" of the attachment point would change the axis of rotation).
If I could get a turret properly attached that had it's "up" changed to "backward", this could be pulled off, but I have been unsuccessful in changing facing direction.
Yes, I have played around with that, to no avail :(
I'm trying to create a three-headed hydra using data editor. At this point, it would have been faster to $%&# open max and do it that way. My thinking was to have the base model, and have two other models, scaled down and rotated by about 15 or so degrees.
APPARENTLY models can be rotated via pitch and yaw (z and x axis, I think), but blizzard has some sort of hatred of barrel rolls, because rotating roll is impossible [source: http://forums.sc2mapster.com/development/map-development/902-rotating-units-around-x-or-y-axis/]. And, if that citation is correct, has been impossible since beta with no resolution.
So, I tried to get around that and use turrets to rotate stuff. In addition to being too retarded to get the attachments to work right, I've yet to figure out how to get the turret to change by roll instead of yaw.
So. Three-Headed Hydra. Anyone?