Home    LBP Showcase / Reviews / Recommendations    Object Showcase
#1

Dynamic Repeater

Archive: 5 posts


I have creator a logic element that you may find interesting. It was inspired by rtm223 logic blog. (http://www.lbpcentral.com/forums/blog.php?4150-Logic-Blog)

In psuedocode it would be the following for statement:

for(int cnt = 0; cnt < B: cnt++){
// Do Something
}

My circuit takes in analog value of B and executes when you send the start signal.
B can be a battery value from .1 to .99 in increments of .1

Here is the circuit:
http://i4.lbp.me/img/ft/6c41ed36f09c0feda818faad8359251c50b6e42a.jpg

Here is the sequencer:
http://ie.lbp.me/img/ft/e6eaff7020700532fb7e91151f5425d7a4d8595c.jpg

Here is the circuit being used to increment a counter based on a battery value
http://i8.lbp.me/img/ft/478a77a2abe823efc33da26a2c7a875d03c409e2.jpg

You can get the repeater here: http://lbp.me/v/xyc1-s

It works by subtracting the analog output of the counter from B. This is compared using the sequencer. If the value is not zero then the counter is increased by 1. Eventually the analog output of the counter will match the input B. Then the whole thing is reset. This can be used dynamically repeat an action based on an analog signal. It was created for a friend making an RPG. They wanted to changed an HP counter based on a damage stat. The damage stat was based on subtracting a Defense battery value from an Attack battery value.
2011-02-22 01:44:00

Author:
OrangeTroz
Posts: 90


That's pretty cool. It might be handy to add a direction splitter after the direction combiner, so that your test is "count < b" instead of "count != b" - if (b) is a timer output or a value from a player sensor or an arithmetic result of some kind, it may not exactly match a whole percentage value... Alternately, you could roll a tolerance factor into the sequencer...

(EDIT): Though if the input changes, then the "greater than" test becomes more useful than a tolerance factor would be...
2011-02-22 02:08:00

Author:
tetsujin
Posts: 187


Wait, so what does it do? I'm pretty good with logic, but you explained it all confusing.2011-02-22 02:24:00

Author:
Joey9898
Posts: 131


That's pretty cool. It might be handy to add a direction splitter after the direction combiner, so that your test is "count < b" instead of "count != b" - if (b) is a timer output or a value from a player sensor or an arithmetic result of some kind, it may not exactly match a whole percentage value... Alternately, you could roll a tolerance factor into the sequencer...

Yeah that is a good idea.


Wait, so what does it do? I'm pretty good with logic, but you explained it all confusing.

It sends X number of pulses. Where X is an analog input to the circuit.
2011-02-22 06:55:00

Author:
OrangeTroz
Posts: 90


I had an idea very similar to this. I keep forgetting to test it though. A sequencer used to make a health bar. I'm going to test this now. Thanks for reminding me.2011-02-22 07:30:00

Author:
Devious_Oatmeal
Posts: 1799


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.