Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Mod improvements  (Read 2449 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Mod improvements
« on: September 20, 2012, 08:49:09 AM »

While working on the console mod, I had a few ideas for mod API improvements.

This first one isn't needed yet, but since a lot of mods are using spawn points for master control objects, I would like to see the possibility to register them with the sector as well as the star system. Doing so would call its advance() method regardless of what starsystem you are in.

I would also like to see a combat engine version of SpawnPointPlugin, and a way to register it with the game so campaign battles use it. This would allow us to customize the battle map and have in-battle events *cough* and allow me to make the console work in battles *cough*.

Finally, I had the idea for a few more tags for mod_info.json:
  • utilityMod - this mod doesn't modify any base game files, so it can be safely run alongside total conversions
  • requiresMods - an array of "id" tags of other mods that this one is reliant on (it can't be selected if they aren't present); loading of this mod is deferred until those mods are compiled
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: Mod improvements
« Reply #1 on: September 20, 2012, 01:00:58 PM »

While working on the console mod, I had a few ideas for mod API improvements.

This first one isn't needed yet, but since a lot of mods are using spawn points for master control objects, I would like to see the possibility to register them with the sector as well as the star system. Doing so would call its advance() method regardless of what starsystem you are in.

I would also like to see a combat engine version of SpawnPointPlugin, and a way to register it with the game so campaign battles use it. This would allow us to customize the battle map and have in-battle events *cough* and allow me to make the console work in battles *cough*.

Finally, I had the idea for a few more tags for mod_info.json:
  • utilityMod - this mod doesn't modify any base game files, so it can be safely run alongside total conversions
  • requiresMods - an array of "id" tags of other mods that this one is reliant on (it can't be selected if they aren't present); loading of this mod is deferred until those mods are compiled

Massive +1, it would seem you and other very talented modders could kick ass with these improvements!
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7233
  • Harpoon Affectionado
    • View Profile
Re: Mod improvements
« Reply #2 on: September 20, 2012, 02:12:09 PM »

I have no idea what the capabilities of using this method is, if it works at all, but for in battle scripts, I think we can inject code into the BattleObjectivesEffectsPluginImpl file. I have never played with it though so don't know how often the 'applyEffects()' method is called.

+1 for utilityMod and requiresMods
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: Mod improvements
« Reply #3 on: September 20, 2012, 06:38:24 PM »

I have no idea what the capabilities of using this method is, if it works at all, but for in battle scripts, I think we can inject code into the BattleObjectivesEffectsPluginImpl file. I have never played with it though so don't know how often the 'applyEffects()' method is called.

You are my new favorite person. It's not a perfect solution, but I think I can write my own keyboard handler and instantiate it in init(). I'll have to try it out some more, but this looks promising. :)

Although a quick test shows that you would be able to use the console on the main menu battle, too. That could be interesting...

Edit: it seems there's only one copy of the plugin which is instantiated when the game is loading (so no worries about key handler conflicts), and init() is called at the start of every battle (twice for refit battles, possibly a bug?). I just need a way to know when a battle is over, and this will be perfect. :)
« Last Edit: September 20, 2012, 07:06:28 PM by LazyWizard »
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7233
  • Harpoon Affectionado
    • View Profile
Re: Mod improvements
« Reply #4 on: September 20, 2012, 08:02:10 PM »

I'm glad to help - your console is a great mod!
Logged