Resource properties in 1.2.163

#23

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

#24

Yes of course.

0 Likes

#25

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.

0 Likes

#26

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

0 Likes

#27

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

#28

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

#29

Peeeeeerfect! :love_you_gesture:

Sorry, should’ve write it.

0 Likes

#30

Those are missing on the documentation of go.property

0 Likes

#31

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

2 Likes

#32

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:

0 Likes

#33

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

1 Like

#34

Thanks! :wink:

0 Likes

#35

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

#36

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.

0 Likes

#37

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

0 Likes

#38

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:.

0 Likes

#39

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.

0 Likes

Go.property resetting to default
#40

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

0 Likes

#41

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

#42

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