fixed npc generator

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

icez
Spike
Spike
Posts: 263
Joined: Fri Dec 20, 2013 7:21 pm

fixed npc generator

Postby icez » Wed Mar 19, 2014 11:41 pm

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

Chad
Chain Chomp
Chain Chomp
Posts: 330
Joined: Sun Mar 02, 2014 3:22 pm

Re: fixed npc generator

Postby Chad » Thu Mar 20, 2014 12:04 am

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.
Last edited by Chad on Thu Mar 20, 2014 12:06 am, edited 1 time in total.

FanofSMBX
Ludwig von Koopa
Ludwig von Koopa
Posts: 3878
Joined: Sun Dec 22, 2013 12:01 pm

Re: fixed npc generator

Postby FanofSMBX » Thu Mar 20, 2014 12:05 am

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!

Julia Pseudo
Luigi
Luigi
Posts: 5609
Joined: Wed Jan 08, 2014 12:04 am
Flair: gay gaymer girl
Pronouns: She/her

Re: fixed npc generator

Postby Julia Pseudo » Thu Mar 20, 2014 3:24 am

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.

icez
Spike
Spike
Posts: 263
Joined: Fri Dec 20, 2013 7:21 pm

Re: fixed npc generator

Postby icez » Thu Mar 20, 2014 10:19 am

Thanks everyone it works fine thanks for the help


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari