Player.MoveTo when knocked down

Post » Wed Jul 21, 2010 11:50 am

I've made a script that artificially knocks out the player, then after a few seconds, executes a Player.MoveTo marker line to load a new cell. The effect I'm trying to get is to have the player get knocked out, "black out", and wake up in another place. Everything works perfectly, except that the placement of the player seems very strange when the MoveTo is used on a passed out target. As it is now, the new cell loads, the camera is locked, and the player is not in sight; then the player will appear just as the 'get up' animation plays at a seemingly random point somewhere in the vicinity of the marker and all is well; my guess is that the position the PC gets up at is influenced by the way he was lying on the ground at the time of the MoveTo. There isn't too much of a problem really, except occasionally the player will end up outside of the target room's boundaries and end up in purgatory.

Anyone have any knowledge about how to fix this so that the player's limp body will be in an exact location upon loading the new cell? For now, the sequence goes like this: Script 1 knocks player out, waits, then activates Script 2 and does Player.MoveTo marker. The new cell loads, Script 2 has a timer to wait a few seconds before 'reviving' the player. Ideally, I'd like to have the new cell load with the player lying limp on the floor already.
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Wed Jul 21, 2010 4:28 pm

Just after the MoveTo function, use SetPos to position the PC on the X, Y and Z coordinates of the marker

Something like:

player.moveto  mymarkerset posX to mymarker.getpos xset posY to mymarker.getpos yset posZ to mymarker.getpos zplayer.setpos x posXplayer.setpos y posYplayer.setpos z posZ

User avatar
Danger Mouse
 
Posts: 3393
Joined: Sat Oct 07, 2006 9:55 am

Post » Wed Jul 21, 2010 7:47 pm

Thanks for the reply. I tried your suggestion but to no effect. I still get the "disappeared" upon load then "reappear in random spot" when the player gets up. I'm brainstorming a bit for now...
User avatar
Niisha
 
Posts: 3393
Joined: Fri Sep 15, 2006 2:54 am


Return to IV - Oblivion

cron