Array lost ability to compare content after loading JSON from file ???

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Inces

My function relies on erasing array element in larger array after recognizing duplications in already instanced nodes. It looks like this :

g.wholeteam.erase([p.filename, p.get_node(“Sprite”).texture.resource_path ,p.expbar, p.lvl, p.surname ])

It worked completely fine, until I introduced save/load system. After loading translated wholeteam from JSON, it no longer is able to recognize/compare this content, even when console prints, that all elements being compared are truly identical… . Find() methods also don’t work.

I kept translation simple. Wholeteam is an array containing arrays of only 3 strings and 2 integers. I only deep duplicated it into JSON for save, and than, deep duplicated parse result back. All other elements of game requirring wholeteam array work just fine, so I don’t think anything was mistranslated upon loading.

Please help, I am trying to debug it for so long and it looks more and more absurd

:bust_in_silhouette: Reply From: Inces

Oh my god I have finally discovered it, sometimes You need to ask a question for some gears to move in your head :slight_smile:

Integers were translated into floats…

Yeah, I think this should be more clear in the documentation. I and others I know have had issues with this lol

andersmmg | 2021-02-14 02:36