PDA

View Full Version : Syntax Problem


TomsRocc
05-23-2010, 08:48 AM
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, 12:19 PM
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, 12:54 PM
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.