Hello everyone. This may seem like a silly thread to make, but believe it or not, there's no simple function in Papyrus to make an actor walk forward. The only way known before was to use an invisible actor, and move them in front of the actor wishing to make walk. Problem is, MoveTo is relative to the Actor's position in the cell, not their local location. So you had to use Sin() and Cos() on the actor, then move the invisible reference, then use KeepOffsetFromActor() from the real actor to the dummy ref. It was very math heavy with using angles and math slowed Papyrus down a lot. I used it in my Couch Co-Op Mod for ver 0.1, but after finding this solution out, I replaced the bad code with this in 0.2+.
Turns out the simple way to make an Actor to move forward is:
Actor Property YourActor Auto
Event OnSomeEvent()
YourActor.KeepOffsetFromActor(YourActor, afOffsetX = 0, afOffsetY = 100, afOffsetZ = 0, afCatchUpRadius = 150, afFollowRadius = 0) ;Run FORWARD
EndEvent
Event OnSomeOtherEvent()
?YourActor.ClearKeepOffsetFromActor()
EndEvent
The Actor will technically keep an offset from himself, so using a y value of 100 as seen here is forward, -100 would be backwards. 100 from my testing appears to be full run speed. Lower values will result in slower movement. Values higher than 100 still result in a full run speed.
Left and Right are x, so you can use :
YourActor.KeepOffsetFromActor(YourActor, afOffsetX = 100, afOffsetY = 0, afOffsetZ = 0, afCatchUpRadius = 150, afFollowRadius = 0) ;Run RIGHT
For moving Right, and -100 would be left.
You can also combine the afOffsetX and afOffsetY value to induce diagonal movement:
YourActor.KeepOffsetFromActor(YourActor, afOffsetX = 100, afOffsetY = 100, afOffsetZ = 0, afCatchUpRadius = 150, afFollowRadius = 0) ; Run FORWARD AND RIGHT
Edit: So it appears that SetActorValue("speedmult", yournumber) wasn't even needed. Further testing shows that just setting the x, or y values higher or lower satisfies the same result. Post fixed accordingly.