simsam Posted January 29, 2013 Share Posted January 29, 2013 Hello, I'm trying to make some alternate controls for combat. Lock on a target and the player orients himself towards it.I tried manyyyyyyyyy different functions, all resulting in some problem. To boil it down my problem is that using player.setangleZ "teleports" the player to the new location, and breaks his animation (making him jiggly like a parkinsonian).So instead of "setting" the orientation, I am looking for a way to apply a force to that object (angular velocity), so the havok engine takes care of smoothly interpolating the view to the desired angle. I know this must sound like gibberish, so to put it plainly:What is the best method to reorient the player's camera or body toward a certain angle? Link to comment Share on other sites More sharing options...
Eckss Posted January 29, 2013 Share Posted January 29, 2013 Try TranslateTo - ObjectReference instead of SetAngle. Link to comment Share on other sites More sharing options...
simsam Posted January 29, 2013 Author Share Posted January 29, 2013 (edited) edit... just quoted myself.. Edited January 29, 2013 by simsam Link to comment Share on other sites More sharing options...
simsam Posted January 29, 2013 Author Share Posted January 29, 2013 (edited) Thanks but i tried it already (as well as splinetranslateto and a couple of others).For some reason the rotation part doesnt get applied on the player (it works on other objects/npcs). Seems like it gets overwritten by something...I tried disabling playercontrols, but to no avail. Here's my update function, as you can see i tried all the functions I could find on creationkit.com.But since im new to modding, i hope i just missed a chapter... Event OnUpdate() ;trackcaster.StopTranslation() float pX = trackcaster.GetPositionX() float pY = trackcaster.GetPositionY() float pZ = trackcaster.GetPositionZ() float angleX = trackcaster.GetAngleX() float angleY = trackcaster.GetAngleY() float head = trackcaster.GetHeadingAngle(trackTarget) float angleZ = trackcaster.GetAngleZ() + head if math.Abs(head) > 0 ; trackcaster.TranslateTo(pX,pY,pZ, angleX, angleY, angleZ,20,200) trackcaster.SetAngle(angleX, angleY, angleZ) ; trackcaster.SplineTranslateTo(pX, pY, pZ,angleX,angleY,angleZ, 100, 100,100) endif ;trackcaster.SetHeadTracking(true) ;trackcaster.SetLookAt(tracktarget,true) RegisterForSingleUpdate(1)endEvent Edited January 29, 2013 by simsam Link to comment Share on other sites More sharing options...
Eckss Posted January 30, 2013 Share Posted January 30, 2013 I can't see why that would be breaking the character's animation. It also should definitely be changing the player's angle. Have you tried putting a Debug.notification in your if math.Abs(head) > 0 conditional? What about updating more often than once per second to make the movements smoother? If this isn't any help, you could always take a look at the scripts in one of the sex mods; presumably they must be overcoming this issue somehow. Link to comment Share on other sites More sharing options...
steve40 Posted February 3, 2013 Share Posted February 3, 2013 For some reason the rotation part doesnt get applied on the player (it works on other objects/npcs). Seems like it gets overwritten by something...The player is under mouse control, which probably overrides any scripted movement like this. I'm guessing that you would probably have to disable player controls for this to work. Link to comment Share on other sites More sharing options...
fore Posted February 17, 2013 Share Posted February 17, 2013 Did you try setvehicle()? This is what makes player and NPCs rotate/move with the cart in the introduction sequence. Link to comment Share on other sites More sharing options...
Recommended Posts