Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Logic Help - Related to Selectors, Destroyers and Pulses

Archive: 9 posts


Sorry for the vague title, I didn't really know what to call this thread.

In my level, I have objects emitted, that are destroyed after a certain number of pulses. This isn't a problem - on the emitted object I just put a selector, attach the "pulse giver" to the positve node of a direction combiner, and attach that to the bottom of the sequencer.

The problem comes when I want the emitted object to be delete at a different point, depending on what level you are. eg say you're at Lvl. 20, the object may be deleted after 25 pulses, Lvl. 30 - 25 pulses.
The way I have it at the moment is to have a sequencer on my cotrolinator. Each node of the circuit is attached to a tag, with names like "1", "2", "3"......... so on an so forth. On each emitted object, each output of the selector is attached to an AND gate. Also attached to that AND gate is a tag sensor related to what level you are. The AND gate is then attached to the destroyer. This works, however, there is a lot of logic involved and the circuit board becomes very laggy - to ubearable levels.

Is there a more effiecient way to do this that involves less logic?

Thanks.
2011-08-20 12:06:00

Author:
Ali_Star
Posts: 4085


I'm assuming you meant selectors and not sequencers...

Anyhoo, if the number of pulses required goes up linearly with what level you are, you could do it this way:

Use a counter on your controlinator, representing your current level, which outputs to a tag.

Then on your emitted object, have a tag sensor with its output value set to signal strength. Then its output will be the same analogue value as the value of your counter.

Then you need a counter on your emitted object counting the number of pulses, with its max count set to some multiple of the level counter's max (say, 10x the value for 10 pulses at level 1). Then you can compare if the pulse counter is greater than the tag sensor by using, say, a direction combiner, splitter and positional sequencer.
2011-08-20 12:56:00

Author:
Dr C
Posts: 122


I'm assuming you meant selectors and not sequencers...

Anyhoo, if the number of pulses required goes up linearly with what level you are, you could do it this way:

Use a counter on your controlinator, representing your current level, which outputs to a tag.

Then on your emitted object, have a tag sensor with its output value set to signal strength. Then its output will be the same analogue value as the value of your counter.

Then you need a counter on your emitted object counting the number of pulses, with its max count set to some multiple of the level counter's max (say, 10x the value for 10 pulses at level 1). Then you can compare if the pulse counter is greater than the tag sensor by using, say, a direction combiner, splitter and positional sequencer.

Yeah I did mean selectors, I've edited it now thanks.

Could you please elaborate on the last paragraph? I was with you until that point.
2011-08-20 17:42:00

Author:
Ali_Star
Posts: 4085


See 36184. That circuit compares the analogue values of the tag sensor and counter, and outputs high if the counter value is equal to or greater than the value of the tag sensor. The sequencer is set to positional.

What I meant about the multiplier was, say you have your 'level' counter set to a maximum of 50. If you want 10 pulses at level 1, 20 pulses at level 2 (etc) then you need to set your emitted object's counter to 10x that, or 500. (Incidentally I forgot before that counters can only go up to 100, but if you need to count higher you can just chain 2 counters together).
2011-08-20 18:36:00

Author:
Dr C
Posts: 122


I'm understanding a bit more now. But in my situation:

Lvl. 1 = 4 pulses
Lvl. 2 = 5 pulses
Lvl. 3 = 6 pulses

etc etc

Will your method work for this too? Because you're only talking about multiples.
2011-08-20 18:41:00

Author:
Ali_Star
Posts: 4085


You could make it work, yes. In that case, set the two counters to the same maximum value, but set your level counter's current (initial) value to 4. This will give it an offset, so at level 1 your counter is actually at 4, which corresponds to 4 pulses.2011-08-20 18:51:00

Author:
Dr C
Posts: 122


Hmmmmm, I don't know how.... I don't know why..... but it works

This has saved me a lot of hassle. I knew it would be something to do with this signal addition/subtraction malarky, but all that stuff confuses me quite a lot. The pic you uploaded certainly helped.

Thanks a lot, kind sir!!

BTW, why does that NOT gate need to be there.

EDIT: It also saved me a significant amount of thermo
2011-08-20 19:07:00

Author:
Ali_Star
Posts: 4085


OK, basically: the direction combiner is essentially comparing the values of the two counters. It will output a positive signal (>0) if the pulse counter is higher, a negative signal (<0) if the level counter is higher, and no signal at all (=0) if they are the same.

The following direction splitter will discard any positive signal, so it will only output a signal at all if the level counter is higher than the pulse counter. We feed that through the positional sequencer and battery which converts any signal to a 100% signal, invert that, and we now have 0% when the level counter is higher, and 100% when the pulse counter is equal to or higher than the level counter.

The inverter is just a slight tweak due to the nature of sequencers. You could switch the sequencer's input to the + side of the direction combiner and remove the inverter and the result would be almost the same. However the circuit's output would then trigger when the pulse counter is greater than the level counter, not greater than or equal to (meaning level 1 = 5 pulses). Though since you're setting an offset on your level counter anyway, you could do it that way and just set the offset to 3 instead of 4 and the behaviour should be identical.
2011-08-20 19:29:00

Author:
Dr C
Posts: 122


I see. Makes more sense now. Whoever worked all this out is a very clever person 2011-08-20 19:45:00

Author:
Ali_Star
Posts: 4085


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.