Resource properties in 1.2.163

Correct me if I’m wrong, but shouldn’t the hashes both say: 1eb61acc7a8ca622bedb5bf862ddbf44bfb95727? (Same as linked in first post.)

Did you accidentally update the editor?

2 Likes

Yes of course.

Well, I updated it intentionally. Since the original link was posted five days ago, I thought it was a good idea. Looks like it’s not.

However, original version from link in first post, don’t work either.

Could you tap report this error using “report” button (then we would have stack trace), please? Would be awesome if you can add a repo-case project to this ticket. Thank you for the report.

1 Like

The feature will be released on Monday on our stable branch. If you updated the editor you might run the risk of getting a version that isn’t compatible with the feature.

1 Like

Peeeeeerfect! :love_you_gesture:

Sorry, should’ve write it.

Those are missing on the documentation of go.property

Thanks! I will make sure this gets updated in the release next week.

2 Likes

I can’t find any documentation on this, it works of course, but there is nothing more than in this thread and what I figured out myself :confused:

There’s a section here: https://defold.com/manuals/script-properties/#resource-properties

1 Like

Thanks! :wink:

It would be awesome to have a possibility to set resource.texture() as the GUI component texture.
I see a lot of places I can use it for more dynamic GUI creation.

2 Likes

For the second time in a day, my atlas resource property is reset to blank. It’s strange. Does anyone have this?

Also it would be nice to output something like ‘the resource was not found’ instead of an error code -10.

Sometimes I have properties reset when working in VSCode. Do you use external editor?

Yes, I use VSCode too.

And it looks like this can happen with any property changed, not only resources. I remember that the integers were also reset. This is not so safe :cry:.

Yeah, somehow VSCode conflicts with Defold, usually when there is a runtime error or some other out of ordinary situation. Most of my code was in Lua modules, so I rarely encountered this issue.

Hi all,

Is it possible to change the value of a resource property other than in go.property()? I am trying to change the texture associated with a model component. The model component is associated with a factory created game object, which ideally would have a script that dynamically changes the model texture based on external information.

According to the documentation, I cannot change the texture associated with a defined resource property using “resource.texture()” in go.set(), so is there any other way or is this simply a feature not implemented within defold?

Thanks for any information you can provide.

Regards,

Augustino

Could you have multiple go.property() definitions? One per texture that can be set on the model. And at run-time you select the go.property() that matches the external info you mentioned.

1 Like

Thank you for your reply. I could do that yes, and at first it would be fine (around 20 textures). But additional texture variants (color packs) would increase this number substantially (potentially in the hundreds). Having 100+ lines repeating the same statement but with a different texture string seems very inefficient but I’m sure there is a back end reason why you cant just easily change the value just like any other property. I guess I can try it this way while the number of textures is relatively small, and deal with the increasing textures later.

1 Like