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.

OnSpawn scripting problem - TSL

Page: 1 of 1
 newbiemodder
05-23-2011, 10:34 PM
#1
First, let me say my intentions were to save time and make things easier. Not happening....To fill a module with npc's, I made a 'mother' npc. On her OnSpawn script parameter, I put the following script

void main() {

location lDestination = GetLocation(GetObjectByTag("522_mom"));



object oNew1 = CreateObject(OBJECT_TYPE_CREATURE, "522_fem2", lDestination);
object oNew2 = CreateObject(OBJECT_TYPE_CREATURE, "522_fem3", lDestination);
object oNew3 = CreateObject(OBJECT_TYPE_CREATURE, "522_man1", lDestination);
object oNew4 = CreateObject(OBJECT_TYPE_CREATURE, "522_man2", lDestination);
object oNew5 = CreateObject(OBJECT_TYPE_CREATURE, "522_man3", lDestination);
object oNew6 = CreateObject(OBJECT_TYPE_CREATURE, "522_fem1", lDestination);



}


Hoping this would create additional npcs in the area without me finding the coords and entering them in the rim. I've equipped the new spawned npcs with random walk feature so they 'take-off running" when spawned. The problem is, NONE of the npc's are spawning. Any help?
 TimBob12
05-24-2011, 2:20 AM
#2
Sorry I didn't reply to your PM, I don't see how this doesn't work. ANyone who could enlighten me ?
 Fastmaniac
05-24-2011, 9:03 AM
#3
I can't see anything either, but I've got an idea how to check... Besides that characters are spawned inside of other characters. I'd use a wait command between the lines to be sure... And if that doesn't work either, try to toggle it right in front of the spawn point just to see if something happens. If not, then go through every single line to see, if that line is working properly... for example you just take the first line, remove the other lines and put the function SendMessageToPC after it. so you know which line is making trouble...

Fastmaniac
 newbiemodder
05-24-2011, 11:06 AM
#4
UUGH...:headbump....I did what you said, I debugged each line with the sendmessagetopc command and the script checked out. Nothing. I simplified it to one creature to spawn at a nearby waypoint, Nothing. Also tried using the ActionWait command. Nothing.

Could there be anything in the .git or .ifo file that would keep something from spawning? They look ok when compared to others..I don't know.
 Fastmaniac
05-24-2011, 11:20 AM
#5
Did you check, if the 'mother' npc spawned correctly?
 newbiemodder
05-24-2011, 11:27 AM
#6
yes, she is there...checked her with whereami armband...tag is showing correctly.
 Fastmaniac
05-24-2011, 11:44 AM
#7
hmm... that's a tough one... Did you try spawning with coordinates instead of the npc?
 newbiemodder
05-24-2011, 11:52 AM
#8
I tried spawing at a nearby waypoint
 Fastmaniac
05-24-2011, 12:00 PM
#9
Oh, Sorry, didn't get that part... Hmm, then I don't know... Sorry :giveup:
 Ferc Kast
05-24-2011, 12:10 PM
#10
Do the utc's have the same tags as the script? That always makes a difference.
 newbiemodder
05-24-2011, 2:07 PM
#11
Hold on a second.....I think I just realized what I did.....

I want to thank Fastmaniac, Ferc Kast, and TimBob for their help. I am an idiot. In the createobject command i was using the .utc tag instead of its template resref.

I nominate myself for the dumbest modding mistake. Someone start a thread for this.
 Fastmaniac
05-24-2011, 3:36 PM
#12
No Problem, I feel so dumb for not catching that, since I made that mistake at least a hundred times :D But I'm glad it works...
 TimBob12
05-24-2011, 4:10 PM
#13
No Probs, can't count the number of times Ive done this. Am also looking into this radius thing as well. D
Page: 1 of 1