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

scoring with sackbots

Archive: 40 posts


So now i'm upgrading my level: replacing the sackboys with sackbots for many new cool features!

however, the spikes on the wall, on which a player could throw his opponents to make him lose points won't work anymore!

i've been looking at the health logic on one of the creatures you control in Avalon levels, and it's kinda complex (for me, at least).

I guess i'm supposed to use projectile sensor, but that wouldn't work on the spikes, so i would have to replace them for a fire surface or something like that.

Anyway, the main issue is that i don't know how to give points to the owner of the sackbot who throws other player's sackbot on the spikes/fire.

thank you
2012-03-20 06:18:00

Author:
yodavid
Posts: 50


This is a tough nut to crack, and I'm afraid there may be no simple answer.

When using a score giver, it will either payout blindly (which will show white points), or it will have ownership to one of the players (which will show colored points)1. The way that it decides which it will do is entirely dependent on whether or not the signal that activates the score giver carries Player Data for one of the players. If you're not sure what player data is, it's the part of a signal that activates Player Color on various elements in the game.

I would first suggest playing around with player data to get a grasp on what components can carry player data (almost all of them, really), by wiring them to a material set to Player Color. Otherwise, you can set your logic components to be Player Color and you can track how a Player ID component of the signal propagates through your logic. It's not the most intuitive thing in the world, but it can make sense once you start to play around with it.

Now, when it comes time to actually paying out to the correct player, you'll have to decide on the system that works best for you. The easiest way to inject a Player Data component into your system is via an AND gate, where the top input carries the Player Data, and the bottom input is whatever you want to trigger the score giver. Since you are using sackbots, I imagine players are in Controlinators; this is good news since the Activate output on Controlinators is perfect for the top input on the AND gate, since it activates when a player is present and it carries Player Data2.

Now, the hard part is detecting which player has thrown another player into the spike pit. Sadly, there isn't a really good way of doing this, so you'll have to be clever.

1Or sometimes black, when the signal doesn't come directly from any player and it is set to play out to 'Just You.' This generally doesn't come up, but if you see it, then you need to inject a Player Data component into the signal.
2The fun part here is that since you are likely emitting sackbots, you will have to find a system to wirelessly communicate back to the controlinators. It's possible, but not trivial. Good luck!
2012-03-20 12:34:00

Author:
comphermc
Posts: 5338


To followup on Matt's advice above, it will depend on what mechanics you have in place that allows a player to throw the other around. Let's assume for the sake of simplicity you are using Grabinators. An object reacts to a Grabinator being used on it via a grab sensor. A grab sensor will - if I recall correctly - transfer ownership data of the player grabbing the object. You can test this the following way:

Create a block of neon set to player color. Stick a material tweaker to it set to allow grabbing. Stick a grab sensor to it and wire it to the neon. Now, when the block is grabbed (try it with a Grabinator equipped as well) it should light up in the popit color of the player grabbing it.

EDIT: you will have to test for this using controlled sackbots! I suspect that it will work, but just be sure. If you have a friend with you (or use a second controller), test with multiple people present.

Now, if this works, the next step is to store this signal inside the grabbed bot. Here is a quick schematic of what I think will work.

http://i.imgur.com/l0veg.png

The red section is a so-called Feedback Loop, which literally causes a signal to go in loops and thus be 'stored'. CompherMC has a video tutorial on these mighty logic beasts if you want to explore it further. The XOR gate construction is a gateway that will block all signal throughput when the reset signal is activated (and yes, the reset signal goes double into the 3-gate XOR) and clear the loop signal.

You will probably want to reset the signal through the following: two impact sensors into an AND gate, of which one sensor is global and the other is inverted and set to tag 'lethal'; with this the reset is triggered when a player is impacted with anything other than lethally tagged objects, for instance the floor. Because once the player is no longer airborne you wouldn't want a score to go to someone if the bot accidentally falls into some spikes.

The death event signal could be an impact sensor with tag 'lethal', but it might just be that such an event causes the bot to die before the signal reaches the AND gate. Test this and if it is the case, encase lethal objects in a shape of invisible holo which will be hit first before the player hit the true lethal object. Make sure that you set the tag sensors that register with this holo shape to 'include touching'.
2012-03-20 13:52:00

