Knuckle Cracker

Knuckle Cracker => Support => Topic started by: Tero on January 07, 2010, 02:46:03 AM

Title: Trouble with Emitters
Post by: Tero on January 07, 2010, 02:46:03 AM
I am having trouble with emitters in the map editor.  I want four emitters to fire in sequence.  I am going for an effect.  The first needs to start at 15 seconds, the second at 30 seconds, the third at 45 seconds the fourth at 60.  So naturally, I set the first emitter's "Start" for 15, and its Interval" at 60.  The second emitter for 30 & 60, 3rd 45 & 60 the last emitter Start:60 & Interval:60.  Here's what happens in the game.  At one minute all the emitters fire at the same time for the first time.  And all of them repeat once per minute.  Not in progression.   Which is what I am striving for.  Next, I tried keeping the "Start" the same, 60.  And making the "Interval" different by 15 seconds per emitter.  While the four emitters fired at one minute and then some or all every 15 seconds.  It's not exactly what I am looking for.
Any ideas?
Title: Re: Trouble with Emitters
Post by: Aurzel on January 07, 2010, 10:29:31 AM
start 15 ineterval 60 means the emitter will fire at 15 seconds, 75 seconds, etc every 60 seconds
Title: Re: Trouble with Emitters
Post by: Tero on January 07, 2010, 12:35:26 PM
Quotestart 15 ineterval 60 means the emitter will fire at 15 seconds, 75 seconds, etc every 60 seconds

That's the basic idea of what I am striving for.  But what happens, like I wrote earlier, is at one minute(and not before) they all fire.  And they all fire at one minute intervals.  Instead of first emitter 1, then emitter 2 etc.  I have the emitters spaced apart.  And they are on an open elevation.  So there is nothing to hinder their flow.  And nothing on top of any of the emitters.
Today, I deleted three of the four emitters.   So there is just one with it's "Start" = 15 and "Interval" = 60.  The same thing happens.  At one minute (and not before) the emitter fires.  It fires again at 2 minutes, not 75 seconds.
Title: Re: Trouble with Emitters
Post by: Aurzel on January 07, 2010, 12:43:13 PM
have you taken the . out so that it's not reading 1.5 or something? that's al i can think of
Title: Re: Trouble with Emitters
Post by: djcian on January 07, 2010, 07:55:09 PM
ok so i see what is happening i tried it and my guess is that the emitters rate starts counting at the beginning and is always telling it to fire creeper at the right time but the emitter delay you set keeps the creeper from actually coming out until a certain amount of time.  there is no way to get the effect you are talking about that i can think of but there is a way you could compromise and have one fire on the 30 sec mark (30, 90, 150)and one fire on the one minute mark(60, 120, 180)
Title: Re: Trouble with Emitters
Post by: knucracker on January 07, 2010, 08:17:13 PM
Good grief.... this just has not been my week :)

Here is the code for when an emitter fires.... see the problem?

if (!off && updateCount >= startTime && updateCount <= finishTime && updateCount % productionInterval == 0) {
//Emit creeper
}

If you set the interval to 1 second, the emitters will all start at the "Start" time you specify.  If you specify something large for the interval, then then emitters won't fire until that time (updateCount % 60 == 0).

I probably never tested with large interval values, so I never caught this.  Now the challenge is how to correct this without disturbing any existing custom maps.  I suppose I could change the logic only for maps made with the newer map editor (the one I'll release along with the new game update).

Dang, I just can't catch a break this week!  :)


Title: Re: Trouble with Emitters
Post by: betadata on January 07, 2010, 08:22:34 PM
see what happens when you let others play with your toys.  They break them.  ;)
Title: Re: Trouble with Emitters
Post by: Tero on January 08, 2010, 01:19:33 AM
The only computer language I know is G&M.  So I can't appreciate what you posted above.  My first goal was to test the survivability of the various items when built on top of a slow & weak emitter.  Then the idea of having the emitters fire in sequence, so I could count the number of cycles before the items failed.  But if you could get the "Start" variable to work then,  the possibilities of obstacles in maps really takes off.
Title: Re: Trouble with Emitters
Post by: Aurzel on January 08, 2010, 06:04:00 AM
yeah i didnt catch what the problem was, i think he's saying the programming wont accept long intervals?