Blockland Forums > Modification Help

[SOLVED] How to Register Preferences (Support_Preferences)?

Pages: (1/1)

Platypi:

I can't seem to figure out how to create server preferences. All the examples I can find use RTB preferences, and I would prefer to use a more up-to-date standard. Namely, I want to create something that would work with Blockland Glass. I'm under the impression that Support_Preferences is the preference system that Blockland Glass uses, as per their documentation. But I can't get it to work. I tried mimicking the code found in this file. Here's my code:

--- Code: ---registerPref("Test", "General", "Test", "number", "$Pref::Test::Test", "Support_Preferences", 50, "1 100 0", "updateServerSetting", 0, 0, 0);

--- End code ---
I ran it, but it didn't work. I opened the Preferences tab in the Blockland Glass Server Settings. But nothing showed up. I tried

--- Code: ---echo($Pref::Test::Test);

--- End code ---
But it displayed nothing. However, when I run

--- Code: ---echo(TestPrefs.getObject(0).variable);

--- End code ---
it outputs $Pref::Test::Test. I did not get an error message when I ran registerPref, so I'm not sure what I did incorrectly.

Platypi:

Also, I'm not sure why

--- Code: ---ForceRequiredAddOn("Support_Preferences");

--- End code ---
doesn't work. I returns -3 ($Error:AddOn_NotFound) tells me "Support_Preferences" is not a valid add-on, despite Support_Preferences.zip being obviously in my add-ons folder.

Platypi:

So apparently, if I run

--- Code: ---ForceRequiredAddOn("System_BlocklandGlass");

--- End code ---
instead of

--- Code: ---ForceRequiredAddOn("Support_Preferences");

--- End code ---
then registerPref works just as expected.

*shrugs*

Pages: (1/1)

Go to full version