Spawning a custom NPC via the console?

Post » Mon Jun 18, 2012 4:17 pm

Okay, i am having trouble figuring out how i find the code for a custom NPC/Creature that i have created in the CK.

I want to spawn in said NPC/Creature using the player.placeatme command, but i don't know where i find the code for my custom NPC. I tried the base object name and the reference editor ID code.. these do not work however.

Probably missing something very obvious, but then again i've only ever really used the CS/CK for building houses etc.

Can anyone tell me where i find the code or how i assign a code if that is even possible at all?

Cheers.
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Mon Jun 18, 2012 5:32 pm

You need to use a property for placeatme, and assign the npc to that property.

Also: Game.GetPlayer()
User avatar
Laura Richards
 
Posts: 3468
Joined: Mon Aug 28, 2006 4:42 am

Post » Mon Jun 18, 2012 10:22 am

placeatme only works with base IDs (form ID).

it needs to call the base, not the reference, so that it can create a new reference ID once an instance is created.


one way to find the form id in game is type help "name of your NPC" 0 (spelling sensitive)

note, you need to type the physical name of the NPC that you assigned it, not its editor ID name




for example lets say you created a merchant named RiverwoodMerchantApothecary and gave her a name Gertrude Peabody.

in the game, type


help "Gertrude Peabody" 0



the search result will show something like this:

[060009db] NPC_ Gertrude Peabody


that number in brackets is the form ID.



player.placeatme 060009db
User avatar
Nitol Ahmed
 
Posts: 3321
Joined: Thu May 03, 2007 7:35 am

Post » Mon Jun 18, 2012 1:48 pm

That worked perfectly, thank you.

Edit, so if i wanted to delete a certain NPC via console how would i do this? In Oblivion i used to click on the NPC and just press delete. This doesn't seem to work with Skyrim.
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Mon Jun 18, 2012 2:55 pm

highlight them in the console by clicking on them, after their refID appears type markfordelete

make sure you are are actually highlighting the actor and not something else (like floating mist particles)
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Mon Jun 18, 2012 7:08 am

That works fine, not perfect because even though they have been deleted there body remains in place albeit motionless.

Although i can just quick save and quick load to fix that little issue.

Thanks for the help. :)
User avatar
CHANONE
 
Posts: 3377
Joined: Fri Mar 30, 2007 10:04 am


Return to V - Skyrim

cron