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 ... 371 372 [373] 374 375 ... 706

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

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5580 on: November 03, 2019, 09:56:04 PM »

Oh duh I should have caught that. ;D

Thanks!
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5581 on: November 04, 2019, 02:55:53 AM »

Make sure the portrait is actually being loaded by the game, i.e. it's in a .faction file somewhere or in the "graphics" section of settings.json.

That was it. I didn't want the portrait to be selectable, so it wasn't in the faction files.
Putting it in settings.json did the trick
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5582 on: November 04, 2019, 03:29:04 AM »

Can animated turrets work if the base is animated, not the barrels?

I'm trying to make a vertical launch system missile tubes with animated hatches - I made it static by setting turn speed of 0, but it only works if it isn't animated. If it's animated, I keep getting errors about not being able to find 01.png.
The frames of the animations are all properly named and referenced (weapons/animated/vlms/vlms00.png)
Right now, all hatches open at once.

I don't know if anything can be added to simplify things? Right now, it doesn't seem to be possible to make a workable launcher like that without a lot of custom java code.
Also, there's a limit of 4 fire points ATM, right? So there's no point in making more than 4 launch tubes?
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5583 on: November 04, 2019, 04:31:47 AM »

Can animated turrets work if the base is animated, not the barrels?

I'm trying to make a vertical launch system missile tubes with animated hatches - I made it static by setting turn speed of 0, but it only works if it isn't animated. If it's animated, I keep getting errors about not being able to find 01.png.
The frames of the animations are all properly named and referenced (weapons/animated/vlms/vlms00.png)
Right now, all hatches open at once.

I don't know if anything can be added to simplify things? Right now, it doesn't seem to be possible to make a workable launcher like that without a lot of custom java code.
Also, there's a limit of 4 fire points ATM, right? So there's no point in making more than 4 launch tubes?
Have you considered just having invisible barrels?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5584 on: November 04, 2019, 09:17:24 AM »

Just a quick, although I think a deceptively difficult question: How would one prevent a ship from dropping supplies, fuel, heavy machinery and metals post-battle?

Short of replacing FleetEncounterContext, I don't think there's a way - it's based on the FP cost of the ship.


Have you considered just having invisible barrels?

Also, if you don't specify a barrel sprite, it's not going to render barrels at all...
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5585 on: November 04, 2019, 03:04:12 PM »

So my attempt to modify dmod impact with a hullmod just... doesn't seem to work?
Not sure what I'm doing wrong:
Code
extends BaseHullMod {

public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
stats.getDynamic().getStat(Stats.DMOD_EFFECT_MULT).modifyMult(id, 0.85f);
}

public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
stats.getDynamic().getStat(Stats.DMOD_EFFECT_MULT).unmodify(id);
}

EDIT: Also tried without the unapply line, still no change.

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5586 on: November 04, 2019, 03:08:15 PM »

So my attempt to modify dmod impact with a hullmod just... doesn't seem to work?
Apply and unapply, aren't those exclusive to ship systems? For hullmods you'd want applyEffectsBefore/AfterShipCreation and advanceInCombat
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5587 on: November 04, 2019, 03:12:40 PM »

Apply and unapply, aren't those exclusive to ship systems? For hullmods you'd want applyEffectsBefore/AfterShipCreation and advanceInCombat
No idea, they were in the Safety Procedures file, so I doubt it.
Which of the three would you suggest?

Edit: Tried both before and after, no dice.

Edit 2: I also realise now that even if it did work, it'd probably apply to the entire fleet, rather than the one ship :/

Edit 3: Ah, found out why it wasn't working. DMOD_EFFECT_MULT is a final variable, so can't be modified.

King Alfonzo

  • Admiral
  • *****
  • Posts: 679
  • -- D O C T O R --
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5588 on: November 04, 2019, 04:18:20 PM »

Just a quick, although I think a deceptively difficult question: How would one prevent a ship from dropping supplies, fuel, heavy machinery and metals post-battle?

Short of replacing FleetEncounterContext, I don't think there's a way - it's based on the FP cost of the ship.

Alright, thanks for that. I've tweaked the situation so after the battle and you salvage the station, you don't get basic commodities, just specials, with the junk representing the station.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5589 on: November 04, 2019, 04:58:56 PM »

So my attempt to modify dmod impact with a hullmod just... doesn't seem to work?
Apply and unapply, aren't those exclusive to ship systems? For hullmods you'd want applyEffectsBefore/AfterShipCreation and advanceInCombat

Correct. The apply/unapply methods would just never be called in this situation.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5590 on: November 04, 2019, 06:38:41 PM »

I'm missing something somewhere, because as far as I can tell this code should work?
Code
	public void applyEffectsBeforeShipCreation(MutableShipStatsAPI stats, ShipAPI ship, HullSize hullSize, String id, float level) {
if (ship.getVariant().hasHullMod("degraded_engines")) {
stats.getMaxSpeed().modifyMult(id, 1.15f);
stats.getAcceleration().modifyMult(id, 1.15f);
stats.getDeceleration().modifyMult(id, 1.15f);
stats.getTurnAcceleration().modifyMult(id, 1.15f);
stats.getMaxTurnRate().modifyMult(id, 1.15f);
stats.getSensorProfile().modifyMult(id, 0.85f);
}
Also tested with applyEffectsAfterShipCreation, to no avail.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5591 on: November 04, 2019, 06:49:23 PM »

Check your method signature carefully. The easiest thing to do is to look at the base class and copy from there. I'd also really suggest reading up on inheritance in Java so you can figure this out on a conceptual level - once you have that understanding, these kinds of problems won't come up nearly as often, and in the long (or, heck, probably short) run it'll save you time.
Logged

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5592 on: November 04, 2019, 07:22:47 PM »

Hmm... Is there a way around it then?
It seems I can only check the hullmods in applyAfter, but I can only apply the changes I want in applyBefore.

Possibly MutableShipStatsAPI stats = ship.getMutableStats(); in applyEffectsAfter?

Edit: Tested it, mixed results. The info box you get when you hover over the question mark doesn't change, but the brief info on the refit screen does.
Is there some way to get those displays to display correctly (of note, it also effects the "jumping to hyperspace will cost X fuel" message, and the sensor range and detection displays)?

Nia Tahl

  • Admiral
  • *****
  • Posts: 790
  • AI in disguise
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5593 on: November 04, 2019, 11:17:11 PM »

Is there any sort of shorthand method to render a visual copy of a ship like how addAfterimage does? Working on some custom afterimage visuals, but currently I'm just rendering the ship's sprite which looks fine mostly, but has some issues like obviously empty weapon mounts.

Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5594 on: November 05, 2019, 12:11:52 AM »

Can animated turrets work if the base is animated, not the barrels?

I'm trying to make a vertical launch system missile tubes with animated hatches - I made it static by setting turn speed of 0, but it only works if it isn't animated. If it's animated, I keep getting errors about not being able to find 01.png.
The frames of the animations are all properly named and referenced (weapons/animated/vlms/vlms00.png)
Right now, all hatches open at once.

I don't know if anything can be added to simplify things? Right now, it doesn't seem to be possible to make a workable launcher like that without a lot of custom java code.
Also, there's a limit of 4 fire points ATM, right? So there's no point in making more than 4 launch tubes?
Have you considered just having invisible barrels?

Already doing that. My weapon is basically 6 turret base images (vmls00 to vmls05), but the game just derps on load when I set it to be animated. Other animated weapons work normaly.
Logged
Pages: 1 ... 371 372 [373] 374 375 ... 706