Author:
Antikris
Posts: 1340


EDIT: you will have to test for this using controlled sackbots! I suspect that it will work, but just be sure. If you have a friend with you (or use a second controller), test with multiple people present.

It will not work, hence why I said that it was quite a tricky problem.
2012-03-20 15:54:00

Author:
comphermc
Posts: 5338


It will not work, hence why I said that it was quite a tricky problem.

I am furious! Now I need to get this to work!! Will report back.
2012-03-20 16:03:00

Author:
Antikris
Posts: 1340


just use impact to transfer player data while being grabbed. just make sure you have the receiving controlinators "active seat" output wired to a tag (same tag on all bots), and make the impact sensor require said tag.

EDIT:
just tested it and it works. just make sure impact is set to include touching.
2012-03-20 20:37:00

Author:
evret
Posts: 612


And if you make the bot grabable by only a single player, using a material tweaker (that option is available on bots, right?), there will be less chance of errors when players are crowding together. Good job, evret.2012-03-20 21:16:00

Author:
Antikris
Posts: 1340


^All of the smartest logic guys I know chiming in - you are in good hands yodavid 2012-03-20 21:34:00

Author:
Slaeden-Bob
Posts: 605


slaeden: hehehe so it seems!

evret: i'm not sure i got the idea
what i tried to do was this

an AND gate on the sackbot's chip, connected to a score giver.
on the AND gate, an impact sensor including touching, and a tag sensor. a proper tag was added to the chip and wired to the output of the receiver controlinator.
since the tag sensor and the tag were both on the chip, the sensor wouldnt detect the tag, for some reason.
so it didn't work.

then i tried to place the same tag sensor on a grabbable object. then it worked. the player was earning points whenever the sackbot grabbed the object.

however, i don't know exactly how to apply it to "sackbot-throwing-sackbot-on-spikes" situation because i didn't exactly got your suggestion.
2012-03-21 00:30:00

Author:
yodavid
Posts: 50


I tried hooking up a tag sensor and a grab sensor to an AND gate, but it seems that the player signal the tag sensor is supposed to pick up and pass on through the gate is being interrupted or overwritten by the grab sensor. Maybe the grab sensor registers an anonymous signal from the bot every time instead of a lack of ownership signal, which could indicate its implementation is broken and not a missing feature.

Anyway, an alternative setup is to have the grab sensor activate a chip that contains the tag sensor; this way the signal of the grab sensor cannot interfere with the player signal from the tag sensor.

I have made something pretty funky by now. Will show it off when I feel it is stable.

EDIT: it is stupidly fun to throw people to their death but it has such a Cool Pages feel to it.
2012-03-21 01:20:00

Author:
Antikris
Posts: 1340


Worked fine for me with the impact and grab sensors, took less than 2 mins to set it up and it was working fine, I don't have time atm (or a ps3 nearby) but I'll post a pic of my setup later.
Also you could use OR priority to simply store the data of the last player to grab them instead of having to reset logic though I havnt tried it with player data.
2012-03-21 02:33:00

Author:
evret
Posts: 612


If impact is activated with grab (not sure about that)... then why dont you put diffrent tags on sackbots to detect whos grabing? after that you can make it deliver points to specific player since you using sackbots it's easy, just nullify player ownership from signal (by using battery in microchip) and owner of the sackbot get points2012-03-21 06:25:00

Author:
Shadowriver
Posts: 3991


Worked fine for me with the impact and grab sensors, took less than 2 mins to set it up and it was working fine

Yeah, that was another thing. With the grabinator equipped picking up an object or sackbot didn't trigger an impact sensor unless I bumped into them first. So I used a tag sensor instead.
2012-03-21 07:23:00

Author:
Antikris
Posts: 1340


If impact is activated with grab (not sure about that)... then why dont you put diffrent tags on sackbots to detect whos grabing? after that you can make it deliver points to specific player since you using sackbots it's easy, just nullify player ownership from signal (by using battery in microchip) and owner of the sackbot get points
just looking for method that uses least logic, it's easyier to just capture player data


Yeah, that was another thing. With the grabinator equipped picking up an object or sackbot didn't trigger an impact sensor unless I bumped into them first. So I used a tag sensor instead.
ah ok, didnt test with grabinator.

