lfnetwork.com mark read register faq members calendar

Thread: spawnig through script
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 05-05-2003, 04:33 AM   #1
clu
 
clu's Avatar
 
Join Date: Oct 2002
Posts: 279
spawnig through script

I usually spawn NPCs by using a trigger (targeted at the appropriate NPC entities), but I'm wonering if there is a way to do this through scripting as well.

Basically, I'd like to be able to place NPCs at various points in my map, but not have them "appear" until I say so in a script. Triggers work great, but this other option would solve a lot of problems as well.

Is this possible?

-clu

clu is offline   you may: quote & reply,
Old 05-05-2003, 10:53 AM   #2
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Nothing's easier, my friend. Just do it like you would do it with triggers: give the NPC an ordinary targetname, then use the NPC (the targetname) in a script. That should do the trick. The NPC can have his own spawnscript, and you can continue the scripting in that.

However, you must be extra-careful with the scripting continuum in general. You cannot spawn an NPC in a script and right after that affect him or her in the same script that spawned him/her. That is why I said you can continue for example a running cinematic in the just spawned dude's own spawnscript. That works alright.
lassev is offline   you may: quote & reply,
Old 05-05-2003, 09:28 PM   #3
clu
 
clu's Avatar
 
Join Date: Oct 2002
Posts: 279
Wow I feel stupid. I always assumed "use" wouldn't work because it would not keep the NPC from just spawning when the level loads. Just tried it and it works. Thanks for the tip! (and the one about affect statements in the same script...very helpful)

-clu

clu is offline   you may: quote & reply,
Old 05-08-2003, 10:24 PM   #4
clu
 
clu's Avatar
 
Join Date: Oct 2002
Posts: 279
OK...resurrecting an old thread again.

I'm having trouble using the "remove" command on NPCs I spawn with the "use targetname" method. Is there another way to get rid of these guys?

"remove npc_targetname" works fine on NPCs that load with the level or that are spawned with a trigger, but for some reason it's not working for NPCs spawned with "use".

Any ideas?

-clu

clu is offline   you may: quote & reply,
Old 05-09-2003, 03:59 AM   #5
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Assign the NPCs both an ordinary targetname to use with spawning and an NPC_targetname you can use for removal.

There are some tricks in the remove command - they were discussed in some thread a while ago. There were even some comments that originated to Raven itself. However, I can say that it has worked alright for me, at least when I have used it inside some other NPCs affect than the one to be removed. Yet, you can also use the remove("self") command. However, having no experience about that, I won't say anything more.

How is your colossal campaign coming along? So far you haven't any thread in the showcase. All this little things you keep asking make it seem as if it would soon be finished.
lassev is offline   you may: quote & reply,
Old 05-09-2003, 04:39 AM   #6
clu
 
clu's Avatar
 
Join Date: Oct 2002
Posts: 279
Hey thanks, lassev. I have both targetnames, but I'll keep messing around a bit and try the "self" thing as well. For the time being I'm using an ugly hack to get rid of the offending NPC just so I can get on with my life.

I'll actually be finished with one level of the campaign Monday (hopefully) and I'll post a thread asking for volunteers. Beware!

Thanks again for the info.

-clu

clu 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 > JediKnight Series > Editing Central > JO Mapping > spawnig through script

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:32 AM.

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