Home    LittleBigPlanet 1 - PSP - Tearaway -Run Sackboy Run    LittleBigPlanet 1    [LBP1] Help! [Archive]
#1

A Variable in LBP

Archive: 25 posts


Hey guys. Is it possible to create, add to, subtract from, and keep track of a variable or a variation on that?2009-07-28 05:01:00

Author:
goldenclaw13
Posts: 224


I have an idea of how to do one.

an emitter hooked up to an OR switch which is activated by whatever actions would add to the variable. the emitter emits a block of dissolve with a magnet key and a magnet key switch. The dissolve block would drop down into a column with magnet key switches on the side to keep track of how high (how many) are in the column, then at the bottom of the column, the bottom slides over and the part that is under the blocks after sliding would have a magnet key to activate the magnet key switch on the dissolve and dissolve it. The piston would be connected to a OR switch activated by whatever would subtract from the variable.

I think it would work... *scratches head*
2009-07-28 05:09:00

Author:
Trap_T
Posts: 431


It might help us if you give an example of what you are trying to accomplish. Some of the members here are very good at working out logic for a given scenario, but specifics help greatly...

It sounds like you are looking to use some kind of toggle, but I'm not entirely sure of what you mean by a variable... please elaborate, and I'll try to help.
2009-07-28 05:22:00

Author:
comphermc
Posts: 5338


If you are asking if you can just have a variable, in the programming sense, then no. You need some kind of physical / mechanical implementation. I made an 8bit adder/subtractor at one point and Counters (incrementers and decrementers) can be achieved in several ways. As comphy says, it's very much an application-specific thing, so if you give us more infor we can point you in the right direction.2009-07-28 09:19:00

Author:
rtm223
Posts: 6497


I think Trap_T had a good idea. But the "variable" I want could get massive

Basically I want to keep track of money. Certain events would add to it, while others would subtract from it...
2009-07-28 17:12:00

Author:
goldenclaw13
Posts: 224


Ok, you can't really make a "variable" in LBP, but this should work:

Make a bar connected to a piston. This will be what shows the amount of money. It's no counter, but it should work out. Plus it's much easier than making a counter.
Put a three way switch inside a box of dark matter. Connect two winches on the switch, one to pull it to the left, and one to pull it to the right. It's usually a good idea to put both of them on opposite sides. Set the three way switch to "directional" and connect it to the piston you placed earlier.
Now make a box with a mag key switch on it and an emitter. Set the emitter to emit a block of dark matter with a magnetic key (not a switch). Copy the box. Set the mag key switches to each winch connected to the three way switch.
You can now copy the emitters for each action you want to take away or give money. Be sure to connect switches set to "one shot" to each emitter.
To change the "value" of the change, you can just change the lifetime of the specific emitter.

Hope this helps!
2009-07-28 17:34:00

Author:
crazymario
Posts: 657


Ooh, that's tricky. It would just involve a counter if you wanted to keep track of money, but the fact that you want to be able to subtract money makes it much more complicated.

I think I'll let rtm take this one, ha ha...
2009-07-28 17:53:00

Author:
comphermc
Posts: 5338


My guess is its possible, but the logic would be rather thermo heavy. Am i correct in guessing you want to make a bank? It might be easier to do it with physical coins (ie: pick one up, and it dissolves and emits at the bank) than with logical systems.2009-07-28 21:13:00

Author:
Burnvictim42
Posts: 3322


OK. I'm gonna have a think about this in a bit of depth. You want currancy that you can spend (take away from) and obtain (add to). I'm going to assume you don't need to accrue compound interest here? An incrementer / decrementer can be made as a traditional binary or BCD system or as others have suggested, with a three way input (it can be done more efficiently than that but never mind). Either method can be modified to add or subtract multiple units at once, but it's take a little longer.

Issues you will face:
conveying the balance to the user
adding more when near the max
taking away when near the min


2 is not very significant, you just make sure your max is very big

