Page 1 of 1

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 4:17 pm
by scorpion972
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.

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 5:32 pm
by Laura Richards
You need to use a property for placeatme, and assign the npc to that property.

Also: Game.GetPlayer()

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 10:22 am
by Nitol Ahmed
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

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 1:48 pm
by Hannah Whitlock
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.

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 2:55 pm
by Laura Shipley
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)

Spawning a custom NPC via the console?

PostPosted: Mon Jun 18, 2012 7:08 am
by CHANONE
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. :)