also OR priority does work with player data.
for example if you loop a 2-port OR gate into it's own top input, and wire player data to bottom input it will capture the first player data it receives and hold it untill the chip it is on is turned off
however if you swap the inputs so it loops into the bottom input, new player data will override stored player data. so the loop will always store the data of the last player who activated it
hope i made sense there.....
basicly if 2 or more inputs on an OR gate are the same strength the OR gate will always give priority to the top most input, therefore sending the top most input's sign and player data.
2012-03-21 08:28:00

Author:
evret
Posts: 612


basicly if 2 or more inputs on an OR gate are the same strength the OR gate will always give priority to the top most input, therefore sending the top most input's sign and player data.

Right. So if I would just swap that tag sensor and grab sensor around it should work. Can try.
2012-03-21 10:17:00

Author:
Antikris
Posts: 1340


Right. So if I would just swap that tag sensor and grab sensor around it should work. Can try.
is the sensor set to signal strength instead of closeness?
2012-03-21 10:28:00

Author:
evret
Posts: 612


is the sensor set to signal strength instead of closeness?

Nope. Closeness. The tag is activated by the assaulting bot's grab control (through an AND gate that also receives an ownership signal - perhaps I should reverse those as well).
2012-03-21 11:06:00

Author:
Antikris
Posts: 1340


if it's set to closeness it will recieve a lower signal than the grab is sending so priority wouldnt fix it, changing it to signal strength might fix it
also that priority function only works with OR gates, AND gates behave differently

EDIT: it seems AND gates have similar priority functions coz swaping with your setup worked..... will have to investigate further
2012-03-21 11:52:00

Author:
evret
Posts: 612


if it's set to closeness it will recieve a lower signal than the grab is sending so priority wouldnt fix it, changing it to signal strength might fix it
also that priority function only works with OR gates, AND gates behave differently

So far, I have been interpreting the inclusion of ownership data in a signal as complementary to the end result signal, meaning that regardless of which source get priority from streaming through a logic gate, the ownership is always added to it. Perhaps I have been wrong. Perhaps that when two signals meet at a gate and one that does not carry ownership is let through, the resulting signal doesn't have any player data either...
2012-03-21 13:18:00

Author:
Antikris
Posts: 1340


depends on the gate used, with OR gates digital, analog and player data can come from 3 different sources and all be sent out the OR's output tegether, but AND gates aren't so simple

for example when using an AND gate digital sign tends to also set the sign for analog signals....... still not sure on all the particulars though
2012-03-21 13:40:00

Author:
evret
Posts: 612


just looking for method that uses least logic, it's easyier to just capture player data

Last time i checked it's not going much easier if you find soothing better then ok
2012-03-21 16:38:00

Author:
Shadowriver
Posts: 3991


i couldn't follow much of what you guys have been saying. you guys have any clue on how i'm supposed to build that logic?2012-03-22 00:50:00

Author:
yodavid
Posts: 50


Last time i checked it's not going much easier if you find soothing better then ok
The problems with the OR loop method would still be present with the unique tag method, therefore the OR loop is still the better option as long as you only need player data for score giver or player colour

i couldn't follow much of what you guys have been saying. you guys have any clue on how i'm supposed to build that logic?
sorry I got side tracked last night and am yet again without time to explain properly the way I would do it, pretty much what antikris described, with the tag sensor upside down with angle range and radius set to only capture the tag on a bot directly below it (the bot that is carrying it) will try to upload a pic later
2012-03-22 02:36:00

Author:
evret
Posts: 612


i couldn't follow much of what you guys have been saying. you guys have any clue on how i'm supposed to build that logic?

Lol. Don't get the experts talking. You'll only leave dazed and confused.
2012-03-22 04:46:00

Author:
Speedynutty68
Posts: 1614


Ok, i've taken a few pics of the setup that are pretty easy to follow, none of the tags or sensors are labeled either, and logic is identical on all bots apart from controlinator colour, and tags/follower if you have the player following the bot on invisible holo
just make sure the green tag sensor is upside down, with sensor radius set to 12 and angle range set to 30. this should only detect tags directly below the bot (as it would be when the bot is grabbed with grabinators)
also swapping any of the inputs (on AND or OR gates) can cause issues so best to do it exactly as in the pics
for this setup i'm using a red tag on the target wall to give score and yellow tag on floor to reset stored player data

