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 ... 590 591 [592] 593 594 ... 706

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8865 on: June 26, 2022, 06:59:05 AM »

I'm not so much worried about the index number, more interested if there is a way to return two StatusData items.

Yes, add another index number.

Code: java

      if (index == 0)
      {
         return new StatusData("ballistic rate of fire +" + (int) bonusPercent + "%", false);
      }
      if (index == 1)
      {
         return new StatusData("ballistic flux use -" + (int) FLUX_REDUCTION + "%", false);
      }
      if (index == 2)
      {
         return new StatusData("increased engine power", false);
      }
Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8866 on: June 26, 2022, 10:55:46 PM »

Does anyone know why these two don't seem to spawn in the allocated market's comms board?

Spoiler
        PersonAPI TTambassador = Global.getFactory().createPerson();
        TTambassador.setId("TTambassador");
        TTambassador.setGender(FullName.Gender.MALE);
        TTambassador.getName().setFirst("Tim");
        TTambassador.getName().setLast("test");
        TTambassador.setPostId("TTambassadorpost");
        TTambassador.setRankId("TTambassadorrank");
        TTambassador.setImportance(PersonImportance.HIGH);
        TTambassador.setVoice(Voices.OFFICIAL);
        TTambassador.addTag(Tags.CONTACT_UNDERWORLD);
        TTambassador.addTag(Tags.CONTACT_TRADE);
        ip.addPerson(TTambassador);

        PersonAPI PLambassador = Global.getFactory().createPerson();
        PLambassador.setId("PLambassador");
        PLambassador.setGender(FullName.Gender.MALE);
        PLambassador.getName().setFirst("Bill");
        PLambassador.getName().setLast("Silvergale");
        PLambassador.setPostId("PLambassadorpost");
        PLambassador.setRankId("PLambassadorrank");
        PLambassador.setImportance(PersonImportance.HIGH);
        PLambassador.setVoice(Voices.OFFICIAL);
        PLambassador.addTag(Tags.CONTACT_MILITARY);
        PLambassador.addTag(Tags.CONTACT_TRADE);
        ip.addPerson(PLambassador);

        MarketAPI market = Global.getSector().getEconomy().getMarket("ryzan_supercomplex");
        if (market != null && "sindrian_diktat".equals(market.getFactionId())) {
            market.getCommDirectory().addPerson(TTambassador, 1);
            market.addPerson(TTambassador);
            market.getCommDirectory().addPerson(PLambassador, 2);
            market.addPerson(PLambassador);
        }
[close]

I checked with other NPC code and there doesn't seem to be anything wrong so I have no idea what's up at this point.

Also for reference I don't believe it's the unique IDs that are causing it since I already defined them in the mod.
« Last Edit: June 26, 2022, 11:11:45 PM by JAL28 »
Logged

AccuracyThruVolume

  • Commander
  • ***
  • Posts: 133
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8867 on: June 27, 2022, 06:37:59 AM »

I'm not so much worried about the index number, more interested if there is a way to return two StatusData items.

Yes, add another index number.

Code: java

      if (index == 0)
      {
         return new StatusData("ballistic rate of fire +" + (int) bonusPercent + "%", false);
      }
      if (index == 1)
      {
         return new StatusData("ballistic flux use -" + (int) FLUX_REDUCTION + "%", false);
      }
      if (index == 2)
      {
         return new StatusData("increased engine power", false);
      }


This worked splendidly.   Appreciate the solution!   
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8868 on: June 27, 2022, 09:38:30 AM »

Does anyone know why these two don't seem to spawn in the allocated market's comms board?

Spoiler
        PersonAPI TTambassador = Global.getFactory().createPerson();
        TTambassador.setId("TTambassador");
        TTambassador.setGender(FullName.Gender.MALE);
        TTambassador.getName().setFirst("Tim");
        TTambassador.getName().setLast("test");
        TTambassador.setPostId("TTambassadorpost");
        TTambassador.setRankId("TTambassadorrank");
        TTambassador.setImportance(PersonImportance.HIGH);
        TTambassador.setVoice(Voices.OFFICIAL);
        TTambassador.addTag(Tags.CONTACT_UNDERWORLD);
        TTambassador.addTag(Tags.CONTACT_TRADE);
        ip.addPerson(TTambassador);

        PersonAPI PLambassador = Global.getFactory().createPerson();
        PLambassador.setId("PLambassador");
        PLambassador.setGender(FullName.Gender.MALE);
        PLambassador.getName().setFirst("Bill");
        PLambassador.getName().setLast("Silvergale");
        PLambassador.setPostId("PLambassadorpost");
        PLambassador.setRankId("PLambassadorrank");
        PLambassador.setImportance(PersonImportance.HIGH);
        PLambassador.setVoice(Voices.OFFICIAL);
        PLambassador.addTag(Tags.CONTACT_MILITARY);
        PLambassador.addTag(Tags.CONTACT_TRADE);
        ip.addPerson(PLambassador);

        MarketAPI market = Global.getSector().getEconomy().getMarket("ryzan_supercomplex");
        if (market != null && "sindrian_diktat".equals(market.getFactionId())) {
            market.getCommDirectory().addPerson(TTambassador, 1);
            market.addPerson(TTambassador);
            market.getCommDirectory().addPerson(PLambassador, 2);
            market.addPerson(PLambassador);
        }
