Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Spawning NPCs

Page: 1 of 1
 Ravager
02-05-2009, 10:01 AM
#1
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
#2
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
#3
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
#4
As Stream said ^, you have to fire the script. What exactly do you want to happen?
 Ravager
02-05-2009, 11:06 AM
#5
Just basic spawn. I want to spawn npc on Dantooine, talk to him etc.
 glovemaster
02-05-2009, 11:29 AM
#6
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
#7
Where can i find this OnEnter script?
 glovemaster
02-05-2009, 12:22 PM
#8
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
#9
Ok i found it and... it works ; D Thank you for help, im in seventh heaven man ;D
Page: 1 of 1