View Full Version : Spawning NPCs
Ravager
02-05-2009, 10:01 AM
Hi!
I want to spawn npc so i made appropriate script, but i dont know where put it. In .utc file or somewhere?
Stream
02-05-2009, 10:20 AM
The script goes into the override folder and you'd usually run it from a conversation. Here's a link that explains it all, http://www.lucasforums.com/showthread.php?t=143536.
--Stream
Ravager
02-05-2009, 10:50 AM
void main() { CreateObject(OBJECT_TYPE_CREATURE, "dan13_deesra", Location(Vector(60.82,46.78,4.92), 0.0)); }
This is my script. I compiled it and putted in override but this npc still doesn't appear ; (
glovemaster
02-05-2009, 11:01 AM
As Stream said ^, you have to fire the script. What exactly do you want to happen?
Ravager
02-05-2009, 11:06 AM
Just basic spawn. I want to spawn npc on Dantooine, talk to him etc.
glovemaster
02-05-2009, 11:29 AM
Then you can name this script, after changing "tag_of_utc" and "onenter_old", to the onEnter script for your module and then create a copy of the old onEnter script and rename it.
void main() {
// Check to see if it has already been spawned
if(!GetIsObjectValid(GetObjectByTag("tag_of_utc")))
CreateObject(OBJECT_TYPE_CREATURE, "dan13_deesra", Location(Vector(60.82,46.78,4.92), 0.0));
// Fire old script
ExecuteScript("onenter_old", OBJECT_SELF);
}
Hope that helps, and it is worth reading through the thread Stream suggested. ;)
http://www.lucasforums.com/showthread.php?t=143536
Ravager
02-05-2009, 12:14 PM
Where can i find this OnEnter script?
glovemaster
02-05-2009, 12:22 PM
The file name can be found in the modules ARE file, and the file its self, will more than likely be in the modules "_s.rim" file. ;)
Ravager
02-05-2009, 12:27 PM
Ok i found it and... it works ; D Thank you for help, im in seventh heaven man ;D
vBulletin®, Copyright ©2000-2013, Jelsoft Enterprises Ltd.