KakouZ Posted April 15, 2018 Share Posted April 15, 2018 Hey fellas, i've got a pretty simple question : I'm making a mod in wich i'd like to make a static object rotate (through papyrus) but encounter 2 small problems 1:When rotating using TranslateTo and SetAngle but my problem seems to be that the rotation is always using the North as it's origin (the acual in game Compass North), but i want it to rotate relatively to itself, so that no matter it's orientation it will always look the same. to make it more clear here are screenshots: Here's what it SHOULD look like, when the static is facing Northhttps://ibb.co/bO1AxS And here's what it looks like when facing east :(https://ibb.co/irDqxS I've seen people using translateToRef() but here i dont think it'll work (or it'll be complicated) since this is a small cover that is spawned with a grenade, so i guess that spawning the target Ref would end up facing the same problem of being rotated locally instead of using world coordinates. (I'd be glad to be proved wrong on this one though) 2: I thought that TranslateTo would let me see the movement but here it just teleports the object in place, not a huge problem but if i could actually see it move i think it'd be a lot fancier and i'd start working on sound too Any help is welcome :D Link to comment Share on other sites More sharing options...
KakouZ Posted April 16, 2018 Author Share Posted April 16, 2018 Bump <3 Link to comment Share on other sites More sharing options...
deadbeeftffn Posted April 16, 2018 Share Posted April 16, 2018 You can get the actual absolute rotation angle for your object with: myObject.GetAngleZ() Then add the desired angle to that value and use myObject.TranslateTo(myObject.GetPositionX(), myObject.GetPositionY(), myObject.GetPositionZ(), 0.0, 0.0, newZValue, 1.0) Link to comment Share on other sites More sharing options...
akiras404 Posted April 16, 2018 Share Posted April 16, 2018 1.You need GetAngle? Note that TranslateTo overwrites the angle if you run SetAngle before TranslateTo completes. obj.SetAngle( obj.GetAngleX()+ax, obj.GetAngleY()+ay, obj.GetAngleZ() + az)2.You tried TranslateTo with very low speed? Link to comment Share on other sites More sharing options...
deadbeeftffn Posted April 16, 2018 Share Posted April 16, 2018 2.You tried TranslateTo with very low speed?Oh, i remeber. That was exactly that what i wanted - a somehow smooth rotation, and it was the reason to use TranslateTo() instead of SetAngle()Anyway, in the OP case, SetAngle() seams to be the better solution. Link to comment Share on other sites More sharing options...
werr92 Posted April 16, 2018 Share Posted April 16, 2018 (edited) 2. You can't translate a Static object fluently, it teleports because of that. To translate something as intended, that object must have collisions updatable by havok. In other words, it should be MovableStatic or MiscObject. First thing to try is create a new MovableStatic and past the path to nif from this Static. Without editing nif file itself. 1. When your object is placed in the result of explosion, set its X,Y,Z angle to be 0. Now you can translate it to some position with simple rotation by 90 degrees, I guess, it's what you need. I would do it this way, because setting angle or translation to a certain angle is meant to be in global gismo. Edited April 16, 2018 by werr92 Link to comment Share on other sites More sharing options...
KakouZ Posted April 20, 2018 Author Share Posted April 20, 2018 Hey guys sorry for the long silence, i've been busy, anyway i tried all these solutions and a few of my own, but i dont think this is gona work, any trigonometry in this engine seems to be absolute, it always aligns with the north whatever function or variables i use (even it's own angle seems to be set in comparison to the rest of the world, not itself), i cant find any way to make this f***ing rotation local, it'll just be a simple cover, after all the rotation helps when fighting upwards enemies but it doesnt happen too often so... meh. Thanks for trying anyway <3 Link to comment Share on other sites More sharing options...
dagobaking Posted April 21, 2018 Share Posted April 21, 2018 (edited) Hey guys sorry for the long silence, i've been busy, anyway i tried all these solutions and a few of my own, but i dont think this is gona work, any trigonometry in this engine seems to be absolute, it always aligns with the north whatever function or variables i use (even it's own angle seems to be set in comparison to the rest of the world, not itself), i cant find any way to make this f***ing rotation local, it'll just be a simple cover, after all the rotation helps when fighting upwards enemies but it doesnt happen too often so... meh. Thanks for trying anyway <3 Hello KakouZ. Just trying to understand the problem better. You aren't needing help rotating it on the z axis, right? Relative adjustments for that are pretty straight forward. You just add or subtract to its existing zangle number. It sounds like you want to tilt it rather than rotate (semantics I know). But, the x or y axis seems to change depending on the direction it is facing on z. If that is the case (I haven't tested this), you can probably set it to face 0 on z first. Then do your x or y rotation while it is in a zeroed out direction. Then rotate the z back to where you want it. BUT, all of that said, I'm not sure why it needs to be tilted via Papyrus like that? Why not just make the nif tilted already? Then, you just make sure x and y are 0.0 and it will always be the right tilt in game. Edited April 21, 2018 by dagobaking Link to comment Share on other sites More sharing options...
Recommended Posts