lfnetwork.com mark read register faq members calendar

Thread: Spawning NPCs in scripts?
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 08-09-2005, 11:30 PM   #1
riceplant
Junior Member
 
riceplant's Avatar
 
Join Date: Jul 2005
Posts: 348
Spawning NPCs in scripts?

I'm having a problem spawning NPCs in scripts. They spawn in fine, but any 'affect's in the script don't work, and I have to restart the script to affect them, it working fine the second time. Will it work properly if I, after spawning my NPC, run a seperate script to affect them, and if so, do signals cross between different scripts? Also, how do I run another script from a script? It doesn't seem to work for me using 'run'.
riceplant is offline   you may: quote & reply,
Old 08-19-2005, 08:28 PM   #2
riceplant
Junior Member
 
riceplant's Avatar
 
Join Date: Jul 2005
Posts: 348
Could someone just give me a clarification? Is the only way to spawn the NPCs and then execute a new script?
riceplant is offline   you may: quote & reply,
Old 08-20-2005, 03:29 AM   #3
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Yes, your analysis is quite right. There seems to be a period of time, a lag, between the moment of spawning and the moment you can affect an NPC. Possibly you could just wait a while in a script before trying to affect, although I can't verify that, since it wouldn't really have suited my purposes. I have solved the issue by prespawning NPCs shortly before the cinematic, not in the cinematic script itself.

Also you should notice that spawnscripts do get executed always, but that of course disperses the cinematic script, and with the signalling approach, that's not something to be desired.

So, my advice is to spawn pretty much all the npcs you need in a cinematic just before you launch the actual cinematic script, not in the cinematic script itself. Well, there might be other ways, but this is the one I chose.

Run command does work, but it's sometimes a bit tricky, and may seem a bit less reliable than a script_runner. Make sure you have the path right and everything. But this won't necessarily solve the problem of affecting newborn npcs, mind you.


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 08-20-2005, 10:05 AM   #4
shukrallah
White Dragon
 
shukrallah's Avatar
 
Join Date: Nov 2002
Posts: 3,250
What I do is, I have ALL the NPCs spawn before the level loads, give them all NPC_targetnames and make them invisible, then I make them "unvisible" and solid when I need them (at least for cutscenes.) On a normal playable level, just have 2 trigger_once's. The first spawns the NPCs, then right after that have a 2nd trigger_once that connects to a script_runner. Scripts that spawn NPCs don't affect them.

Its better to just simply have a trigger_once connected to the NPC, so when you walk into it they spawn.
shukrallah 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 > JA Mapping > Spawning NPCs in scripts?

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 05:32 AM.

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