Jump to content

Home

Syntax Problem


TomsRocc

Recommended Posts

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);
}

Link to comment
Share on other sites

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, "[color="Red"]Template resref of npc[/color]", lDeader, 1);
     SetGlobalBoolean("ac_tar_spawned",TRUE);
     ExecuteScript("k_ptar_a02ac_en", oPC, 0xFFFFFFFF);
    }
 }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...