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

Questions about Signal Addition using the OR Gate

Archive: 7 posts


I've only recently discovered the new functionality of the OR gates - allowing to add signals together. So I was messing around with this the other day.

3 objects, each with their own "signal strength". To do this I had a counter with max value 5, gave each counter a value of 1/5, and attached each of these to a green tag.
These counters were attached to one input of an OR gate (set to add signals), with a green tag sensor (set to signal strength) attached to the other input. I attached the output to a positional sequencer to test the value. So the idea is that when one object comes into the vicinity of the other, the signals would add together. This worked with 2 objects - it gave me an output of 2/5, but when the 3rd object was in range, the output was STILL 2/5. I had hoped it'd add all 3 together but it didn't. What's the easiest way to get around this?

Similarly I'd like to all the logic to take away values, or add negative values if this is possible?
2014-01-29 09:46:00

Author:
Ali_Star
Posts: 4085


I think your problem is that the tag sensor will only give the output of one tag in range, so no matter how many objects there are, it will only one tag's strength. The easiest way around it is to label each tag differently and add a tag sensor and OR input gate, so that object 1 has the following OR gate inputs: counter at 1/5, tag sensor "object 2" and tag sensor "object 3", etc. Unless you need to be able to add more objects, because this method is not very scaleable.

Also, any particular reason why are you not using batteries tweaked to 20% in stead of counters? You may get a better solution if we know the whole story.
2014-01-29 11:32:00

Author:
Rogar
Posts: 2284


I think your problem is that the tag sensor will only give the output of one tag in range, so no matter how many objects there are, it will only one tag's strength. The easiest way around it is to label each tag differently and add a tag sensor and OR input gate, so that object 1 has the following OR gate inputs: counter at 1/5, tag sensor "object 2" and tag sensor "object 3", etc. Unless you need to be able to add more objects, because this method is not very scaleable.


Yeah, I did think of having a unique tag on each object, but it's not particularly efficient so I hoped there would be a better way.



Also, any particular reason why are you not using batteries tweaked to 20% in stead of counters? You may get a better solution if we know the whole story.

Errrm.... no real reason I suppose. I guess it's just easier to visualise when a counter is set to 20% rather than when a battery is set to 20%. So if I were to have a different strength on each object, I can instantly tell the strength on each one, rather than having to select/highlight the battery to tell the strength.
2014-01-29 11:50:00

Author:
Ali_Star
Posts: 4085


Well, you asked for easy, not efficient.

Does the tag sensor have a setting for number of tags like the player sensor does? Then you could have a second tag sensor only activate for two tags present. But that still wouldn't work if you start assigning different strengths to your objects.

And if you're dropping the constraint that it has to be easy... I had some success with assigning communication time slots to objects dynamically. In essence, each object would only send their value for a short period of time (like 0.1 second, or 1 frame), and sequentially, meaning they go after one another so they don't interfere with eachother. Then you measure the tag at the same sample speed as the time slots and add the value to a running total. With a few control flags and a way to resolve collisions you can make this work with an unlimited amount of dynamically created objects, but the more objects you have, the more samples you must take and the slower the total is calculated.
2014-01-29 17:01:00

Author:
Rogar
Posts: 2284


Well, you asked for easy, not efficient.

Does the tag sensor have a setting for number of tags like the player sensor does?

Yeah, the tag sensor does have that same option.
2014-01-30 12:47:00

Author:
Ali_Star
Posts: 4085


I haven't read all posts so please excuse me if this has already been answered/asked.

About taking away values from a signal, is it possible to just set up a battery to say -20% and hook it up to an or-gate that adds up? Surely that'd work well for taking away values? So if you have a battery set to 100% then one could easily take away using negative values.

I'm no logic magican but still enjoying these shiny new features very much
2014-02-03 00:20:00

Author:
Mnniska
Posts: 531


I haven't read all posts so please excuse me if this has already been answered/asked.

About taking away values from a signal, is it possible to just set up a battery to say -20% and hook it up to an or-gate that adds up? Surely that'd work well for taking away values? So if you have a battery set to 100% then one could easily take away using negative values.

I'm no logic magican but still enjoying these shiny new features very much

Another way to do it could be to give something a negative value (ie so I would be adding a negative) by hooking the original value up to an AND gate, setting it to multiply and attaching a -100% battery to the other input..... perhaps..... maybe..... quit possibly potentially.
2014-02-03 09:36: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.