Page 1 of 1

fixed npc generator

Posted: Wed Mar 19, 2014 11:41 pm
by icez
Like the title says I wondering how to do this I remember seeing this at know forum but forgot to type it down some where's.
Anyways if some knows how make a generator to produce fixed number of npcs that would be great thanks

Re: fixed npc generator

Posted: Thu Mar 20, 2014 12:04 am
by Chad
Create two events, I'll call them "Delay" and "Hide". "Delay" should trigger "Hide" in a certain number of seconds, while "Hide" should just hide the generator layer. Link the generated NPC's "Activate" trigger to the "Delay" event. That way, the generator is set to stop a certain amount of time after the first one comes out.

The amount of seconds you apply to "Delay" depends on how frequent the generator is and how many instances you want spawned. So for example, if you have a generator that spawns every 2 seconds and you only want it to create 3 NPCs, set the number of seconds on the "Delay" event to something like 5 or 6 seconds. Experiment with the time a little to get the results you want, because you have to factor in that most NPCs take about half a second to come out, and you don't want the last one disappearing while it's halfway out or anything like that.

I hope this explanation wasn't too confusing, but that's the basic idea.

Re: fixed npc generator

Posted: Thu Mar 20, 2014 12:05 am
by FanofSMBX
Let's see if this works.
Step 1: set an npc to generator (either one is fine), put it on a layer and set it to trigger event "Delay" on Activate. Be sure to remember how often they generate.
Step 2: make event "Delay" trigger event "Hide" after the amount of enemies you want, times how often they generate.
Ex: 3 enemies generated, generate every 2 seconds: set event "Delay" to trigger event "Hide" after 6 seconds
Step 3: make event "Hide" hide the generator layer.

EDIT: ROFL! Chad used the exact same example names and times as me!

Re: fixed npc generator

Posted: Thu Mar 20, 2014 3:24 am
by Julia Pseudo
Thanks so much for that explanation, Chad. I was always confused on how to do this too. That's really simple, and makes a lot of sense. You're the best.

Re: fixed npc generator

Posted: Thu Mar 20, 2014 10:19 am
by icez
Thanks everyone it works fine thanks for the help