Robosturm / Commander_Wars

The aim of this project is to create an Advance Wars Clone with a lot of additions customizations and modding support. For Contact Inforamtion see the wiki page. Take a view on the game.
https://github.com/Robosturm/Commander_Wars/releases
GNU Lesser General Public License v3.0
213 stars 33 forks source link

Feature request: Javascript reload function (For the command line in the game) #1800

Closed lonewolf19991 closed 3 months ago

lonewolf19991 commented 3 months ago

Is your feature request related to a problem? Please describe. Currently, to reload changes made to a mod one needs to reload the entire game. I was told that in the past it was possible to have the currently loaded mod files be reloaded without any need to restart the game. Perhaps this could be done through a command.

Describe the solution you'd like A command that lets one reload the current js files created by the user.

Describe alternatives you've considered Some have suggested, manually copying the script file and then making the game load that, from the terminal, but this becomes difficult when a mod contains more than one file.

Robosturm commented 3 months ago

Adding a comnand is easy but it will have the following drawbacks. Replays get messed up when the command is used. The script must have been loaded successfully once else the registration in the internal databases for units cos etc misses the entry and the hook can't be easily generic added later.