# \[Extension\] BetterSettings - Save booleans, images and string arrays!

**URL:** <https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [April 10, 2023, 5:42pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089 "2023-04-10T17:42:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 10, 2023, 5:42pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/1 "2023-04-10T17:42:31Z")

</div>

Since I am writing this on Sunday, happy Easter everyone! 🐣🐇

* * *

Recently I promised to release a new extension by the end of the week. Technically, I released it on [my GitHub](https://github.com/S0m3randomguy/bettersettings/releases/latest), but you’re most likely reading this on monday, because of the forum approval process.

# Introducing: BetterSettings!

* * *

BetterSettings is an extension I’ve waited for for a long time. Simply adding more datatypes to the [settings](https://forum.makecode.com/t/quick-tutorial-on-the-settings-namespace/1013) namespace shouldn’t be that hard, right?

> **Well, nobody did it, so I had no choice.**
>
> ![me.jpeg](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9f8b167acf6e0d3c2269ca8c0b74d63b6ab1d308.jpeg)

You can now save new datatypes to device storage.  
The datatypes currently supported include:

- String arrays
- Booleans
- Images
- Boolean arrays

The datatypes I’m considering at the moment include:

- Image arrays
- Nested arrays (eg. `number[][]...`)
- Tilemaps
- Objects

…and more!

It’s important to note that the BetterSettings extension is just an addon to the standard [BlockSettings](https://github.com/microsoft/pxt-settings-blocks) extension, which means you’ll still be getting all of your standard blocks. You can also migrate to BetterSettings even if you have older projects with the settings extension installed.

# Available Blocks

* * *

This extension adds 8 new blocks to the `BetterSettings` category. (Replaces `Settings` if existent).  
**General datatypes**  
`[W/R boolean, W/R image]`

 ![General](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/318b86a0a58fdccae9b6cb41345664bb686b9d3c.png)

Here you can access standard datatypes such as booleans and images. I’m planning to expand on this in the future with some of the datatypes named above.

**Arrays**  
`[W/R string[], W/R boolean[]]`

 ![Arrays](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2487ca9729f00188ad0fa5870832611c460a8fe2.png)

Here you can access array datatypes. Along with the standard number arrays, the string and boolean arrays are now available. In the future, image arrays and nested arrays are planned.

Feel free to use this extension, no creds required. If you found this useful, leave a reply or like, and if you have any questions/suggestions related to datatypes or operations, make sure to reach out below. Cheers!

(Repo/extension link)

> **[GitHub - sargedev/declutter: Declutter your MakeCode blocks workspace](https://github.com/sargedev/declutter)**
>
> Declutter your MakeCode blocks workspace

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 10, 2023, 6:20pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/2 "2023-04-10T18:20:27Z")

</div>

THANK YOU SO MUCH THIS IS A LIFESAVER AHHHHH!  
Thank you so much this is a lifesaver ahhh!!!

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [April 10, 2023, 6:23pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/3 "2023-04-10T18:23:58Z")

</div>

This is AWESOME! This is gonna be really helpful for me!  
The extension GitHub link seems to be for the Declutter extension though.

---

<div class="post-metadata">

**Author:** ![BoostedGames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/boostedgames/32/29419_2.png) [@BoostedGames](https://forum.makecode.com/u/BoostedGames)\
**Post date:** [April 10, 2023, 6:23pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/4 "2023-04-10T18:23:59Z")

</div>

Very cool!

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [April 10, 2023, 6:24pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/5 "2023-04-10T18:24:01Z")

</div>

## _ **YESSSSSSSS!!! I’VE BEEN WAITING FOR THIS!!!** _ 🤪

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [April 10, 2023, 6:39pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/6 "2023-04-10T18:39:12Z")

</div>

Ummmmmmmmmmmmmmmmmm I would love to use this extension… but don’t know how… can you save a game with this? (like have game files and stuff?)

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 10, 2023, 6:39pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/7 "2023-04-10T18:39:43Z")

</div>

Oh damn, thanks for noticing! I must have mistakenly put that one.  
Here’s the real link, since I can’t edit the post anymore

> **[GitHub - S0m3randomguy/bettersettings: Add improved settings namespace blocks...](https://github.com/S0m3randomguy/BetterSettings)**
>
> Add improved settings namespace blocks that support more verbose datatypes - GitHub - S0m3randomguy/bettersettings: Add improved settings namespace blocks that support more verbose datatypes

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 10, 2023, 6:44pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/8 "2023-04-10T18:44:36Z")

</div>

You can save individual values using ‘keys’, kind of like setting permanent variables that are saved to the device. It’s something that’s been available for a long time on MakeCode, but this extension just improves on the functionality of that feature by adding more datatypes.

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [April 10, 2023, 6:44pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/9 "2023-04-10T18:44:37Z")

</div>

Great! I can’t wait to use this!

---

<div class="post-metadata">

**Author:** ![Unique](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unique/32/32724_2.png) [@Unique](https://forum.makecode.com/u/Unique)\
**Post date:** [April 10, 2023, 6:53pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/10 "2023-04-10T18:53:23Z")

</div>

No lie I was making something just like this! This is really cool though. Definitely very useful, that’s for sure.

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [April 11, 2023, 6:29pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/11 "2023-04-11T18:29:16Z")

</div>

> [@Sarge](#):
>
> The datatypes I’m considering at the moment include:
> 
> - Image arrays
> - Nested arrays (eg. `number[][]...`)
> - Tilemaps
> - Objects
> 
> …and more!

Being able to save tilemaps would be super helpful for games like @Maketendo’s MakeCode Builder!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 11, 2023, 8:19pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/12 "2023-04-11T20:19:24Z")

</div>

Well, tiles are really just images, and tilemaps are 2 dimensional arrays of images. Considering I’m already planning to implement image arrays, tilemaps should be pretty straight forward.

---

<div class="post-metadata">

**Author:** ![Thenerdy1](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@Thenerdy1](https://forum.makecode.com/u/Thenerdy1)\
**Post date:** [April 11, 2023, 11:12pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/13 "2023-04-11T23:12:42Z")

</div>

Please make tilemaps saveable!  
I have had games before that would have been next level with this functionality!  
For example, I made a farming game where you hoed, planted, watered, and upgraded your farm, but I tried to make it possible to save your farm after a reset, which wouldn’t work. tilemap saves would be fantastic!

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 12, 2023, 4:03pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/14 "2023-04-12T16:03:01Z")

</div>

> [@Sarge](#):
>
> and tilemaps are 2 dimensional arrays of images

Are you going to store each pixel of every tile’s image or is it a 2D array of tile IDs?

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 12, 2023, 7:42pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/15 "2023-04-12T19:42:06Z")

</div>

The idea is to assign every unique tile to a number, and then essentially store a map of those numbers, according to the tilemap.  
That’s way more efficient than storing every image over and over again for every time they appear in the tilemap.

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 12, 2023, 7:58pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/16 "2023-04-12T19:58:13Z")

</div>

> [@EpicKitty](#):
>
> Are you going to store each pixel of every tile’s image or is it a 2D array of tile IDs?

Whoops, looks like I didn’t read your post properly, I must have missed this. Yeah, that’s basically what I said in my other reply

---

<div class="post-metadata">

**Author:** ![Unique](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unique/32/32724_2.png) [@Unique](https://forum.makecode.com/u/Unique)\
**Post date:** [May 25, 2023, 3:49pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/17 "2023-05-25T15:49:28Z")

</div>

Hey @Sarge! By any chance, did you get around to working on the support for image arrays?

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [May 25, 2023, 5:25pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/18 "2023-05-25T17:25:41Z")

</div>

Yeah I’ve kind of thrown this on the backburner (like every other project lol) but thanks for reminding me, since this is a very straight forward feature to add!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [May 26, 2023, 6:06pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/19 "2023-05-26T18:06:34Z")

</div>

I’ve done it! Image arrays are now available as a part of the extension. I also fixed string arrays, since they were broken. (somehow it was not reported by anyone)

> **[Release BetterSettings 2023.5.1 release · S0m3randomguy/bettersettings](https://github.com/S0m3randomguy/bettersettings/releases/tag/2023.5.1)**
>
> Fixed string array issues and added support for image arrays.

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [July 5, 2023, 4:12pm UTC](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089/20 "2023-07-05T16:12:39Z")

</div>

OMG now you can save variable!!!

[Next page](https://forum.makecode.com/t/extension-bettersettings-save-booleans-images-and-string-arrays/19089.md?page=2)