1 is awkward. If your level involves a fair amount of travel to and fro, you can have a "bank" location, or locations. Alternatively you will want a sack-person tracker, probably in 2D, with some kind of HUD. Once you have decided on this, you will need to actually implement a display fo some kind. The three way controlled piston is would naturally lend itself to a bar chart of sorts.

3 is the problem. I'm assuming you want to spend money on resources to progress. If everything costs 1 monies, you are laughing:

For binary - if ( (tryToSpend) AND (b0 OR b1 OR b2... OR bn) )
For piston - if ( (tryToSpend) AND NOT(pistonAtZero)


Otherwise you are going to need at least one means of checking for each of the values of resource. But good news is, if some things cost x, some cost y, and some cost z, that's only three checks need to be made, regardless of how many things cost x,y and z respectively.


All I can say is good luck to you
2009-07-28 23:47:00

Author:
rtm223
Posts: 6497


Ha ha, did you get all that, goldenclaw13? Like I said, complex...

Thanks for saving the day, rtm.
2009-07-29 01:02:00

Author:
comphermc
Posts: 5338


I don't know if he got it but my mind is blown! You guys are WAY too smart for my good. 2009-07-29 01:05:00

Author:
Morgana25
Posts: 5983


I'm a bit confused about what RTM said But I did manage to get something working.

It is really just too hard to explain I grabbed a sponge, and it emitted a block or a few. I grabbed another sponge, it started destroying the blocks.

It was a very bad version, as all the pieces were flying up my tube/shaft, so perhaps you would all like a video or something? If so, just say...
2009-07-29 01:07:00

Author:
goldenclaw13
Posts: 224


How silly of me!

Hey rtm - it sounds kind of like the crusher counter... I've said too much!

I think I can work out a decent system for you. Give me a little while to work it out. How much currency are we talking about?

If it's not much, then I can probably work out a simple model of about 15 units. Do you want each thing you collect to be worth the same? If so, awesome. Be back in a few [hours].
2009-07-29 01:10:00

Author:
comphermc
Posts: 5338


Just give me a base example. I'm sure I can work off of it from there 2009-07-29 01:15:00

Author:
goldenclaw13
Posts: 224


I'm pretty sure you could just make a string of number keys on a set of pistons to move it horizontally in desired increments for your display - have it start at 0, and all the negative actions will move it left and positive one's will move it right.

I actually have something almost just like this from when I was trying to build my old counter, and tried moving a block of numbers left and right. Want me to mod it and send it to you?
2009-07-29 02:17:00

Author:
Unknown User


Alright, my idea is done. It's not instant, because it involves things falling in chutes, but it does a pretty good job, and it's fairly easy to understand. I'm having problems connecting to PSN, but I will publish in Brazil when it finally connects. The level is called "Currency Device" and it is copyable.

Follow the directions in the level. The bottom pad adds a single currency unit, and each of the pads above (which appear when you have enough currency) are labeled with their value. To make it more interesting, just multiply everything by 25 to use more friendly numbers.

Edit: Shoot, Ninja's design would probably work a lot better. No bother, you can still check mine out once it's up.
2009-07-29 02:19:00

Author:
comphermc
Posts: 5338


OK. I'm gonna have a think about this in a bit of depth. You want currancy that you can spend (take away from) and obtain (add to). I'm going to assume you don't need to accrue compound interest here? An incrementer / decrementer can be made as a traditional binary or BCD system or as others have suggested, with a three way input (it can be done more efficiently than that but never mind). Either method can be modified to add or subtract multiple units at once, but it's take a little longer.

Issues you will face:
conveying the balance to the user
adding more when near the max
taking away when near the min


2 is not very significant, you just make sure your max is very big

1 is awkward. If your level involves a fair amount of travel to and fro, you can have a "bank" location, or locations. Alternatively you will want a sack-person tracker, probably in 2D, with some kind of HUD. Once you have decided on this, you will need to actually implement a display fo some kind. The three way controlled piston is would naturally lend itself to a bar chart of sorts.

3 is the problem. I'm assuming you want to spend money on resources to progress. If everything costs 1 monies, you are laughing:

For binary - if ( (tryToSpend) AND (b0 OR b1 OR b2... OR bn) )
For piston - if ( (tryToSpend) AND NOT(pistonAtZero)


Otherwise you are going to need at least one means of checking for each of the values of resource. But good news is, if some things cost x, some cost y, and some cost z, that's only three checks need to be made, regardless of how many things cost x,y and z respectively.


All I can say is good luck to you

I think if you wanted to subtract money, the AND piston set up from what I'm imagining could easily be controlled by a magnetic key system. Say you... collect a point with a key tied to a mag switch on, that mag switch will dissolve a key that's holding a magnetic key at bay tied to a switch that's extending (or not) the piston in that series - then you later "spend money" another magnetic key could emit right back in place and reverse the count.
2009-07-29 02:21:00

Author:
Unknown User


I think if you wanted to subtract money, the AND piston set up from what I'm imagining could easily be controlled by a magnetic key system. Say you... collect a point with a key tied to a mag switch on, that mag switch will dissolve a key that's holding a magnetic key at bay tied to a switch that's extending (or not) the piston in that series - then you later "spend money" another magnetic key could emit right back in place and reverse the count.

The problem then become which places receive the re-emitted items in the event of multiple purchases. For example, you collect an object and it deleted key A. You spend x amount of currency/points and it re-emits key A. Say that you have enough points to make another purchase... you can't emit key A anymore because it's already there.

My design is not the most intuitive in the world, but it seems pretty tricky. It's based almost entirely off emitting blocks that dissolve/kill themselves. The level should be up soon, once PSN stops being grumpy.
2009-07-29 02:27:00

Author:
comphermc
Posts: 5338


Right.... I figure as long as he's going no higher than double digits, handling the min and max with negative numbers would be ok, but in that case comphermc, you'd need the currency spending to emit keys that will activate switched pistons that aren't tied to any specific events way at the beginning of the piston chain. That way, ev en if you didn't collect any money at all and went in debt at an in game loan shark it would go from 0 to -1 etc then the event-triggered pistons would just be moving it back up from the deficit, or moving it from 0 in either situation.

This would be one long set of pistons and numbers... I would cap it at -30 and 30.
2009-07-29 02:29:00

Author:
Unknown User


K I'm done. It goes 0-10. Take's up less than 1/4 a bar.2009-07-29 02:39:00

Author:
Trap_T
Posts: 431


Alright, mine is up as well. It takes up a single notch. It smoothly adds currency and removes it when a purchase is made. It'd be up to you to make some sort of display showing the currency that the player currently has. I would keep the number low, and just use led lights.

@Ninja - I think you lost me, lol. I trust you know what you are talking about, but I think I'd need to see it to fully understand it.

Edit: I think I'm starting to get what you are saying, but I still don't understand how exactly it would handle multiple purchases. I'm trying, I swear!
2009-07-29 02:39:00

Author:
comphermc
Posts: 5338


Thing of it as one long AND switch, with some pistons backwards and some not.2009-07-29 02:55:00

Author:
Unknown User


YouTube - LittleBigPlanet - 0 to 10 Variable
there you go, no captions yet. I have to go
2009-07-29 03:16:00

Author:
Trap_T
Posts: 431


O.K, thanks to all who were able to help me out! Can you all send me your level keys or something? At least add me as a friend, so I can search your PSN

PSN - goldenclaw13

Thanks again! If I don't find what I need, I will make a better model of one I thought up...
2009-07-29 04:01:00

Author:
goldenclaw13
Posts: 224


Hm... you should be able to find me by searching comphermc (or even "Aperture Science"). It's unlocked and copyable for ya. I like what Trap_T has done with the digital readout. Combine that with what I've got and you should have a complete system.2009-07-29 05:33:00

Author:
comphermc
Posts: 5338


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.