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

help with activating highest value logic

Archive: 6 posts


hi guys, on my sackbot enemy AI (its a two player level) my AI needs to be able to determine what sackbot is closer and attack accordingly, i have all the logic set up but i got stuck, how do i take the digital signal (or is it analouge, well the percent of battery kind not 1 or 0 lol) and determine wich sensor is reading the tag closer to the enemy and actiate the rest of my logic accordingly. so in a shortened version i need it to tell whos closer with the tags and give me an output, thanks!2011-04-09 22:50:00

Author:
dragonights
Posts: 209


I believe sehven has a good post on this if you search for it. he had a similar problem. I've worked out a circuit for an experiment i was doing that determines the closest, and i can post it if you want.

but for the sackbots, tag sensors automatically zone in on the closest tag. You may not need any extra processing.
2011-04-10 06:42:00

Author:
tdarb
Posts: 689


I believe sehven has a good post on this if you search for it. he had a similar problem.

I think this (https://lbpcentral.lbp-hub.com/index.php?t=49984-Comparing-4-analog-signals-to-find-the-strongest) is the one.
2011-04-10 16:18:00

Author:
Aya042
Posts: 2870


hey guys thanks but im still having abit of trouble i think i messed up while subtracting (i haven't played lbp 2 in a while so im pretty sure its a wiring mistake)for whatever reason my friend, energyray, cant seem to be able to subtract the signals of the two tag sensors. either, so if somone could check and see if they can subtract tag sensors then that would be great2011-04-10 17:47:00

Author:
dragonights
Posts: 209


hey guys thanks but im still having abit of trouble i think i messed up while subtracting (i haven't played lbp 2 in a while so im pretty sure its a wiring mistake)for whatever reason my friend, energyray, cant seem to be able to subtract the signals of the two tag sensors. either, so if somone could check and see if they can subtract tag sensors then that would be great

Should be as simple as plugging both tag sensors into a direction combiner - the output will be the signal in the negative input subtracted from that in the positive input.
2011-04-10 20:00:00

Author:
Aya042
Posts: 2870


First:
https://lbpcentral.lbp-hub.com/index.php?t=54143-Zero-Latency-Ana.logue-Logic-Toolset

Then:
http://dl.dropbox.com/u/19532904/closest%20tag.png

The top output will output an ANALOGUE signal of 100% when tag1 is closer than tag2, 0% otherwise
The bottom output will output an ANALOGUE signal of 100% when tag2 is closer than tag1, 0% otherwise
No outputs will be active when they are exactly the same distance (you could change this by making one of the "less than" signs a "less than or equal to" sign).

Now note that this is only the analogue part of the signal. So it can't be used to e.g. turn microchips or followers on or off UNLESS you convert each signal to digital first; this is done like so (with sequencer set to positional):
http://dl.dropbox.com/u/19532904/anadigiconvert.png

Or else I think you could use "strength scale" on followers since that accepts analogue input.
2011-04-10 22:33:00

Author:
thor
Posts: 388


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.