Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 54 55 [56] 57 58 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1699683 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #825 on: September 19, 2013, 12:07:49 PM »

The game is instantiating it using reflection in a way that requires the class to have a zero-arg constructor. I don't think it's necessary to have one unless you also have a non-0-arg one, though.
Logged

Dayshine

  • Ensign
  • *
  • Posts: 28
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #826 on: September 19, 2013, 04:08:11 PM »

Interesting...

Something completely different, I've been looking through this post and rest of the forum and haven't found much mention of it.

Is there a way to get control of a few simple ui elements in the battle engine? I'm trying to see how feasible it would be to make the framework for a debug overlay; to show things like AI state, missile fuel time, projectile range and whatever else would be useful.

I've found addFloatingText(...) however without any call to the textbox I can't modify it nor remove it. This means I can only create text every few seconds or end up with a wonderful mess of a few hundred text pieces on top of each other :P. I guess potentially it could be hacked in using sprites, but I can't see a reliable way of doing that.

It's obviously a low priority feature, but it would allow for some more interesting battle engine mods and all it needs is rudimentary text and maybe lines/boxes.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #827 on: September 19, 2013, 05:10:01 PM »

Not possible at the moment, no. Sorry! I understand how it'd be very useful, but like you said, it's low priority, and also happens to be a good bit of work. Not a great combination for something actually getting done.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #828 on: September 20, 2013, 06:57:58 AM »

Is this possible now?

Code: java
    public List<ShipAPI> getAllShips()
    {
        if(this.FleetID != null)
        {
            ListIterator Fleetships = FleetID.getFleetData().getMembersListCopy().listIterator();
            while(Fleetships.hasNext())
            {
                FleetMemberAPI fmember = (FleetMemberAPI)Fleetships.next();
                ShipAPI ship = (ShipAPI) fmember; //most methods are exactly the same as the ShipAPI, so a cast should be enough.
                FleetShips.add(ship);
            }
            return this.FleetShips;
        }
        else
        {
            return null;
        }
    }
« Last Edit: October 02, 2013, 07:20:13 AM by silentstormpt »
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #829 on: September 20, 2013, 09:11:03 AM »

When I add a "builtInMods":["tow_cable"], to one of my ships, it crashes the game on startup.
The Ox seems to have one though.

Has another modder created a tug-type ship yet? Did this go well for you? :S
Logged
  

Dayshine

  • Ensign
  • *
  • Posts: 28
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #830 on: September 20, 2013, 11:25:50 AM »

When I add a "builtInMods":["tow_cable"], to one of my ships, it crashes the game on startup.
The Ox seems to have one though.

Has another modder created a tug-type ship yet? Did this go well for you? :S

I just modded ms_seski.ship (from shadowyards) to have a tow cable and it works fine. Just changed last two lines to:

Spoiler
Code
"width": 54,
  "builtInMods":["tow_cable"],
}
[close]

Although that final comma is unnecessary, the Ox has it :P.

What's the error?
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #831 on: September 20, 2013, 11:40:55 AM »

@Dayshine: You helped me when I read your 'final comma'. I didn't place a comma on the previous line.
Going to hit myself now. ::)
Logged
  

Dayshine

  • Ensign
  • *
  • Posts: 28
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #832 on: September 20, 2013, 11:44:15 AM »

@Dayshine: You helped me when I read your 'final comma'. I didn't place a comma on the previous line.
Going to hit myself now. ::)

When I was testing it I did think to myself "I bet he's just missed that comma" :P
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #833 on: September 20, 2013, 12:04:02 PM »

You barely even know me and you know me better than I know myself. :o
Logged
  

Dayshine

  • Ensign
  • *
  • Posts: 28
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #834 on: September 20, 2013, 05:23:20 PM »

A question about CombatEngine again. I would like to add various graphical effects to the map. Simple example: A wormhole. Is there any way to place images or trigger weapon effects easily?

My current plan is to try and use ships, but I can't find a way to spawn ships other than via the FleetManager. I could arguably sneak some extra ships into the enemy fleet and then rewrite the victory conditions but it seems a bit heavy-handed and requires a custom BattleCreationPlugin

The other method would be to use asteroids and change their image, but that would interfere with standard asteroid belts so require replacing the BattleCreationPlugin too.

Basically, is there a way to spawn a CombatEntity in battle?
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #835 on: September 20, 2013, 10:44:38 PM »

Is there a way to extend the character generation, i.e. to add a dialog option for a new starting ship, without overwriting the whole file?
« Last Edit: September 20, 2013, 10:50:08 PM by Vayra »
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Darloth

  • Admiral
  • *****
  • Posts: 592
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #836 on: September 21, 2013, 06:03:19 AM »

As far as I can tell, no...

But, you COULD write a mod that overwrites it and then loads files to specify what should go there instead.

and THAT mod could then be included in every mod that wants to change char-creation that isn't a total conversion (with that mod's specific files) - as a result, when a user downloaded and unpacked it, the config files would all go into the same directory, and (assuming the char-cre mod version was the same) all would be well, it would just cope with it fine.

Presumably the vanilla set of options would be the first config file, just distributed with the mod to start with, and then people would steadily add their own from their own mods.
Logged

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #837 on: September 21, 2013, 09:48:10 AM »

Is their an easy way to just straight up copy a ship? Turns out just taking the ships from a station's cargo is a bad idea, and all kinds of weird things happen (They all seem to be treated as the same ship across all fleets, from what I can tell. So if something happens to one, it happens to all of them.)

So what I did was create completely new ships from the Global.getFactory() thing and copy the variant. This works for ships that already have variants, but not the "custom" variant. That's just a blank hull, even if it's edited.

So I'm trying to do some other fancy things to directly copy the variant, but it seems like a lot of trouble and I'd hate for their to be an easier way.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #838 on: September 21, 2013, 02:52:33 PM »

@Dayshine: not right now. This part of the game isn't exactly very flexible atm, modding-wise.

@Verrius: How about using ShipVariantAPI.clone() to make a copy of the variant, and then using FleetMemberAPI.setVariant() on the Factory-created FleetMemberAPI?
Logged

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #839 on: September 21, 2013, 03:08:16 PM »

Funny thing, I tried that and it didn't work the first time. I remember being really irritated about myself and figuring it just didn't do what I thought I did.

Turns out I must have done something wrong, now everything looks fine :p. Thanks for the reply.
Pages: 1 ... 54 55 [56] 57 58 ... 706