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

access instances by UID in expressions: sprite[UID].x #365

Open
2 tasks done
F3der1co opened this issue Sep 19, 2024 · 1 comment
Open
2 tasks done

access instances by UID in expressions: sprite[UID].x #365

F3der1co opened this issue Sep 19, 2024 · 1 comment

Comments

@F3der1co
Copy link

F3der1co commented Sep 19, 2024

Reviewed guidelines

  • I have read and understand the suggestion guidelines

Checked for duplicate suggestions

  • I checked for existing similar suggestions

Summary

similar to sprite(iid).x it would be amazing to have the same functionality for uid.

Possible workarounds or alternatives

writing return functions for the specific properties you want to access by uid or using addons like UID TO ANYTHING by Overboy

Proposed solution

Same as objectType(iid).whatever but using uid.
To differenciate between the two it would use square brackets objectType[uid].whatever

Why is this idea important?

While the picking system is often very helpful, it sometimes makes certain logic extremely complicated. Accessing instances in expressions by their uid would allow a great amount of flexibility!

Additional remarks

No response

@F3der1co F3der1co changed the title acces instances by uid in expressions: sprite[UID].x access instances by UID in expressions: sprite[UID].x Sep 19, 2024
@F3der1co
Copy link
Author

F3der1co commented Sep 20, 2024

Scirra/Construct-bugs#7028
This was brought to my attention, so maybe a different syntax can be used. For example sprite(uid: 123).x. I don't know how the c3 expression lexer works, so I can just guess what would be feasible to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant