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: Anubis-class Cruiser (12/20/24)

Author Topic: Fixing Dassault-Mikoyan Engineering mod to current version.  (Read 2157 times)

Atroxia

  • Ensign
  • *
  • Posts: 3
    • View Profile

I've been fixing up an old mod that I really enjoyed back in the day called Dassault-Mikoyan for personal use. I don't have a lot of programming experience but i've actually been learning really fast because of this. So far i've cracked down on a lot of bugs but this one stumps me.

The error i'm encountering occurs when you mouse over a custom hullmod. Instant crash. clearly due to a problem with adding text to the hullmods image.

Log shows this.
747663 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NoSuchMethodError: com.fs.starfarer.api.ui.TooltipMakerAPI.addImageWithText(F)V
java.lang.NoSuchMethodError: com.fs.starfarer.api.ui.TooltipMakerAPI.addImageWithText(F)V
   at data.hullmods.BladeBreakerDefense.addPostDescriptionSection(BladeBreakerDefense.java:53)
   at com.fs.starfarer.ui.impl.StandardTooltipV2$12.createImpl(Unknown Source)
   at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.create(Unknown Source)
   at com.fs.starfarer.ui.impl.StandardTooltipV2Expandable.beforeShown(Unknown Source)
   at com.fs.starfarer.ui.thissuper.showTooltip(Unknown Source)
Which adds up.

taking a look at the hullmod in question you can see that it imports this.

import com.fs.starfarer.api.ui.TooltipMakerAPI;

and further down where it adds the tooltip/description you have this.

public void addPostDescriptionSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec)
    {
        float pad = 10f;
        float padS = 2f;
        tooltip.addSectionHeading("Details", Alignment.MID, pad);
        TooltipMakerAPI text = tooltip.beginImageWithText("graphics/ISTL/icons/tooltip/istl_hullmod_defense.png", 40);
            text.addPara("- " + getString("BBDefenseDesc1"), pad, Misc.getHighlightColor(), "20%");
            text.addPara("- " + getString("BBDefenseDesc2"), padS, Misc.getHighlightColor(), "20%");
            text.addPara("- " + getString("BBDefenseDesc3"), padS, Misc.getHighlightColor(), "100%");
        tooltip.addImageWithText(pad);
        TooltipMakerAPI text2 = tooltip.beginImageWithText("graphics/ISTL/icons/tooltip/istl_hullmod_fighter.png", 40);
            text2.addPara("- " + getString("BBDefenseDescFtr"), padS, Misc.getHighlightColor(), "20%");
        tooltip.addImageWithText(pad);
    }

removing it doesn't help obviously because with no description at all it'll still crash.
I've tried looking at other mods and it seems they're using a different method to show descriptions now
except Diable Avionics does seem to use a method almost exactly the same as this in a couple of hullmods and those do not have the same issue.
So far I've tried to copy the other method but keep coming into roadblocks due to my lack of experience, i will undoubtedly crack it eventually but i was curious if someone more experienced here has a more expedient answer that'll save me some headbanging.

Anyways if you can't help i get it, ill just keep at it.


Logged

DownTheDrain

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #1 on: June 17, 2024, 10:00:02 PM »

There already is at least one unofficial updated version for DME, which I've been running without any notable issues for some time now.
Obviously I wouldn't link to it here but you can just google it. Unless this is a passion project or you're in it for the learning experience, in which case I haven't got a clue what to do.
Logged

Atroxia

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #2 on: June 17, 2024, 10:02:52 PM »

omg are you serious, ive been doing this for weeks ahahahah
Logged

DownTheDrain

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #3 on: June 17, 2024, 10:25:03 PM »

Heh, at least you got some coding experience out of it.
But yeah, first thing I do whenever I return to Starsector is googling for mods that I enjoyed in the past and that don't seem to be around anymore.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 563
  • Seals :^)
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #4 on: June 18, 2024, 05:29:19 AM »

you'll need to recompile the mod from it's source code, the game changed a tiny thing about that method and for the old version technically stopped existing (despite the syntax remaining identical), causing a crash when the old one is called on

the wiki has a guide for setting up a java IDE & compiling code here https://starsector.wiki.gg/wiki/IntelliJ_IDEA_Setup

CMP01

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #5 on: September 25, 2024, 05:43:20 PM »

Heh, at least you got some coding experience out of it.
But yeah, first thing I do whenever I return to Starsector is googling for mods that I enjoyed in the past and that don't seem to be around anymore.

My current issue right there. Been gone a couple of years but just prepping to get back into the game ahead of a lot of free time over winter, relearn a few things, get the old mods back etc...
... and haven't been able to find DME nor mention of them anywhere... and had no idea why until now.
So this is hopeful, that somebody is keen on that and trying to make it work. I'd offer to help, really, cos I really liked the faction etc... but coding for me is something actual smart ppl do (honestly, it's enough that I can keep my PC working)

Anyway, best of luck and I'll keep an eye out for any news etc.

PS: Having found Anarakis in the mod list, some newer ones that look good and many of the other mods, the other major faction mod I'm missing rn is Magellan Protectorate... if anybody knows what's up or where (if) I can find it, much appreciated.
Logged

Versil

  • Ensign
  • *
  • Posts: 37
    • View Profile
Re: Fixing Dassault-Mikoyan Engineering mod to current version.
« Reply #6 on: September 25, 2024, 11:29:41 PM »

check pm
« Last Edit: September 25, 2024, 11:33:06 PM by Versil »
Logged