A way to make a new script attribute in-game from a string?

Hi, I know all about setting up script attributes from the editor/code view, but is there a way to write/insert a string script into a new script attribute in-game?

The use-case for this is that I want to be able to convert the game.menucallback attribute to a string (for my SaveLoadCode library that I've posted about previously), then convert it back to a script to be assigned back to the game.menucallback attribute.


No; not possible.

Although it might be possible to search through all the game's script attributes to see if you can find one that matches.


Ah dang. Searching through all scripts for a match could work if the user is careful about having all their showmenu callbacks stored as modular script attributes, but I'd like to think on it a bit more to see if I can come up with a slightly more automated solution...

ShowMenu obviously has some mechanism to separate just the callback as it's own script and store it under game.menucallbackwhen the menu popup comes up, so perhaps I could see if there'd be some way to run through all instances of "ShowMenu" in the user's game on startup, extract all their callbacks, and store them as variables to be referenced later?

I might also spend a bit more time digging around in the Quest 5.8 source code and javascript files to see if there'd be some way to inject a string into the code as a script attribute... I know there's no official way to do it, but maybe there's some way I can trick the code into it (perhaps editting the code of a library file mid-game to include the script, then forcing the app to reload the library somehow?)

Even outside of my own use case, I could certainly see the utility in having such a feature as part of the baseline...


Yeah, a script evaluator would be useful. If you can code in C# it might be practical; you could probably wrap up an instance of the lexer in a new script command.


Log in to post a reply.

Support

Forums