plbrault / youre-the-os

A game where you are a computer's OS and you have to manage processes, memory and I/O events.
https://plbrault.github.io/youre-the-os/
GNU General Public License v3.0
1.82k stars 72 forks source link

Scripting support [EDIT: in the browser] #142

Closed Jak2k closed 6 months ago

plbrault commented 6 months ago

Scripting support is already implemented, as indicated in the README.

Jak2k commented 6 months ago

Yes, scripting support is available when downloading, but not in the browser.

plbrault commented 6 months ago

Yes, scripting support is available when downloading, but not in the browser.

This seems acceptable to me, as people who are interested in scripting are likely to know how to clone the repository and run the game locally. Plus, I have a hard time imagining how that would work in the browser. Would we have to select our script file from a dialog in the game? How would debugging work? Would we have to re-upload the script after every change? Is it even possible to open a local file from a Python program compiled to WebAssembly and running inside a browser? Please provide more details on the implementation you have in mind.

Jak2k commented 6 months ago

Maybe let users script using JS, that calls the functions, which would be called by user interaction.

plbrault commented 6 months ago

I am not sure how I would go and implement a way to interact with the Python code from JavaScript, nor how it would solve the other problems. I am closing the issue again for now as I will not implement this. If you submit a pull request, I will look at it.