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

Does anyone know how to transfer value of one timer to another remote timer wireless?

Archive: 7 posts


I have just finished a level, and I do this specific object but I was wondering if there's a optimized or better way to do it.

My level is a strategic level, Level name Tower Wars: Base Defender, every tower you set, has its own internal health, I was looking a way where you can see it's current health putting pointer over tower.

Somehow I was able to do it but it has some flaws, health reading is not accurate just sightly different, and when tower is being attacked and you have pointer over it, health reading is inaccurate...

Here is my basic idea of transmission:

Internal health is held on a timer; the max timer count is 1 secs, the output of this timer is connected to a transmitter tag
I have a sequencer with just one strip, this stripe value is "0.1" secs, over this stripe there's a Battery. this sequencer is started by a sensor that basically will detect enemy hit, then will activate sequencer, check only 0.1 secs on timer that also will reflect this value over connected tag.

On the remote part of this health, I have a sensor set to "Signal Strength", I have connected to this sensor a Sequencer set to "Position"; this sequencer has 10 stripes, one for every 0.1 secs, from the original timer. here is where it get complicated:

every battery of this sequencer is connected to a selector; ten inputs, and 11 outputs, outputs 1 to 10 are connected each one to another sequencer, each sequencer has stripes with a value of 0.1, so first sequencer has 1 stripe, with one battery, second sequencer has 2 stripes and 2 batteries, third sequencer has 3 stripes and 3 batteries, and so on...

