Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

Bingle

Uploaded by

jarari

Virus scan

Safe to use

About this mod

A papyrus script extender for modifying actor velocity.

Requirements
Permissions and credits
Changelogs
Requirement : Address Library for F4SE Plugins (https://www.nexusmods.com/fallout4/mods/47327)

Actor Velocity Framework



-Papyrus Functions-
It adds these Papyrus functions.


GetActorForward(Actor a) returns the actor's forward vector ortographically projected to the surface.

GetActorUp(Actor a) returns the actor's up vector, which is usually (0, 0, 1)

GetActorEye(Actor a) returns the actor's eye vector, the direction the actor's aiming at.

GetActorAngle(Actor a) returns the actor's angle in radians. [0] for pitch and [2] for yaw.

GetActorVelocity(Actor a) returns the actor's current velocity.

IsOnGround(Actor a) returns true if the actor is on ground.

SetPositionQuick(Actor a, float x, float y, float z) translates the actor without the loading screen.

SetAngleQuick(Actor a, float x, float y, float z) rotates the actor's view to that angle.

SetVelocity(Actor a, float x, float y, float z, float duration, float x2 = 0.0, float y2 = 0.0, float z2 = 0.0, bool gravity = false)
which is the key function of the framework, applies velocity to the actor without ragdolling/paralyzing him.
AVF will apply gravity of -9.81 * fInAirFallingCharGravityMult each frame if gravity is enabled.
First vector(x, y, z) is the initial velocity and second vector(x2, y2, z2) is the terminal velocity.
It will be applied every frame for the designated duration, and the velocity will be linearly interpolated.

AddVelocity(Actor a, float x, float y, float z) will directly add velocity to the actor for just one tick.

-Explicit Linking-
SetVelocity and AddVelocity can be accessed through other F4SE dlls directly through explicit linking.

You can use the code below as an example.
Actor* a;
HMODULE hAVF = GetModuleHandleA("ActorVelocityFramework.dll");
typedef void (*SetVelocity)(std::monostate, Actor*, float, float, float, float, float, float, float);
SetVelocity fnSetVelocity = (SetVelocity)GetProcAddress(hAVF, "SetVelocity");
fnSetVelocity(std::monostate{}, a, dir.x * 2000.0f, dir.y * 2000.0f, dir.z * 2000.0f, 0.75f, 0.0f, 0.0f, 0.0f);


-Usage Example-





Credits

The F4SE Team for Fallout 4 Script Extender (F4SE)

Fudgyduff for Address Library and CommonLibF4