clu Posted May 5, 2003 Share Posted May 5, 2003 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 Link to comment Share on other sites More sharing options...
lassev Posted May 5, 2003 Share Posted May 5, 2003 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. Link to comment Share on other sites More sharing options...
clu Posted May 6, 2003 Author Share Posted May 6, 2003 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 Link to comment Share on other sites More sharing options...
clu Posted May 9, 2003 Author Share Posted May 9, 2003 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 Link to comment Share on other sites More sharing options...
lassev Posted May 9, 2003 Share Posted May 9, 2003 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. Link to comment Share on other sites More sharing options...
clu Posted May 9, 2003 Author Share Posted May 9, 2003 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.