http://i5.lbp.me/img/ft/fd5be3d0633740e8de927c0781ad806af3c99d7e.jpg

http://ie.lbp.me/img/ft/44eafc7770229fe97ed1e9620bb060b74fc33488.jpg

http://i4.lbp.me/img/ft/fa4e4fecbd6a577a20c3dd7bc228a3fe5a231ef9.jpg
2012-03-22 15:13:00

Author:
evret
Posts: 612


guys, thank you SO MUCH for this. It worked perfectly.

At first i was totally lost on why the F there was a XOR gate, and the impact sensor was connected to 2 of its ports. After a while i managed to understand it (amazing), and after a while trying, i was able to adapt the logic to the ball.

maybe i'll come up with some other question (not so intricate, though =) later, since my level is like 98% done.
2012-03-22 22:01:00

Author:
yodavid
Posts: 50


WHOPS!
i've just ran onto a bug: if player 2 grabs player 3 and throws him, but player 1 intercepts player 3, and then throws him at electricity, the points go to player 2. it's not a HUGE bug, but it becomes huge when the same logic is being applied to the ball:
if the ball is intercepted before getting to the basket, the first player who touched it will score, which is weird.

any ideas?
2012-03-25 07:05:00

Author:
yodavid
Posts: 50


for the players, the new grabber should transfer his data to the grabbed player with that setup coz the top input of the OR overwrites the stored data in the loop. do you have the inputs exactly the same as in my pic?
otherwise the upsidedown sensor radius might not be quite large enough as bots might not alighn the same when moving quickly etc.

as far as your ball goes, that would depend on how you modified the logic for the ball
2012-03-25 08:03:00

Author:
evret
Posts: 612


it's everything the same way, only in the first AND gate, the tag sensor is not restricted to 30 degrees, but to 360.

and on the last AND gate, it's not an impact sensor, but a tag sensor, whose tag is located on the basket. works just fine as long as the first player touching the ball is the one who launches it to the basket.

where i think the problem is is at the XOR gate. the impact sensor which is activated by touching the ground works nice with the sackbots, but not with the ball... it's just that i don't know what to use to replace it.

although i'm not sure. if player 3 grabs player 2, throws him, and player 1 intercepts him in the air and them throws him at electricity, player 1 scores, even though player 2 didn't touch the ground.
2012-03-25 23:07:00

Author:
yodavid
Posts: 50


what is your ball made of? is it just a one of the premade object balls? if not try setting the impact sensor to include rigid connections.2012-03-26 02:28:00

Author:
evret
Posts: 612


i'll try it, thanks, man

by the way, evret, on the other topic, somebody recommended me a copyable level of yours, but i can get to its edit mode, it says i need to buy the metal gear solid pack to do so. what's that?

EDIT:

what is your ball made of? is it just a one of the premade object balls? if not try setting the impact sensor to include rigid connections.

my ball is that colored premade one.

i changed the rigid connections option, but it didn't help. i watched carefully the chip's logic while launching from one player to another. even though both sackbots are one the floor (not jumping), and there are blue tags on the floor material, the impact sensor doesn't activate, so everything from the OR gate on remains activated during the launch.
2012-03-26 04:56:00

Author:
yodavid
Posts: 50


whoa. unexpectedly, i came up with an idea. tested it few times and up to now, it worked every single time.

i replaced the blue impact sensor with an AND gate. connected to it, a speed sensor with invert output and speed 5.0 (every time you grab the ball, the speed decreases a lot, i thought) AND a tag sensor that detects the tag that is activated whenever you press R1. (used in the chip you showed us above).

i hope i won't find any new bugs =)

if you come up with something safer, let me know =)

thanks a lot
2012-03-26 05:24:00

Author:
yodavid
Posts: 50


im haveing trouble with my score giver, playing my level is the best way to see it
http://lbp.me/v/e5q7xf

im not using sackbots so it should be simple, but is still failing me, and you guys seem smart.

