Jump to content

Script function to raise Z position?


Blezmo

Recommended Posts

Is there a script function to raise the Z position of an object or actor?

The set position Z isn't that useful here. There's a mod called XPMSE that allows you to set your character's "Z offset" which basically allows you to set your character to float above the floor or sink slightly through the floor.
I wonder If I could do something like that with a script function.

Link to comment
Share on other sites

Why SetPositionZ() is not that useful? It's the only way to manipulate Z positions.

 

Because I need to know the current Z position in order to raise it. Its not useful for making a simple script that simply raises the character regardless of where he is.

For example, you Z position is diffrant if you are on a mountain than if you were inside a cavern.

Link to comment
Share on other sites

I

 

Use GetPositionZ() first then use SetPostionZ()

was hoping SKSE would have something better like, addpositionZ

Using getposition Z would be a very tedious thing for the script I'm trying to make.

 

Im trying to make a script that will prevent a small character from sinking through chairs when sitting down by simplying setting their Z position higher while the actor is sitting.

If I use getpositionZ then setpositionZ then I would have to make an if then script value for every single world z position in the game.

Link to comment
Share on other sites

Something like this should work just fine:

 

bool was_sitting

if (Actor.GetSitState() == 3)
     was_sitting = true
     Actor.SetPosition(Actor.GetPositionX(), Actor.GetPositionY(), Actor.GetPositionZ() + zOffset)
elseif (was_sitting == true)
     was_sitting = false
     Actor.SetPosition(Actor.GetPositionX(), Actor.GetPositionY(), Actor.GetPositionZ() - zOffset)
endif
Edited by Reneer
Link to comment
Share on other sites

Blezmo I think you might be complicating it. Are you basically wanting to add like 10.0 to the actors current z position?

 

yeah something like that

Link to comment
Share on other sites

Is there a script function to raise the Z position of an object or actor?

The set position Z isn't that useful here. There's a mod called XPMSE that allows you to set your character's "Z offset" which basically allows you to set your character to float above the floor or sink slightly through the floor.

I wonder If I could do something like that with a script function.

 

Setposition() is hardly ever useful on an actor. And especially in the case of a furniture animation.

 

Furniture animations (like sitting) are designed to make a tight connection between furniture and actor, so even bumping has no effect. The only result of setting z position is that the animation will be temporarily interrupted (going to idle) and then resumed in the old place. Generally I think it would look quite strange, if a tiny actor would start the regular sit entry, and then all of the sudden is teleported to a higher location.

 

XPMSE is changing skeletons. And if there is no SKSE interface for that, you would probably need an SKSE plugin to make this skeleton change temporarily.

 

The only reasonable way I see is to change the sit animations for the actor. And include the elevation part into the enter and exit animations. Similar to the ride cart animations.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...