PDA

View Full Version : An object emitting itself



Henshin1
10-27-2012, 09:58 AM
Hi guys having a bit of trouble with a game im making.
I have a grid where each tile has a tag of a different colour on it. What i want to do is each turn, i want to emit a piece of material to check which tag is on a tile, and then emit a copy of itself behind the next tile. This process will repeat like a while loop until it reaches a specific tag color.
When im trying this however it makes a single copy of itself but just stops there and does not continue to do the checks for the tags and emit again. Can anybody help me out or teach me how to make an object emit itself until a condition is met?
Thanks guys appreciate it :)

comphermc
10-27-2012, 01:10 PM
Yeah, I don't think that will actually work, since the game has to plan out all possible emitted objects, and the above process would lead to infinitely many emitted objects.

If all you're trying to do is check the tiles in sequential order until you find the desired tag, you can try doing this in another way. It's difficult to find an alternative without knowing all your conditions, such as...

Is it guaranteed that at least one tile will have the desired color?
Is the tag color always the same?
How many tiles are we talking about here?

My initial hacky solution is to put the emitter on a piece of material that follows to each tile in turn, checking the tile for the desired tag.

Otherwise, you can set up a sensor at each tile and feed this all into a selector. The bottom-most active port on the selector will light up, thus favoring the lowest input. If you skip the first port of the selector and wire a battery to it, then it will go to the first (empty) port, so long as there is not another active signal going in (implying no tag found).