Fractal Softworks Forum
April 18, 2019, 03:26:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Starsector 0.9a is out! (11/16/18); In-dev patch notes for 0.9.1a (01/31/19)
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Modding - Naming Format Control  (Read 4035 times)
Trylobot
Global Moderator
Admiral
*****
Posts: 1164



View Profile WWW
« on: July 05, 2011, 08:36:16 PM »

I think I suggested this somewhere else but it was under another thread, I decided to make it its own suggestion. I'd like more control over the ship strings. There's a couple different places where string data about the ship is composed for display, but each one is slightly different.

It would be fantastic if, for each of these instances, a mod could override the format for a given ship and display something else. Since certain formats are used in different places, there would really have to be several format strings and associated overrides.

Logged

Alex
Administrator
Admiral
*****
Posts: 13412


View Profile
« Reply #1 on: July 05, 2011, 11:34:54 PM »

Hmm. I do see what you're saying, that would be quite useful for some mods *cough* SC2 *cough*.

This is the kind of thing that would make mods incompatible with each other, though. That's not a problem - some mods will have to be marked as "total conversions" and preclude other TC mods from being used, or something like that - but that's not in place yet.

The other part of it is the naming format is rather haphazard at the moment.

I think it's a good idea to expose this, just don't want to hack something in - will take a closer look at it when re-organizing some of this stuff.
Logged
Trylobot
Global Moderator
Admiral
*****
Posts: 1164



View Profile WWW
« Reply #2 on: July 06, 2011, 12:09:53 AM »

This is the kind of thing that would make mods incompatible with each other, though.

Not exactly. Conflicts really are an issue, so the way I saw this working was in the form of Mission API overrides. For each ship you add to a fleet in the mission plugin code, you could optionally specify overrides for any of those strings. I think this way would be minimally intrusive and shouldn't conflict.
Logged

Alex
Administrator
Admiral
*****
Posts: 13412


View Profile
« Reply #3 on: July 06, 2011, 12:34:48 AM »

Ah, but the ships you add through a mod would be available elsewhere - for example, when picking ships for a custom battle. So it couldn't be specified in the mission API for that.

Hah, that raises an interesting point - technically, someone could refit the SC2 mod ships with other weapons, once the refit screen is in place. And they could try to fit SC2 weapons onto other ships. Will probably have to add flags to exclude ships from being refitted / weapons from being used to refit.

Nothing technically wrong with cross-equipping things from different mods, except for possibly wildly mismatched scales/visual style/etc.
Logged
Trylobot
Global Moderator
Admiral
*****
Posts: 1164



View Profile WWW
« Reply #4 on: February 29, 2012, 06:54:59 AM »

Reviving this thread; new idea on implementation.

You were worried that mods would conflict; here's how to allow them to co-exist. For each display format, however many you want there to be, define a system default for each one in the form of a C-style formatting string (token-matching). Every ship that does not explicitly override this would simply use the system default formatting strings for each format type.

However, whenever a ship is actually instantiated, have the ability to provide a configuration object defining overrides for the enumerated system default formats. That way, no memory is wasted unnecessarily (flyweight pattern), and every individual ship can have an interesting and unique name display if the ship is special. I could see this being used for mission flag ships and such, or even "alien" ships that within the fiction of the universe make no distinction of class or variant etc, making them seem even more alien.

And yes my motivation is still SC2
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2011, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!