Difference between revisions of "Talk:TranslateTo - ObjectReference"

Jump to navigation Jump to search
no edit summary
imported>Phinix
imported>Terra Nova2
Line 32: Line 32:


Also, the static itself must be re-created under MovableStatic in the CK, not the regular Static section. --[[User:Phinix|Phinix]] 05:01, 16 June 2012 (EDT)
Also, the static itself must be re-created under MovableStatic in the CK, not the regular Static section. --[[User:Phinix|Phinix]] 05:01, 16 June 2012 (EDT)
For a couple of months, I have been trying to discover a less painful way to have collision intact for actors when using TranslateTo. There's been a tiny bit of success. I've mananged to have collision information return to the player and any actor when translation is complete(not to be confused with the Event of the same name). The downside is, collision is still lost '''during''' translation - you/actors will still go through any object while in transit. You may ask what's the difference? Well, if you use the player or an actor with translateto, normally collision does not return even when the translation is complete.
The method of discovery was a activemagic effect script. A very simple script.
<source lang="papyrus">
Scriptname PlayerTranslationScript extends ActiveMagicEffect
Actor property PlayerRef auto
Float property fSpeed = 0.0 auto
{The speed of translation.}
Float PosX
Float PosY
Float PosZ
Actor CasterActor
Actor TargetActor
Event OnEffectStart(Actor akTarget, Actor akCaster)
fSpeed = 1500.0
TargetActor = akTarget
CasterActor = akCaster
PosX = TargetActor.GetPositionX()
PosY = TargetActor.GetPositionY()
PosZ = TargetActor.GetPositionZ()
if CasterActor == PlayerRef
CasterActor.TranslateTo(PosX, PosY, PosZ, 0.0, 0.0, 0.0, fSpeed, 0.0)
endif
EndEvent
</source>
This is interchangable. CasterActor can be replaced with TargetActor(as well as for the GetPos functions). You'll slam into the target, but you'll notice collision has returned. Why this works, I cannot explain, it may involve some internal mechanics I'm not familiar with. This was tested in an exterior, though it should in theory work in interiors but the problem with collision lost during translation will be a lot more noticable. I think this is about as close as I will get to solving this mystery. Oh and this method should work outside of a magic effect script. Will '''not''' work with [[TranslateToRef - ObjectReference|TranslateToRef]]. Untested with the other flavors of translation functions. [[User:Terra Nova2|Terra Nova2]] ([[User talk:Terra Nova2|talk]]) 2014-03-19T11:12:40 (EDT)
Anonymous user

Navigation menu