Jump to content

Basic Modding


Quantumphysguy
 Share

Recommended Posts

I have an idea for a mod for the game but not sure if I am using the correct terminology. I want to create an auto-save feature, that will save the game lets say every 5 minutes. Is that a mod? If so, how would I get started doing that? All the modding guides I have read are for creates units.

If this isn't the correct route - what path should I go to implement this?

Link to comment
Share on other sites

You should be able to do that in a mod, as a mod can edit any GUI files, and can also call GUI-exposed functions. Thus call the saving function.

But I think it would be better to have this feature directly in the main game (as an option) than in a mod. You will have to touch files that aren't optimised for modding, which means you'll have to copy a lot of code to your new mod (code that you will need to maintain as the game evolves).

If you want to implement this, start in the GUI files that handle the saving of games, see what functions they use, and try to call them from a timer in the GUI somewhere.

  • Like 4
Link to comment
Share on other sites

5 hours ago, Quantumphysguy said:

Can you point me to where those files are?

Gui layout/scripts are here: gui
During the game session the 'session' 'page' is active: gui/session (you may be in particular interested in 'session.js' there).
Save dialog logic is here: gui/savedgames/save.js , Engine.SaveGame call is saving the file on the engine side.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...