Blezmo Posted May 8, 2018 Share Posted May 8, 2018 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 More sharing options...
Evangela Posted May 8, 2018 Share Posted May 8, 2018 (edited) Why SetPosition() is not that useful? It's the only way to manipulate Z positions, apart from calling MoveTo and changing the zOffset. Edited May 8, 2018 by Rasikko Link to comment Share on other sites More sharing options...
Blezmo Posted May 8, 2018 Author Share Posted May 8, 2018 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 More sharing options...
IsharaMeradin Posted May 8, 2018 Share Posted May 8, 2018 Use GetPositionZ() first then use SetPostionZ() Link to comment Share on other sites More sharing options...
Blezmo Posted May 8, 2018 Author Share Posted May 8, 2018 I Use GetPositionZ() first then use SetPostionZ()was hoping SKSE would have something better like, addpositionZUsing 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 More sharing options...
Reneer Posted May 8, 2018 Share Posted May 8, 2018 (edited) 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 May 8, 2018 by Reneer Link to comment Share on other sites More sharing options...
RichWebster Posted May 8, 2018 Share Posted May 8, 2018 Blezmo I think you might be complicating it. Are you basically wanting to add like 10.0 to the actors current z position? Link to comment Share on other sites More sharing options...
Blezmo Posted May 8, 2018 Author Share Posted May 8, 2018 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 More sharing options...
RichWebster Posted May 8, 2018 Share Posted May 8, 2018 Maybe something like this float posX = Actor.GetPositionX() float posY = Actor.GetPositionY() float posZ = Actor.GetPositionZ() + 10.0 Actor.SetPosition(posX, posY, posZ) Link to comment Share on other sites More sharing options...
fore Posted May 8, 2018 Share Posted May 8, 2018 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 More sharing options...
Recommended Posts