Electric scales [Lua]

Cralant - Custom level - from Windows
PlayEdit10 players liked this.Log in to like this level.

Works with a pressure sensor and using a reference point of 5 kg for the large wooden box.

Should display the kg weight of the object up to 3 decimal places. Pressure sensors are a bit weird so you may have to try several times. This doesn't really work with more then one item at a time unless you have the items on top of each other, thats why the plank is there to sort this issue. The planks weight is calibrated to 0 though so it makes no difference. This is just an issue with the pressure sensor.
Also the display isnt perfect but I just whipped something up, if you want to redisign it then go ahead, use the same displays for the logic to display correctly.

Thanks to GH7 for the reference point.

Views: 1056 Downloads: 353 Unique objects: 7 Total objects: 41

Derivatives

Discuss this level

Log in to comment on this level.
  • JOELwindows7: Injected here. Awesome!
  • GH7: @Cralant: Not bad at all and thank you, that's very helpful.
  • Cralant: @GH7: Not bad for something I only started learning when it came to Principia ;)
    Well I always just learnt by finding something that interested me and then looking at simple projects and picking up the basics, then going on to create your own stuff. Always read the documentation where you can to understand why something does that and its arguments. With time you will get better, once you understand programming you can tend to see what is happening in other languages even if you have never used the language before. The basic structure is visible because of your understanding of similar languages. Also look for courses online or in real life. One website I love is www.codecademy.com it has some courses, one of which is javascript. The courses are generally simple but give you an understanding of all the basics which give you the foundations you need to continue learning.
  • GH7: @Cralant: I'd say you were pretty competent in lua as well. Haha. I've been developing a prototype game in unity, using javascript, and using peoples free but broken code. I'm going to move up to cryengine soon, any tips on learning and understanding scripting, or is it mostly memory, and practice?
  • Cralant: @GH7: Used to know actionscript 2.0 fluently but then I haven't touched the language in a few years. I know a fair amount of html, php and css. I consider myself pretty competent in lua and I have dabbled in C, C# and java.
  • pajlada: @zardOz: Probably a lot, documentation of Lua functions have been poor unfortunately. I hope to better myself for 1.5!
  • zardOz2: @pajlada: doh! What other secrets of the universe are you keeping!:)
  • GH7: @Cralant: lua* damn autocorrect
  • GH7: @Cralant: Awesome job. Do you know any other coding languages other than KIA?
  • Cralant: @pajlada: Huh thanks pajlada, never knew that was an argument, this will be useful.
  • pajlada: By the way, there's a second optional argument to game:show_numfeed which specifies how many decimals should be displayed.
    So try writing this instead: game:show_numfeed(weight, 3)
  • pajlada: Nice :D
  • Cralant: @GH7: Here it is.

LEVEL ID: 6256