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.

Syntax Problem

Page: 1 of 1
 TomsRocc
05-23-2010, 7:48 AM
#1
I've got a syntax problem at line 11, something similiar to:
ERROR: Syntax problem at line 11 (CreateObject).
I tried it with code from the tutorials, the nwn script generator and still the same.
The code is supposed to spawn a creature called "ac_tar_deader".
I'm unsure how to fix it.

void main()
{
object oPrey=GetObjectByTag("ac_tar_deader");
vector vDeader=Vector (86.502, 101.416, 0.0);
location lDeader=Location(vDeader, 0.0);
string sScript=("k_ptar_a02ac_en");
object oPC = GetEnteringObject();

if (!GetIsPC(oPC))
if (GetGlobalBoolean(ac_tar_spawned(TRUE))
CreateObject(OBJECT_TYPE_CREATURE, oPrey, lDeader);
SetGlobalBoolean("ac_tar_spawned",TRUE);
executescript("sScript", OBJECT_SELF);
}
 DarthStoney
05-23-2010, 11:19 AM
#2
Try this and see if you get the results your looking for.
void main()
{
vector vDeader = Vector (86.502, 101.416, 0.0);
location lDeader = Location(vDeader, 0.0);
object oPC = GetEnteringObject();

if ((GetFirstPC() == oPC)) {
if ((!GetGlobalBoolean("ac_tar_spawned"))) {
object oPrey = CreateObject(1, "Template resref of npc", lDeader, 1);
SetGlobalBoolean("ac_tar_spawned",TRUE);
ExecuteScript("k_ptar_a02ac_en", oPC, 0xFFFFFFFF);
}
}
}
 TomsRocc
05-23-2010, 11:54 AM
#3
Thanks. It all compiled well. It was supposed to execute the script at the end regardless is the boolean true or false, but i fixed it myself.
Page: 1 of 1