TranslateTo collision issues with moving statics

Post » Mon Nov 19, 2012 6:06 pm

Well, this should fully explain the problems:
http://www.youtube.com/watch?v=gsmAN_OzVRg&feature=plcp&t=1m15s

"Riding" on an animated static sort of works, but it's not very smooth, and as the speed increases it becomes even less so. At a speed of 500 it's very easy to fall off without re-adjusting yourself constantly.

So... I really want to be able to "ride" on the static but still be able to walk around on it as well, as I'm doing in the video, without any jittering or possibility of falling off. Is there something I can do to the mesh that will fix this issue? Or is it a problem with using TranslateTo entirely? TranslateTo is so easy to use that I hope there's a fix for this.

If not, then I guess I'll have to make my own function that also moves the player at the same time... so if anyone has already done the math for keeping the player in the same place relative to the static's origin, while moving them both and allowing the player to walk around, it would be nice of you to share.

P.S. Also if you know how to fix those black spots that the CK leaves on the LOD textures, please tell me.
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Mon Nov 19, 2012 3:32 pm

As far as I know, it's a problem with TranslateTo. There's nothing that can be done to "update" the collision any faster.
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Mon Nov 19, 2012 5:49 am

So using my own function with MoveTo/SetPosition doesn't work either, you can see why here:
http://www.youtube.com/watch?v=ChLWk1_mDjs
Increasing the "frame rate" to something that looks like movement results in the ship being completely invisible as it fades in every time it moves.

Also it happens to the player if I move the player too. The player's view goes black every "frame" of movement and they lose control for a second.

So any ideas on how to fix either of these problems? If not, I guess I'll have to stick to using TranslateTo on both the ship and the player, without allowing them to move around...

Here's the script (with many comments) if it helps:
Spoiler

Scriptname AATestTranslateTo extends ObjectReference;I found this in TranslateTo talk on the Creation Kit wiki:;To get Static object collisions to work with TranslateTo (to avoid leaving them behind as you describe), you must edit the bhkRigidBody settings in NifSkope to change:;Layer: Change OL_STATIC to OL_ANIM_STATIC.;Layer Copy: Change OL_STATIC to OL_ANIM_STATIC.;Motion System: Change MO_SYS_BOX_STABILIZED to MO_SYS_BOX.;Also, the static itself must be re-created under MovableStatic in the CK, not the regular Static section. --Phinix 05:01, 16 June 2012 (EDT);However, TranslateTo has issues with collision if you're riding the object, so I don't think just that will work.import Math;--------------------------------; Define vars;The ref(s) to move toObjectReference property TargetRef auto;The rideractor rider;Angle from current position to the targetfloat angle;Distance to target in game unitsfloat distance;How long the translation should take, in seconds?;This should probably be changed to a property.float translationtime = 60.0;How often to update position, in seconds?;Might have to make this a global variable and allow players to configure it themselves...;1.0 = 1 fps;0.04 = 25 fps;0.02 = 50 fps;0.01 = 100 fpsfloat interval = 1.0;Distance per step in game unitsfloat stepdist;How many iterationsint steps;--------------------------------; EventsEvent OnActivate(ObjectReference akActionRef)	;Make the rider the player for now.	rider = Game.GetPlayer()		;Absolute distance	;This is the hypotenuse of the triangle made by the x and y distance to the target	float xdist = Abs( Abs(GetPositionX()) - Abs(TargetRef.GetPositionX()) )	float ydist = Abs( Abs(GetPositionY()) - Abs(TargetRef.GetPositionY()) )	distance = Sqrt(Pow(xdist, 2)+Pow(ydist, 2))	Debug.Notification("xdist: "+xdist+" ydist: "+ydist+" straight distance: "+distance)		;Number of steps and step distance	steps = (translationtime * ( 1 / interval )) as int	stepdist = distance / steps		;Calculate angle to move	angle = GetHeadingAngle(TargetRef) + GetAngleZ()	Debug.Notification("Angle: "+angle+" Steps: "+steps+" stepdist: "+stepdist)	;Should probably replace this with a recursive function later and pass in the translationtime.	int i = 0	while ( i &--#60; steps )		i+=1		MoveShip(stepdist, angle)		Utility.Wait(interval)	endwhileEndevent;--------------------------------; FunctionsFunction MoveShip(float d, float a)	;Set its z angle to the calculated "forward" angle.	;Might have to offset by 90 or something if the model is locally rotated.	;But this may make it easier to move in a bezier curve later on, because we will always just be moving forward in small approximations.	SetAngle(GetAngleX(), GetAngleY(), a)		;Possibly add some simulated "rocking" from waves here, but that is low-priority.		;Move it forward by one step	SetPosition( GetPositionX() + d * Sin(GetAngleZ()), GetPositionY() + d * Cos(GetAngleZ()), GetPositionZ() )	;TranslateTo(  GetPositionX() + d * Sin(GetAngleZ()), GetPositionY() + d * Cos(GetAngleZ()), GetPositionZ(), GetAngleX(), GetangleY(), a, 1000, 0 )		;Now the tricky part: move all of the riders	;For now just test it on one rider - the player.		;The following does NOT work at all, the screen goes black every second and the player cant move:	;rider.MoveTo( rider, distance*Math.Sin(a), distance*Math.Cos(a), 0 )	Endfunction;P.S. Bethesda: add correct comment highlighting to your code tag please...
User avatar
kat no x
 
Posts: 3247
Joined: Mon Apr 16, 2007 5:39 pm


Return to V - Skyrim