Jump to content

Home

Script to Spawn NPC...


Jacob Dakari

Recommended Posts

Ok, so I've gone through the tutorials, and everything has been working out beautifully, except that I can't get the NPC to spawn in the place that I want her to spawn before I recruit her. I tried using several different scripts, but when I did, it said error on whatever part of the script. :lol: That's just my luck too, I'm near completion of the mod, and I fail because I'm too ADD to actually type the script in correctly (no doubt that's what I did, I probably added stuff from the tut that wasn't supposed to be there :D) but I just wanted to see if there was an easier script that I could use to spawn her...

Link to comment
Share on other sites

This script should do the trick for you.

void main()
{
vector vPosition=Vector(0.0, 0.0, 0.0); //X, Y, Z coordinates

location lWhereToSpawn=Location(vPosition,0.0); //Orientation, I believe

CreateObject( OBJECT_TYPE_CREATURE,
"my_character",lWhereToSpawn);}

 

You can find the X, Y, Z coordinates through the whereami cheat code in K1 or Glovemaster's FindMe power from his Handy Force Powers (2.0) mod for TSL.

Link to comment
Share on other sites

Try this:

 

void main()
{
CreateObject(OBJECT_TYPE_CREATURE, "resref", Location(Vector(X.XX,4Y.YY,Z.ZZ), R.RR)); 
}

 

Replace X.XX, Y.YY and Z.ZZ with the X,Y,Z co-ordinates respectively, the R.RR with the orientation and the resref with your NPC's resref.

Link to comment
Share on other sites

Orientation is the direction which the NPC, Placeable or whatever the object/creature you're spawning faces.

 

Here are the basic directions and their corresponding numbers, though you can experiment and use numbers in between to be more precise:

 

North: 0.00

East: 90.00

South: 180.00

West: 270.00

 

-DDD

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...