Jump to content

Elevator/Lift mesh collision


andersonsmith969

Recommended Posts

When trying to move a mesh, like with an elevator using a script, vanilla mesh collisions don't move with the mesh as they are moving (like using the setpos command).

 

Does anybody know how to make/use/reconfigure a nif's settings so that collision moves with it?

 

I know that certain meshes in mods like Nehrim are able to do this, but I'm not sure what the settings are to make this happen.

 

Thanks!

Link to comment
Share on other sites

sscn myLiftScript
float curpos
float endpos
short vatorStatus

begin onactivate player
       if vatorStatus == 0
               set endpos to getpos z - 634
               set vatorStatus to 3
               message "Going Down!"
       elseif vatorStatus == 1 || vatorStatus == 3
               message "The Lift is in motion!"
       elseif vatorStatus == 2
               set endpos to getpos z + 634
               set vatorStatus to 1
               message "Going Up!"
       endif
end

begin gamemode
       if vatorStatus == 1
               set curpos to getpos z
               if (curpos < endpos)
                       ;MOVING LIFT UP
                       set curpos to curpos + (GetSecondsPassed * 0.75)
                       setpos z curpos
               else
                       ;FINAL UP POSITION - SET EXACT Z
                       set vatorStatus to 2
                       setpos z 2543
               endif
       elseif vatorStatus == 3
               set curpos to getpos z
               if (curpos > endpos)
                       ;MOVING LIFT DOWN
                       set curpos to curpos - (GetSecondsPassed * 0.75)
                       setpos z curpos
                       player.resetfalldamagetimer
               else
                       ;FINAL DOWN POSITION - SET EXACT Z
                       set vatorStatus to 0
                       setpos z 1909
               endif
       endif
end

Edited by Sazerra05
Link to comment
Share on other sites

ARGate01: The collision part moves with the visual part. I was told that it is because it is an animated mesh.

 

This mesh will work as an elevator but only up to a speed limit (not very high)

Up to that limit, you setpos the mesh in the script phase of the frame and the engine lifts the player/NPCs , keeping then on the platform. Over that limit, the platform will go up faster than the engine adjusts the characters and they will fall thru.

Same thing going down: up to a certain speed it will look fine, too fast and the characters will be in free fall.

 

One alternative, if you know how (I don't), is to do it with mesh animation instead of setpos. The game has elevators built this way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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