Author Topic: Fleet templates  (Read 932 times)

Yulgalminakf

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Fleet templates
« on: June 25, 2015, 04:58:58 PM »
So, I have an idea: create fleet templates. This would allow you to create a flagship with a certain set of support ships and store it for later use. You can then use this fleet template to order the flagship and auto-construct the support ships for it. Anyone got any pointers as to where to start?

-I'd like for this to be savable and loadable on the disk. I think that's the major roadblock I'm gonna hit, because I have no idea how to do that. I see the class called Savable, but I don't know how to use it.

-GUI needs to be created for it, but I don't think that'd be much of a problem, I just need to figure out the gui system a little bit.

-Adding the fleet template to the build list would be nice too.

-Need to order support ships for a flagship.

-Need to order a construction.

Any help would be appreciated, please and thank you. :)
« Last Edit: June 25, 2015, 05:15:14 PM by Yulgalminakf »

dalolorn

  • Sentient
  • **
  • Posts: 199
  • Karma: +7/-0
  • ABEM Developer
    • View Profile
Re: Fleet templates
« Reply #1 on: June 26, 2015, 05:23:51 AM »
1. I think you'd actually need to work with JSON here. An example of this is in design_exporter.as or whatever it's called, which exports your designs.

2. If you figure out how to make a decent GUI, you'll be the first one to do so. All of my fiddling with those scripts for ABEM has been simple copy-pasting of simple elements - nothing as complex as what you seem to want to do. :P

3. If you can figure out the GUI side of the matter, I'd say it'd be easy to tackle the underlying code that lets the template get added to the list.

4 and 5. Uhhh?

Yulgalminakf

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Fleet templates
« Reply #2 on: June 27, 2015, 08:51:08 PM »
I've looked deeper into it and there's a problem. The actual saving/loading to the disk is easy enough to figure out with the JSON class and the examples I have available, but I can't figure out how to load in my own constructible type.

In Construction.as, in class ConstructionDisplay, it has lists for all the constructible items for the empire, however, it only loads them from the empire. The actual empire class is abstracted away from mod developers to use, so I have no idea where nor how it's loading the constructible types, nor how to add my own.
« Last Edit: June 27, 2015, 09:36:29 PM by Yulgalminakf »

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Fleet templates
« Reply #3 on: June 28, 2015, 03:59:02 AM »
Designs are defined in the engine, but construction goes through functions declared in data/components/construction.txt and implemented in server/construction/Construction.as and shadow/construction/Construction.as. Generally if you want to add data into an empire, you would end up putting it in a component, and then accessing it through functions declared in one.

dalolorn

  • Sentient
  • **
  • Posts: 199
  • Karma: +7/-0
  • ABEM Developer
    • View Profile
Re: Fleet templates
« Reply #4 on: June 28, 2015, 04:38:42 AM »
The empire class is not entirely abstracted away. There's a nice bit of data in data/empire_states.txt. (Mind you, Lucas' variant of adding data tends to be the better one.)