[close]

I checked with other NPC code and there doesn't seem to be anything wrong so I have no idea what's up at this point.

Also for reference I don't believe it's the unique IDs that are causing it since I already defined them in the mod.

Hmm - possibly if the entry is hidden via CommDirectoryEntryAPI.setHidden(true)?

You might try running some code - after adding the entries - to list out the entries and confirm that the one you want is actually present, etc.
Logged

Wispborne

  • Captain
  • ****
  • Posts: 400
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8869 on: June 27, 2022, 08:17:17 PM »

Do we have a way to italicize only part of a paragraph in a TextPanelAPI/TooltipMakerAPI/LabelAPI?

I found the ways to change text color within a para, and to italicize a whole para, but haven't managed to find a way for just a few words.
Logged
Mod: Persean Chronicles | Mod Manager: SMOL | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

esciron

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8870 on: June 28, 2022, 06:53:22 AM »

Hi, I want to make a little personal mod. I have no Idea on what's the best way to do this (if there's a way) My goal is to make ships tougher/more durable and capital ships less relevant.

1- I want to add  additional armor, hull, ordinance points and reduce the speed of all ships (including  ships from mods), all of this fixed by a percentage of the ships values. The only way I can think of doing
this is by making a hullmod, but I don't know if there's a way to add that hullmod to every single ship that spawn in the game (including bounties etc).

2- Make capital ships way scarcer and make it so only one capital ship can be deployed at the same time in a battle (1 for each "team" involved) I really don't know how could I do this.

My modding skills are very limited i've only made a couple of hullmods and ships.
I would appreciate any help.
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8871 on: June 28, 2022, 10:49:59 AM »

I have two questions:

1. How I make the name of a system be visible on the map, or not? (I want it  to start the game hidden, and later reveal it after a quest)
2. I saw lots of code floating around about how to delete hyper-nebula on top of your system, but what if I want to ADD hyper nebula on top of  system? (I want it to be actually hard to see)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8872 on: June 28, 2022, 03:18:04 PM »

Do we have a way to italicize only part of a paragraph in a TextPanelAPI/TooltipMakerAPI/LabelAPI?

I found the ways to change text color within a para, and to italicize a whole para, but haven't managed to find a way for just a few words.

There's no way to do that, no. (Obivously technically doable! But enough of a pain that it's not something I'd want to get into barring a compelling need for it in vanilla.)


Hi, I want to make a little personal mod. I have no Idea on what's the best way to do this (if there's a way) My goal is to make ships tougher/more durable and capital ships less relevant.

1- I want to add  additional armor, hull, ordinance points and reduce the speed of all ships (including  ships from mods), all of this fixed by a percentage of the ships values. The only way I can think of doing
this is by making a hullmod, but I don't know if there's a way to add that hullmod to every single ship that spawn in the game (including bounties etc).

Hi! You might achieve this by creating a "hidden" hullmod and then adding it to all ShipHullSpecAPIs (Global.getSettings().getAllShipHullSpecs) in your ModPlugin.onApplicationLoad() method.

2- Make capital ships way scarcer and make it so only one capital ship can be deployed at the same time in a battle (1 for each "team" involved) I really don't know how could I do this.

Hmm, not sure how you'd do this - there's no code to limit deployment by ship type, just by deployment points.


1. How I make the name of a system be visible on the map, or not? (I want it  to start the game hidden, and later reveal it after a quest)

Offhand, I don't know; nothing comes to mind. Hiding star systems isn't really a thing in vanilla. The Lights Out mod does something along these lines, though, but it doesn't hide just the name; you might want to look at how it does things.

2. I saw lots of code floating around about how to delete hyper-nebula on top of your system, but what if I want to ADD hyper nebula on top of  system? (I want it to be actually hard to see)

Take a look at the NebulaEditor class - that, and where/how it's used, should hopefully point you in the right direction. IIRC tile values from 0 to 15 inclusive are the different tiles.
Logged

Brainwright

  • Admiral
  • *****
  • Posts: 595
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8873 on: June 28, 2022, 08:59:09 PM »

I'm using quite a lot of mods, and some of them have custom mods with special conditions as for what ship types and mods they can work with.

Thing is, they don't show up on the mod screen.  I can add them manually by modifying the campaign file, and they work fantastically.  Ships spawn with the mods, too.

