Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Trying to script an NPC into an area...

Page: 1 of 1
 Kyr'am Galaar
07-20-2010, 8:27 PM
#1
I'm trying to script an NPC into an area, but it's not working. Here is my script:

void main() {
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering))
{
CreateObject(OBJECT_TYPE_CREATURE, "IG76", Location(Vector(329.98,167.30,26.42), 0.0));
ExecuteScript("old_k_ptat18aa_enter", OBJECT_SELF);
}
}

What am I doing wrong?
 Canaan Sadow
07-20-2010, 9:16 PM
#2
Did it compile for you? 'Cause if that's all that's wrong then I know your problem... I got it to compile for me... chances are you probably won't notice the difference, cause it was just a minor change, but your "{" symbol doesn't need to be on the same line as "void main()"...

So try this instead:
void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering))
{
CreateObject(OBJECT_TYPE_CREATURE, "IG76", Location(Vector(329.98,167.30,26.42), 0.0));
ExecuteScript("old_k_ptat18aa_enter", OBJECT_SELF);
}
}
 DarthStoney
07-20-2010, 9:16 PM
#3
In this line
CreateObject(OBJECT_TYPE_CREATURE, "IG76", Location(Vector(329.98,167.30,26.42),
Is IG76 the creatures tag? if it is than that's the problem it needs to be what you used for the creatures "Template resref " name.
 Kyr'am Galaar
07-20-2010, 9:46 PM
#4
Thanks guys! It worked!
 Canaan Sadow
07-20-2010, 10:06 PM
#5
No problem-o! Got anymore questions about stuff like this and you can message me and I'll help if I can. (:
Page: 1 of 1