samedicorp / dualuniverse-feedback

Dual Universe Suggestions and Bugs
0 stars 0 forks source link

Allow editing of lua scripts in an external editor #6

Open samdeane opened 3 years ago

samdeane commented 3 years ago

When the user encounters a controller (non-protected) lua script, it should be cached on disk, using a single-file layout (as described in issue #5).

The file should be named in a predictable way (using the unique identifier of the controller to name the file).

The game should monitor this script file and use its contents whenever the corresponding controller is launched.

This would allow script authors to edit their scripts using an external editor such as VS Code, with all the advantages that would bring (auto-completion, syntax colouring, linting, search & replace, etc).

As this is a feature primarily aimed at script authors, it could be enabled/disabled with a client setting, to avoid affecting performance for non-author users.

samdeane commented 3 years ago

Currently the way I achieve this is to require a script in the unit start handler, make a single controller object from that script, and then have all the other event handlers just be stubs that call into it.

This works ok during development, but is more work than it ought to be.

samdeane commented 3 years ago

https://support.dualthegame.com/hc/en-us/requests/34008