Spawning a npc with a ref ID

Post » Fri Feb 18, 2011 8:22 pm

Hey,

Just wondering if it is possible to spawn a npc with a reference id already on it? And if so can it be the same as other npc's? Just wondering as trying to get a group of the same npc that can be spawned in game to use the evaluatepackage command. Help is helpful!

Sil
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Sat Feb 19, 2011 8:20 am

The reference ID always has to be unique. When anything - actors or items - is spawned, the reference id starts with x'FF' in the first byte, and the rest is just the next appropriate number. It's possible to capture that value in a reference variable in a script if you need to use it in functions, so you don't need to know it in advance. Usually the function that creates the new actor returns the reference id as a result and you just assign it to the variable in the same statement.
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm


Return to IV - Oblivion