TomsRocc Posted May 23, 2010 Share Posted May 23, 2010 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 More sharing options...
DarthStoney Posted May 23, 2010 Share Posted May 23, 2010 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 More sharing options...
TomsRocc Posted May 23, 2010 Author Share Posted May 23, 2010 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.