ready here we go, each time the giver is activated i want all players to recieve the 10 point, when any player dies the of course lose 10 thus determining the overall winner through the time limit of the game.

what seem's to be happening , ownership is remaining active by the last person to touch the object, which is a ball with a tag, that trips a sensor which activates the giver

im really confused iv;e tried many combinations of settings with mixed results.

anny score giver experts, please respond
2012-03-30 18:23:00

Author:
Unknown User


im haveing trouble with my score giver, playing my level is the best way to see it

Unless you think this thread is related to your problem (if so, how?), I think you should set up a new thread in this Help forum.
2012-03-30 19:05:00

Author:
Antikris
Posts: 1340


this is being absolutely terrible. i tried several things, but i can't make it work.

The issue is the ball's ownership
My last attempt was THIS (a variation from the image that was shown to me on this thread, on how to work with the ownership regarding one sackbot throwing another):
http://img820.imageshack.us/img820/2551/043rl.jpg

one chip for each player. player one has a blue tag with label 1, player 2, a purple tag with label 2, player 3, a pink tag with label 3, player 4, a red tag with label 4.

too bad that the grab sensors are all activated when any of the players grab the ball!! otherwise i think it should work.

EDIT:
the big question is regarding the ownership reset.

when one sackbot grabs another, his ownership is kept throught the logic, and it is reseted whenever the grabbed sackbot touches the ground.

But with the ball, i'm finding it to be pretty complicated. The reset would have to take place at some point between being launched and grabbed by another player.
2012-04-08 07:25:00

Author:
yodavid
Posts: 50


not sure why u have so many grab sensors, but i think swapping the inputs on the OR gate will solve the ownership issues, but all players should have the same tag colour and label, reset isnt needed coz if you have the OR wired correctly new owner will replace old owner as long as old owner is no longer in sensor radius

edit:
this setup was working fine for me, if player A picks up the ball and throws it, then player B catches it, thows and hits the target (or gets through hoop etc), player B will score.
with this setup the microchip was allways upside down when picked up with grabinators so i was able to keep sensor angle range at 30 and max distance was set at 13
also you you can replace the red impact with your sensor to detect when player should score.
I also left the reset, but thats only because i didnt want anyone to score if it bounced b4 hitting target.
http://if.lbp.me/img/ft/d1f8292fbb540c197ff004b74e9f732068de3ef7.jpg
2012-04-09 09:03:00

Author:
evret
Posts: 612


it's strange. i have no idea of why it isn't working for me, since i did as you've shown. the thing is ownership isn't being reseted when someone else grabs the ball. only if it touches the ground.

i made sure the tag sensor is 45 degrees, pointing down, and i've been testing in create mode with the chips visible, so i can see what is activated and when.

i can only think it has to do with the yellow impact sensor you used. is it set to include touching? include rigid connections?

i guess it includes rigid connection and therefore, if player A launches the ball, then player B intercepts it while in the air, and then launches, player A will score, perhaps?
2012-04-09 18:11:00

Author:
yodavid
Posts: 50


again i will stress the importance of making sure the inputs of the OR gate are the right way around, in the last picture you posted they were the WRONG way around. if in doubt- delete the OR gate you have, make sure the microchip is right way up (so activate input is on the bottom) and hasn't been reversed at any point (via R3), place a new OR gate and wire it's own output into it's bottom most input, then wire the AND output to the top input of the OR. forget the XOR for now as the hard reset is not needed for this to work.2012-04-09 20:34:00

Author:
evret
Posts: 612


again i will stress the importance of making sure the inputs of the OR gate are the right way around, in the last picture you posted they were the WRONG way around. if in doubt- delete the OR gate you have, make sure the microchip is right way up (so activate input is on the bottom) and hasn't been reversed at any point (via R3), place a new OR gate and wire it's own output into it's bottom most input, then wire the AND output to the top input of the OR. forget the XOR for now as the hard reset is not needed for this to work.

i had no idea the position of stuff played a role on the logic. i will try it out later then post feedback here. thanks man
2012-04-09 22:16:00

Author:
yodavid
Posts: 50


It's been mentioned several times in this thread already, see what I wrote when I posted the pic of the original setup.2012-04-10 02:22:00

Author:
evret
Posts: 612


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.