I just can't add them from the refit screen because they don't show.  Is there some procedure I can use to make sure they show up?
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8874 on: June 28, 2022, 09:26:44 PM »

You probably need to select their filter tag. Like LoA's hullmods will be under ARS or Reparations Society.
Logged

Brainwright

  • Admiral
  • *****
  • Posts: 595
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8875 on: June 28, 2022, 09:30:23 PM »

You probably need to select their filter tag. Like LoA's hullmods will be under ARS or Reparations Society.

Yep, that did it.  Just started mods a couple of months ago, never noticed that.  :P
Logged

esciron

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8876 on: June 29, 2022, 09:13:39 AM »

Hi, I want to make a little personal mod. I have no Idea on what's the best way to do this (if there's a way) My goal is to make ships tougher/more durable and capital ships less relevant.

1- I want to add  additional armor, hull, ordinance points and reduce the speed of all ships (including  ships from mods), all of this fixed by a percentage of the ships values. The only way I can think of doing
this is by making a hullmod, but I don't know if there's a way to add that hullmod to every single ship that spawn in the game (including bounties etc).

Hi! You might achieve this by creating a "hidden" hullmod and then adding it to all ShipHullSpecAPIs (Global.getSettings().getAllShipHullSpecs) in your ModPlugin.onApplicationLoad() method.

2- Make capital ships way scarcer and make it so only one capital ship can be deployed at the same time in a battle (1 for each "team" involved) I really don't know how could I do this.

Hmm, not sure how you'd do this - there's no code to limit deployment by ship type, just by deployment points.

Thank you!
I was able to do the first point, hullmod for the armor and hull but I can't find a way to modify the ordnance points as the only related thing I can find it's in "MutableCharacterStatsAPI".

For the second point a good solution could be multiplying the capital ships deployment points so you wouldn't be able to deploy many capitals but i'm unable to find a way to do it, i've tried to do getSuppliesPerMonth() and getSuppliesToRecover() with a.modifyPercent() in the hullmod but it doesn't change the ships deployment points. Any ideas?

EDIT: I've found a way with getSuppliesToRecover and setSuppliesToRecover in the hullmod plugin (ShipHullSpecAPI). But now I need a way to limit this to capital ships only, is this possible?
EDIT 2: Finally figure it out, it was way simpler than what I was thinking.
« Last Edit: June 29, 2022, 11:28:00 AM by esciron »
Logged

ez

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8877 on: June 29, 2022, 10:37:05 AM »

Hi folks,

This Q is maybe too meta for this thread, so apologies. I made a small mod for myself that I'd like to share but not sure if I should post it in this area (Modding) or if it needs to go in the top-level Mods section? Side Q: I can't start a new thread in the Mods section, wondering how I'd go about posting there if that's where it should go. I noticed some mods in Modding get moved elsewhere, so figured it's worth asking before I do anything.

Thanks!
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8878 on: June 29, 2022, 12:23:37 PM »

Hi folks,

This Q is maybe too meta for this thread, so apologies. I made a small mod for myself that I'd like to share but not sure if I should post it in this area (Modding) or if it needs to go in the top-level Mods section? Side Q: I can't start a new thread in the Mods section, wondering how I'd go about posting there if that's where it should go. I noticed some mods in Modding get moved elsewhere, so figured it's worth asking before I do anything.

Thanks!

you need to make a thread in modding and ask a forum moderator to move it to mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8879 on: June 29, 2022, 02:55:50 PM »

I was able to do the first point, hullmod for the armor and hull but I can't find a way to modify the ordnance points as the only related thing I can find it's in "MutableCharacterStatsAPI".

Hmm - the only way that comes to mind would be using hidden hullmods with a negative deployment point cost, but you'd need a bunch of them (for the different number of points you want to add) so it'd be pretty clumsy. Maybe there's a cleaner way, though; just not coming up with one right now.

For the second point a good solution could be multiplying the capital ships deployment points so you wouldn't be able to deploy many capitals but i'm unable to find a way to do it, i've tried to do getSuppliesPerMonth() and getSuppliesToRecover() with a.modifyPercent() in the hullmod but it doesn't change the ships deployment points. Any ideas?

EDIT: I've found a way with getSuppliesToRecover and setSuppliesToRecover in the hullmod plugin (ShipHullSpecAPI). But now I need a way to limit this to capital ships only, is this possible?
EDIT 2: Finally figure it out, it was way simpler than what I was thinking.

I think what you want is stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD)


you need to make a thread in modding and ask a forum moderator to move it to mods

Right! With the intermediate step of the mod getting some player use, a bit of feedback, etc, so that when/if it ends up in the Mods forum (and possibly in the mod list), it's a little more mature.
Logged
Pages: 1 ... 590 591 [592] 593 594 ... 706