PDA

View Full Version : Infinite Loop



Voltiare
10-30-2008, 08:28 PM
Here is what I am trying to do. I am trying to build a way for a Statue to reappear if it gets destroyed. I want this to happen an infinite number of times. You would think that an emitter could do this, but it can't.

If you have the max out option on 1, lifetime on infinite, max emitted at infinite, and timing at .5 sec, you would think it would spit out one in .5 sec and stay until it was destroyed, but no. What happens is that it spits out one every .5 sec, the old one vanishing every time.

So here's what I did: I have an OR switch device. When either part of the statue is destroyed, it pushes a piston towards a switch. The switch turns on an emitter and then destroys the rest of the statue, the emitter, and the OR switch device. This whole contraption (the statue, the OR switch, and the emitter) is an object that is emitted by the emitter. This basically resets the whole thing. Unfortunately, this is only happens a finite number of times because at one point, the emitter emits an object whose emitter setting doesn't have an object to emit.

It's very complicated and makes my brain hurt. So does anyone have any idea of how to create an infinite loop so that I can destroy the statue an infinite number of times and I will always get another one.

BassDeluxe
10-30-2008, 09:11 PM
Try setting a magnetic key on the statue being emitted, and the key switch right beneath it when it's emitted. Set it so that the key switch activates the emitter whenever the key is not in range. That way, whenever the statue is destroyed the key will get out of range and another one will replace it.

Voltiare
10-30-2008, 09:34 PM
Try setting a magnetic key on the statue being emitted, and the key switch right beneath it when it's emitted. Set it so that the key switch activates the emitter whenever the key is not in range. That way, whenever the statue is destroyed the key will get out of range and another one will replace it.The switch on the new statue will not be connected to the emitter. So instead of creating one statue, it will create one every .5 sec nonstop since nothing is telling it not to.

In order for the new statue to be connected to the emitter, the emitter has to emit another emitter and then destroy itself (by dissolving the material underneath it). The problem is that the object that you save to be emitted will have an emitter on it that doesn't have any object to be emitted. The reason is because you HAVE to create the object without the right settings because you can't have the emitter emit an object you don't have yet. TIME PARADOX.

So you can keep creating the object, and having the emitter emit the new object any number of times. Then the player can destroy the statue that number of times, but not an infinite number of times.

Stuff
10-30-2008, 09:35 PM
I totally thought of a time limit system where you had to get the object to the spot in a certain time before it disapears.. I think what i did is set up a grab switch that when you grab it, piston with a key at the end begins to move very slowely to the key switch, when it hits, the emitter turns off, and your object dissapears.

DrunkMiffy
10-30-2008, 09:38 PM
Erm, connect it to a switch :S LOL. I'm almost certain that works. Jump on the button a new one appears, don't jump on it, it stays there forever.

Voltiare
10-30-2008, 09:43 PM
I totally thought of a time limit system where you had to get the object to the spot in a certain time before it disapears.. I think what i did is set up a grab switch that when you grab it, piston with a key at the end begins to move very slowely to the key switch, when it hits, the emitter turns off, and your object dissapears.Nice. Does the piston go back when you are not grabbing it?


Erm, connect it to a switch :S LOL. I'm almost certain that works. Jump on the button a new one appears, don't jump on it, it stays there forever.I'll try it, but I don't like those ugly red buttons ruining the look of my level and I like the automatic approach. Unfortunately, you might be right in that it could be impossible to do it that way and player input might be needed.

12454522412412
10-30-2008, 09:47 PM
does the statue drop down or what? i made a cake machine and it would place a cake down every 5 secs... the one that was in there would stay there until the button was pressed... if the item is in the way of the emmiter the emmiter does nto do anything

cjarnol1
10-30-2008, 09:57 PM
The switch on the new statue will not be connected to the emitter. So instead of creating one statue, it will create one every .5 sec nonstop since nothing is telling it not to.


I think BassDeluxe had the right solution. The statue does not have a switch attached to it but rather the magnetic key is attached. The actual switch can be glued onto the ground.

BassDeluxe
10-30-2008, 10:13 PM
Actually, my method does work. I know as a fact because I just tried it. The only thing that matters with keys and key switches is that they are the same color. Nothing else matters. So the key on the statue being spawned will always stop the emitter from spawning more until it is destroyed, if you invert the key switch. And keep in mind, the key switch goes on the ground, not on the statue.

docpac
10-30-2008, 10:17 PM
Here is what I am trying to do. I am trying to build a way for a Statue to reappear if it gets destroyed. I want this to happen an infinite number of times. You would think that an emitter could do this, but it can't.

If you have the max out option on 1, lifetime on infinite, max emitted at infinite, and timing at .5 sec, you would think it would spit out one in .5 sec and stay until it was destroyed, but no. What happens is that it spits out one every .5 sec, the old one vanishing every time.

So here's what I did: I have an OR switch device. When either part of the statue is destroyed, it pushes a piston towards a switch. The switch turns on an emitter and then destroys the rest of the statue, the emitter, and the OR switch device. This whole contraption (the statue, the OR switch, and the emitter) is an object that is emitted by the emitter. This basically resets the whole thing. Unfortunately, this is only happens a finite number of times because at one point, the emitter emits an object whose emitter setting doesn't have an object to emit.

It's very complicated and makes my brain hurt. So does anyone have any idea of how to create an infinite loop so that I can destroy the statue an infinite number of times and I will always get another one.

Emitters work.

I just tried this with the exact same emitter setup and it works. The object I'm emitting is not vanishing at all until it moves from the area it was emitted to. Adjust where you emit the object and this problem should go away. This will be way easier than creating an elaborate switch setup.

Voltiare
10-31-2008, 07:20 AM
Actually, my method does work. I know as a fact because I just tried it. The only thing that matters with keys and key switches is that they are the same color. Nothing else matters. So the key on the statue being spawned will always stop the emitter from spawning more until it is destroyed, if you invert the key switch. And keep in mind, the key switch goes on the ground, not on the statue.Ah, on the ground. So you would just set the range at some wide setting. I don't know why I didn't think of that since it is MUCH simpler. Oh well, you live and learn.