IrocJeff Posted January 4, 2015 Posted January 4, 2015 I have all my NPC's set to triggers throughout my maps but some of these are in the background. You may pass them off on a tram ride or see them behind glass windows. Is it worth it to kill them off if the player can't get back to that area again or not ?
therfiles Posted January 4, 2015 Posted January 4, 2015 Yeah. I had a similar project where the map was a HUGE city, and we wanted tons of NPCs to populate the area. However, 16+ NPCs per city area did not bode well for performance. So I had triggers to remove NPCs as you left an area, and spawned the NPCs for the next area. I'd also put another trigger that respawned the old ones, just in case the player wanted to go back.
IrocJeff Posted January 4, 2015 Author Posted January 4, 2015 Thanks. I figured that'd be the best thing I just wanted to make sure.
IrocJeff Posted January 5, 2015 Author Posted January 5, 2015 The only thing is I can't seem to figure out how to kill them.. Please help...
therfiles Posted January 5, 2015 Posted January 5, 2015 I'd set their behavior state to "remove" (I think this is a thing) and it will remove the NPC when it is not in the Player's view. Also, you could use the "remove" command with each NPC's script targetname.
IrocJeff Posted January 5, 2015 Author Posted January 5, 2015 I'd set their behavior state to "remove" (I think this is a thing) and it will remove the NPC when it is not in the Player's view. Also, you could use the "remove" command with each NPC's script targetname. affect ( "type1", 56 ) { task ( "type" ) { set ( "SET_ANIM_BOTH", "BOTH_CONSOLE1" ); set ( "SET_ANIM_HOLDTIME_BOTH", -1.000 ); set ( "SET_NOTARGET", "true" ); set ( "SET_IGNOREENEMIES", "true" ); set ( "SET_HEALTH", 2.000 ); } do ( "type" ); wait ( "type" ); } Above is one of my character animation scripts for typing. Would I put the behavior state "remove" in the colored section of my script?
therfiles Posted January 5, 2015 Posted January 5, 2015 I'd include the command within the "type" task...see if that works!
IrocJeff Posted January 5, 2015 Author Posted January 5, 2015 Yeah, type task. I actually colored the commands red in there but it didn't show up in the post... which is why I mentioned colored section. So, how will I know they remove if I cannot see them? I'm just curious. therfiles likes this
therfiles Posted January 5, 2015 Posted January 5, 2015 I think that is behavior is set to remove the the NPC when they leave player view. In my scenario, I'd trigger the removal trigger. I could turn around and still see them, but as soon as they leave view completely they should be removed. In your instance, I'd just confirm that they disappeared using "use list" in the console and see if the NPCs show up.
IrocJeff Posted January 5, 2015 Author Posted January 5, 2015 That worked out pretty well. my framerates on the brewery production floor also increased quite a bit which is great. Thanks for the help with this! therfiles likes this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now