lfnetwork.com mark read register faq members calendar

Thread: Trying to script an NPC into an area...
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-20-2010, 08:27 PM   #1
Kyr'am Galaar
Junior Member
 
Kyr'am Galaar's Avatar
 
Join Date: Jun 2009
Posts: 428
Trying to script an NPC into an area...

I'm trying to script an NPC into an area, but it's not working. Here is my script:

Code:
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?


Does anyone actually read these?
Kyr'am Galaar is offline   you may: quote & reply,
Old 07-20-2010, 09:16 PM   #2
Canaan Sadow
Junior Member
 
Canaan Sadow's Avatar
 
Join Date: Jul 2010
Location: Endor
Posts: 366
Current Game: Pokemon & K2
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:
Code:
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); 
}
}
Canaan Sadow is offline   you may: quote & reply,
Old 07-20-2010, 09:16 PM   #3
DarthStoney
To bed. I'm old and tired
 
DarthStoney's Avatar
 
Join Date: Apr 2006
Posts: 506
Contest winner - Modding Veteran Modder Helpful! 
In this line
Code:
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.
DarthStoney is offline   you may: quote & reply,
Old 07-20-2010, 09:46 PM   #4
Kyr'am Galaar
Junior Member
 
Kyr'am Galaar's Avatar
 
Join Date: Jun 2009
Posts: 428
Thanks guys! It worked!


Does anyone actually read these?
Kyr'am Galaar is offline   you may: quote & reply,
Old 07-20-2010, 10:06 PM   #5
Canaan Sadow
Junior Member
 
Canaan Sadow's Avatar
 
Join Date: Jul 2010
Location: Endor
Posts: 366
Current Game: Pokemon & K2
No problem-o! Got anymore questions about stuff like this and you can message me and I'll help if I can. (:
Canaan Sadow is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Trying to script an NPC into an area...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:57 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.