when I have all 10 sequencers done, every output of each sequencer (every one of the 10's sequencers) will reach an "OR" gate, the output of this "OR" gate will be connected to a Timer, that also have set max to 1 sec. This timer represents the "remote" health display.

logic here is: when tower sequencer get let say 2 hits, it will mark 0.2 on timer, this value will be transmitted using the tag.

Sensor(on remote Health display) will detect this "Signal Strength of 0.2" and will set this over sequencer, sequencer will activate second battery over second stripe which represent "0.2", then it will activate second output over selector which will trigger sequencer number 2 that have 2 stripes with two batteries and will send two pulses of 0.1 to the "remote" health display (which is also a timer set to max 1 Sec), that will represents the original 2 enemy hits...

Hope I have explained it well...

You can see this system in action on my level:

http://lbp.me/v/g07-kt

Does anybody knows a better way to do this?

Thanks!
2012-12-12 00:57:00

Author:
xquake
Posts: 73


Hopefully my suggestion makes sense in accordance with what you're trying to do. What about, instead of the batteries on the sequencer, just put tags that reference the amount of health left. When the sequencer is at that part of the "health bar", that tag will be active. Then just use tag sensors on the pointer, detect which tag is active, and bingo....that's how much hp it has. BTW, I was with you up until the sentence with the OR gate.2012-12-12 03:39:00

Author:
Brannayen
Posts: 438


Hopefully my suggestion makes sense in accordance with what you're trying to do. What about, instead of the batteries on the sequencer, just put tags that reference the amount of health left. When the sequencer is at that part of the "health bar", that tag will be active. Then just use tag sensors on the pointer, detect which tag is active, and bingo....that's how much hp it has. BTW, I was with you up until the sentence with the OR gate.

Hello Bannayen, thanks for taking time to read this, I "rephrased" the part you mention, hope it's clear now.

I will try to test your suggestion, and I will come back with my findings!

Thanks
2012-12-12 17:12:00

Author:
xquake
Posts: 73


I think you make it more complicated than it has to be. I'd ditch the HP stripes for now and just use a timer that is visible in Play Mode. You already mentioned that the HP of a tower is stored on its own timer. This is fine, but essentially what you need is a feedback loop; most creators who are new to this concept tend to think of analog signals and the storage of them visually, with timers or counters. CompherMC has a double-episode video tutorial (http://www.littlebigplanetarium.com/topic/936-lbplanetorials-20-feedback-loops/) on it; look it up.

Now, you have either a feedback loop or a timer there, hooked to a tag that broadcasts this signal to whoever wants to listen. You can have the cursor emit a piece of holo with a visible timer on it that picks up the tower signal via a strength tag sensor (small radius, only for the tower beneath). In order to have a timer display an analog value, set it to 0.1s, speed scale input. Stick a signal combiner in front of it, wire the timer's output to the negative input of this combiner and the actual analog signal you want to display into the positive input. You can then add some more logic that when the cursor leaves the tower, the temporary HP display destroys itself.

http://ie.lbp.me/img/ft/15e92a842820fd16d8584e4c27cc45f39af59f9f.jpg

The cardboard is the tower, the thing on the right is the temporary display of its HP. When spawned, the tower's top-left battery and 1-shot counter briefly injects the feedback loop (the circuit in the yellow section) with a 100% pulse. This 100% pulse will continue to loop and broadcast over the red tag.

When the HP bar is emitted on top of the tower, the red tag sensor (signal strength) picks up the loop signal and displays it on the timer (speed scale input, 0.1s).

When something hits the tower (a bullet?), an impact sensor flashes a 1-shot counter into an AND gate. Beside it sits a battery set to whatever percentage you want to subtract from the tower's HP on bullet impact (say, 10%). This gets subtracted from the looping signal via a signal combiner. The splitter right behind this is there to make sure that the loop does not dive below 0% when too much is subtracted from it. The splitter filters out the negative part of the looping signal so that any result below 0% stays 0%.

Not shown but required would be a sequencer set to positional, fed by the looping signal. On its canvas would be a 100% battery wired to a NOT gate. Behind the NOT gate sits a destroyer that kills the tower. This way, when the loop signal (and thus the tower's HP) reaches 0%, the destroyer gets a poke.
2012-12-12 19:02:00

Author:
Antikris
Posts: 1340


Hello Antikris,

Thanks for your wise advice, yes I know that it was really complicated but was the only thing I came with... Some things you said:


You can have the cursor emit a piece of holo with a visible timer on it that picks up the tower signal via a strength tag sensor (small radius, only for the tower beneath).

I already implemented it, also setting the logic to destroy itself when cursor is away.

That is why I published this question because I was waiting for a LBP guru like you to give to me an advice. I always thought that this could be made more optimized!

I have this level already published with the somehow messy logic

I will follow your advice and will update my level.

Thanks a lot again!
2012-12-12 21:59:00

Author:
xquake
Posts: 73


I think you make it more complicated than it has to be. I'd ditch the HP stripes for now and just use a timer that is visible in Play Mode. You already mentioned that the HP of a tower is stored on its own timer. This is fine, but essentially what you need is a feedback loop; most creators who are new to this concept tend to think of analog signals and the storage of them visually, with timers or counters. CompherMC has a double-episode video tutorial (http://www.littlebigplanetarium.com/topic/936-lbplanetorials-20-feedback-loops/) on it; look it up.

Now, you have either a feedback loop or a timer there, hooked to a tag that broadcasts this signal to whoever wants to listen. You can have the cursor emit a piece of holo with a visible timer on it that picks up the tower signal via a strength tag sensor (small radius, only for the tower beneath). In order to have a timer display an analog value, set it to 0.1s, speed scale input. Stick a signal combiner in front of it, wire the timer's output to the negative input of this combiner and the actual analog signal you want to display into the positive input. You can then add some more logic that when the cursor leaves the tower, the temporary HP display destroys itself.

http://ie.lbp.me/img/ft/15e92a842820fd16d8584e4c27cc45f39af59f9f.jpg

The cardboard is the tower, the thing on the right is the temporary display of its HP. When spawned, the tower's top-left battery and 1-shot counter briefly injects the feedback loop (the circuit in the yellow section) with a 100% pulse. This 100% pulse will continue to loop and broadcast over the red tag.

When the HP bar is emitted on top of the tower, the red tag sensor (signal strength) picks up the loop signal and displays it on the timer (speed scale input, 0.1s).

When something hits the tower (a bullet?), an impact sensor flashes a 1-shot counter into an AND gate. Beside it sits a battery set to whatever percentage you want to subtract from the tower's HP on bullet impact (say, 10%). This gets subtracted from the looping signal via a signal combiner. The splitter right behind this is there to make sure that the loop does not dive below 0% when too much is subtracted from it. The splitter filters out the negative part of the looping signal so that any result below 0% stays 0%.

Not shown but required would be a sequencer set to positional, fed by the looping signal. On its canvas would be a 100% battery wired to a NOT gate. Behind the NOT gate sits a destroyer that kills the tower. This way, when the loop signal (and thus the tower's HP) reaches 0%, the destroyer gets a poke.

Hey Antikris, thanks for you advice, I make modifications using your recommendations and now display shows damage correctly .

Thanks again!
2012-12-14 17:47:00

Author:
xquake
Posts: 73


Hey Antikris, thanks for you advice, I make modifications using your recommendations and now display shows damage correctly .

Always good to see a satisfied customer.
2012-12-16 22:22:00

Author:
Antikris
Posts: 1340


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.