Home LittleBigPlanet 2 - 3 - Vita - Karting LittleBigPlanet 2 [LBP2] Tutorials
#1
Sackboy death detector (no sackbot needed, single player only)
Archive: 5 posts
Let's say you need to know if your player died or not, given you're not using a controllable sackbot; maybe it's for a death counter of something, I don't know. The only thing you must do is to create a inverted player sensor that's certain to have the player on its range (give it the maximum detection range of 5000 to make sure); each time the sackboy dies, it'll send a brief signal since it's not detected anymore. Be wary that it also works at entry, so the very first output must NOT count. That's all! It's an incredibly simple but very handy way to know if a player died or not, and I guess many of you have already figured it out, but this might be still useful for many like me who needed this. | 2012-10-22 15:26:00 Author: MatrixEchidna Posts: 66 |
Good advice. The only thing I would add is you could have a timer set to briefly count up that keeps the first one from shooting upon entry. Attach both to an And Gate. | 2012-10-22 17:03:00 Author: xxMATEOSxx Posts: 1787 |
I devised one in the LBP1 days that would work regardless of the number of players. The only issue with it was that it was attached to a single checkpoint, so it would need to be repeated at each checkpoint if you wanted it to apply to the whole level. That didn't matter for my purposes because I was only using it for a "you-suck-meter" on a boss fight: if the player died too many times while trying to get through a short maze while dodging enemy fire, it would spawn a new checkpoint halfway through the maze so that the player wouldn't be stuck forever... but I digress. My technique was to use two player sensors at the checkpoint, each hooked to a timer (in LBP1, timers were pistons or other movers combined with mag keys; in LBP2 you could use an actual timer for the logic). One sensor had a reasonably large detection range while the other had a detection range that only covered the area immediately in front of the checkpoint. The small one was hooked to a .1s timer while the larger was connected to a .2s or .3s timer (can't remember for sure which) and both timers were hooked to an AND gate so that if the small sensor was triggered before the large one, its time would fill up before the large one's time could and it would register as positive for a death. It worked well enough that I could drop my sackboy from the very top of the level and hit terminal velocity before getting to the checkpoint and it still wouldn't register a false positive: only way to trigger it was with a genuine death. There are limitations of course: if one player stood in front of the checkpoint while the other went off and died, it wouldn't count the death, but the layout of the level made that unlikely. With LBP2 logic, the way I would do it is pretty much what you did, but I'd fix it to work with any number of players (I've never been a fan of single-player-only levels). Set up four player sensors to cover the whole level. Set one to activate if a single player is detected, the next will require two players and so on. Tie them into a selector and hook the outputs to four microchips. Each chip will have another player sensor set to the same number as the sensor that activated it (so there'll be one that requires one player, one that requires two and so on). If the logic has already detected that there are four players and then it ceases to detect four, it will register that as a death. To really do it right, you'll need additional logic: for example, the chip with the four-player sensor will also need a three-player, a two-player, and a one-player sensor, so that it can tell if two, three, or all four players die. You would also want to set the sensors on a timer and run it through an AND gate with sensors at each checkpoint so that if it detects that you're down to three players and you pass in front of a checkpoint without your fourth player reappearing, it will know that he has left the game and it will switch to only checking for three players. To cover all your bases would take semi-complex logic, but it shouldn't be too difficult to get it working. | 2012-10-24 03:14:00 Author: Sehven Posts: 2188 |
The problem is... This doesn't cover WHICH player died, does it? | 2012-10-25 01:20:00 Author: MatrixEchidna Posts: 66 |
No, you're right. It would only work for a communal death counter just like the checkpoints in the game. If the communal thing isn't what you're after, then there isn't any way to do it without bots or limiting it to a single player. | 2012-10-25 17:05:00 Author: Sehven Posts: 2188 |
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.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.