Teleport an Actor

Post » Fri May 27, 2011 11:25 am

Hi. I have created an NPC who is locked in a cell. He uses a wander package which keeps him in the cell, which is conditional on a Quest stage.

I get the quest from NPC A, who sends me to find a key.
I use the key to open the door to the Cell where my NPC prisoner is waiting.
Speaking to the NPC prisoner advances the Quest stage and disables the 'In Cell' wander package.
The NPC prisoner has two other packages, a sleep package and another wander package which should place him in the same cell as NPC A.
Once released from the cell (and the 'In Cell' wander package), the NPC prisoner makes his way out of the dungeon and appears to make his way toward the cell where he is now supposed to be.


However, the cell is on the other side of the map from the location in where the NPC prisoner should go once Iv released him, and he never seems to get there. if I approach NPC A, who sent me on the quest, I should be thanked and paid, and the Quest should stop, however, the quest topic item is missing and all I get is small talk.

I know that the NPC prisoner makes his way out of the dungeon, so I figured to use a trigger (?) to teleport him to the correct cell, but I have realized that I have no idea how to do so!

Can anyone offer some advice?

cheers

MVK
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Fri May 27, 2011 5:25 pm

The NPC should appear in the game cell where the AI package requires him to be if its conditions are met, and there is no higher priority package. Most of the problems I've had fall into that latter category where another package is taking precedence. Try moving the player to where he really is (Player.MoveTo formid in the console, you'll need the NPC's ref id, not his base id) and look to see which package he's doing.
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Fri May 27, 2011 3:50 pm

Thanks ghastley, you pointed me in the right direction - the package to keep the prisoner in the cell was at the top of the list. I moved it to the bottom and things now work nicely.

One thing though. You said to use Player.MoveTo formid, and went on to explain that this is the NPC's ref id, not his base id.

What does that mean exactly?

I tried this with the Editor ID in the window where I create and edit the NPC, and also with the reference Editor ID, found by double clicking on the NPC in the render window, and neither of them worked. I did try to make a note of the error returned, but I cant seem to find it now, but both were along the lines of object doesn't exist.

Which ID should I use, and is there any specific reason why the correct ID (if I used it) would not work (it was spelled correctly).

Anyway cheers, I'm back on track again!

MVK
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Fri May 27, 2011 10:19 am

Thanks ghastley, you pointed me in the right direction - the package to keep the prisoner in the cell was at the top of the list. I moved it to the bottom and things now work nicely.

One thing though. You said to use Player.MoveTo formid, and went on to explain that this is the NPC's ref id, not his base id.

What does that mean exactly?

I tried this with the Editor ID in the window where I create and edit the NPC, and also with the reference Editor ID, found by double clicking on the NPC in the render window, and neither of them worked. I did try to make a note of the error returned, but I cant seem to find it now, but both were along the lines of object doesn't exist.

Which ID should I use, and is there any specific reason why the correct ID (if I used it) would not work (it was spelled correctly).

Anyway cheers, I'm back on track again!

MVK


Theres some weird wrinkle to teleporting the player to a character's location.

If i recall correctly, and it's been a while since i had to do this, it works if you go into third person mode. Open the console, click one yourself, then enter the moveto REFID
you shouldn't need the player. part, since that's covered by selecting your avatar.
User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Fri May 27, 2011 12:50 pm

Thanks for that Joben. I knew I was getting things right but I couldn't figure out why it wasn't working properly!
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Fri May 27, 2011 6:59 pm

Right, you should not need the player part, but if you have unintentionally selected something else, it's a safety net to make sure you don't move a house, for example. And come to think of it, it probably should be PlayerRef in that context.

The other thing that may get confusing is the change of the first byte of the formids between the CS and the game, which depend on load order, so they may not stay the same between reloads of the game.
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Fri May 27, 2011 4:34 pm

Right, you should not need the player part, but if you have unintentionally selected something else, it's a safety net to make sure you don't move a house, for example. And come to think of it, it probably should be PlayerRef in that context.

The other thing that may get confusing is the change of the first byte of the formids between the CS and the game, which depend on load order, so they may not stay the same between reloads of the game.


Right, that's confused me again!

FormID's change! So what reference (and where is it found) do I type in, and if its going to change, how can I ever be sure that Ill actually move to that item?

Cheers

MVK
User avatar
Chris Guerin
 
Posts: 3395
Joined: Thu May 10, 2007 2:44 pm


Return to IV - Oblivion