Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Help! Preference Library Error
Started by jeremy_glover Apr 30 2018 12:11 PM

2 replies to this topic
preference library error corona sdk

Best Answer jeremy_glover , 01 May 2018 - 11:07 AM

Rob, I actually figured it out! I was pretty dumb, actually. I figured out I was getting that error before I was trying to require something that didn't exist. I figured the preference module existed already in Corona just like widgets or physics. 

 

I eventually stumbled upon THIS page, which completely solved my problems! I only wish I found it sooner. Would have saved a lot of headaches. If you google search "save high scores corona sdk", this page should be at the top, but it unfortunately doesn't show up. 

 

Thanks for the help regardless! 

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jeremy_glover

[GLOBAL: userInfoPane.html]
jeremy_glover
  • Observer

  • 2 posts
  • Corona SDK

I need to implement a high score feature for the game I'm working on for a class project. I need to be able to update lua files permanently to track high score. 

 

According to this page, using the preferences library and functionality would be the easiest option for Corona. However, when I try to require "preferences" I get a nasty error message (in the image below). 

 

What am I doing wrong? 

 

Snip20180430_2.png



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 23,714 posts
  • Corona Staff

Have you downloaded that library and dropped it in to the folder with your main.lua?  This is a community created module so we can't provide direct support for it.  The error indicates that it can't find the preference library.

 

I don't know how old that library is, but we now have our own preferences library built in to the core under system.setPreferences() (https://docs.coronalabs.com/api/library/system/setPreferences.html), system.getPreference() (https://docs.coronalabs.com/api/library/system/getPreference.html) and system.deletePreferences() (https://docs.coronalabs.com/api/library/system/deletePreferences.html).  You might want to look at them instead.

 

Rob



[TOPIC: post.html]
#3

jeremy_glover

[GLOBAL: userInfoPane.html]
jeremy_glover
  • Observer

  • 2 posts
  • Corona SDK

  Best Answer

Rob, I actually figured it out! I was pretty dumb, actually. I figured out I was getting that error before I was trying to require something that didn't exist. I figured the preference module existed already in Corona just like widgets or physics. 

 

I eventually stumbled upon THIS page, which completely solved my problems! I only wish I found it sooner. Would have saved a lot of headaches. If you google search "save high scores corona sdk", this page should be at the top, but it unfortunately doesn't show up. 

 

Thanks for the help regardless! 




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: preference, library, error, corona, sdk