Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash script property doesn't get reversed #7422

Open
JustAPotota opened this issue Feb 25, 2023 · 1 comment
Open

Hash script property doesn't get reversed #7422

JustAPotota opened this issue Feb 25, 2023 · 1 comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor engine Issues related to the Defold engine

Comments

@JustAPotota
Copy link
Contributor

Describe the bug (REQUIRED)
Trying to print a hash script property displays hash: [XXXX (unknown)], even in debug builds.

Expected behavior (REQUIRED)
It should print the original value that was hashed.

To Reproduce (REQUIRED)
Steps to reproduce the behavior:

  1. Create a script property like go.property("my_hash", hash("test"))
  2. Try to print it

Defold version (REQUIRED):

  • 1.4.2

Platforms (REQUIRED):

  • Pop!_OS 22.04 LTS

Minimal repro case (OPTIONAL):

go.property("my_hash", hash("test"))

function init(self)
    print(self.my_hash) --> "hash: [12722210162474435462 (unknown)]"
end

Workaround (OPTIONAL):
Calling hash() with the same value at any point before printing the property will make it display the correct value:

go.property("my_hash", hash("test"))

function init(self)
    print(self.my_hash) --> "hash: [12722210162474435462 (unknown)]"
    hash("test")
    print(self.my_hash) --> "hash: [test]"
end
@JustAPotota JustAPotota added the bug Something is not working as expected label Feb 25, 2023
@britzl britzl added the engine Issues related to the Defold engine label Feb 27, 2023
@AGulev
Copy link
Contributor

AGulev commented Feb 16, 2024

I think our Lua parser for go.property("key", hash("value")) can keep hash("value") in Lua file for debug builds to be able to see string value

@AGulev AGulev added the editor Issues related to the Defold editor label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected editor Issues related to the Defold editor engine Issues related to the Defold engine
Projects
None yet
Development

No branches or pull requests

3 participants