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: Planet Search Overhaul (07/13/24)

Pages: 1 ... 714 715 [716] 717 718 ... 735

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

Ruddygreat

  • Admiral
  • *****
  • Posts: 561
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10725 on: May 27, 2024, 04:27:16 AM »

When I call addPlugin to add a TestPlugin object, and then call removePlugin, do the parameters of removePlugin need to be the same TestPlugin object, or do I need to create a TestPlugin object?
To put it another way, does CombatEngineAPI allow for multiple objects of the same kind of plugin to exist, or are addPlugin and removePlugin something like singleton (possibly using instanceof to make sure there is only one object of the same kind of plugin)?

yeah, multiple plugins of the same type can be attached to the combat engine; removePlugin takes the specific plugin object that you want to remove as its param

Killer of Fate

  • Admiral
  • *****
  • Posts: 1358
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10726 on: May 27, 2024, 09:43:26 AM »

I've used replace function to change the Persean League faction doctrine in the most absolute way possible.

Spoiler
[close]

And removed all variant overrides to prevent the existence of DEM dedicated variants with the obvious exception of Pegasus one. And then just wanted to use weapon prioritising to uniquify the Persean League (less work that way when reworking variants).

Spoiler
[close]

And yet I'm still seeing DEM variants in the game...

Spoiler
[close]

What am I doing wrong?

second question:
does increasing the PTS values of civilian ships decrease the overall amount of them appearing in various fleets or is there some other stat responsible for that?
« Last Edit: May 27, 2024, 10:00:12 AM by Killer of Fate »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10727 on: May 27, 2024, 10:23:24 AM »

I had to do my own colony interaction listener and just modify your implementation of transferring marines to work for local resource submarket. Everything works as intended now. Thank you.

Nice, congratulations!

What am I doing wrong?

Did you make a new campaign?

second question:
does increasing the PTS values of civilian ships decrease the overall amount of them appearing in various fleets or is there some other stat responsible for that?

What's PTS?
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 1358
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10728 on: May 27, 2024, 10:26:15 AM »

no... I guess I should... (okay, I checked... It works)

What's PTS?

fleet pts? The fleet building stat I assume?

Spoiler
[close]
« Last Edit: May 27, 2024, 10:28:43 AM by Killer of Fate »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10729 on: May 27, 2024, 04:55:08 PM »

Ah! Yeah, increasing their fleet points value would reduce the number of civ ships that show up in fleets, I believe.
Logged

banano of doom

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10730 on: May 28, 2024, 05:47:12 AM »

question
i am trying to use Dmod overlay for some uuuh... unintended purposes
but apparently dmod overlay is randomly rotated every time it is applied
is it at all possible to make it not randomly rotated, i.e. to be always parallel to the ship sprite?
Spoiler
[close]
« Last Edit: May 28, 2024, 06:05:30 AM by banano of doom »
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

vicegrip

  • Captain
  • ****
  • Posts: 252
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10731 on: May 28, 2024, 06:54:41 AM »

When using engine.applyDamage, is the damage total modified by the type of surface it impacts? For example if I applied 100 kinetic damage to shields will it actually be the equivalent of 200 damage, or will it register as 100 damage of the kinetic type?

Yunru

  • Admiral
  • *****
  • Posts: 1567
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10732 on: May 28, 2024, 10:14:47 AM »

So this was my first attempt (sbgrMult defaults to 30), but it's not working.
Code: java
        CargoAPI result = performRaid(random, (temp.raidMult));
        CargoAPI yunru_temp;
        if (sbgrMult > 1) {
            for (int i = 1; i < sbgrMult; i++) {
                yunru_temp = performRaid(random, (temp.raidMult));
                result.addAll(yunru_temp);
            }
        }
I also tried:
Code: java
float lootMult = sbgrMult * (1f + leftoverRE / Math.max(RE_PER_MARINE_TOKEN, raidEffectiveness));
To no avail.
I think my approach might be entirely wrong?
I basically duplicated MarketCMD.java and hoped that by having it in the same location in my mod's jar it would overwrite the vanilla one. Of course, if that isn't happening (because the vanilla one is already compiled for instance) then it'd explain perfectly why I see no change.

Killer of Fate

  • Admiral
  • *****
  • Posts: 1358
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10733 on: May 28, 2024, 12:05:34 PM »

Ah! Yeah, increasing their fleet points value would reduce the number of civ ships that show up in fleets, I believe.
ok, thanks for info... Btw, if I don't respond with a thank you, don't think I'm not grateful... I just... I just don't want to bother you.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10734 on: May 28, 2024, 12:13:39 PM »

question
i am trying to use Dmod overlay for some uuuh... unintended purposes
but apparently dmod overlay is randomly rotated every time it is applied
is it at all possible to make it not randomly rotated, i.e. to be always parallel to the ship sprite?
Spoiler
[close]

Oh, neat! Not currently possible, but - added these to ShipAPI just now:
float getdHullOverlayAngleOffset();
void setdHullOverlayAngleOffset(float dHullOverlayAngleOffset);


When using engine.applyDamage, is the damage total modified by the type of surface it impacts? For example if I applied 100 kinetic damage to shields will it actually be the equivalent of 200 damage, or will it register as 100 damage of the kinetic type?

Yes! This is easily testable :)

I think my approach might be entirely wrong?
I basically duplicated MarketCMD.java and hoped that by having it in the same location in my mod's jar it would overwrite the vanilla one. Of course, if that isn't happening (because the vanilla one is already compiled for instance) then it'd explain perfectly why I see no change.

Ah, yeah, that's not going to work. You'd need to have a differently named command (MarketCMD2 or whatever), make sure it's compiled, and then call it from rules.csv, replacing any vanilla rules that do that. This is very likely to be VERY incompatible with other mods than tweak market interactions in any sort of related way.

ok, thanks for info... Btw, if I don't respond with a thank you, don't think I'm not grateful... I just... I just don't want to bother you.

*thumbs up* Glad to help - and, probably a good call to keep this thread on point!
Logged

banano of doom

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10735 on: May 28, 2024, 04:14:30 PM »

Oh, neat! Not currently possible, but - added these to ShipAPI just now:
float getdHullOverlayAngleOffset();
void setdHullOverlayAngleOffset(float dHullOverlayAngleOffset);
glad to hear that, thank you
shelving that whole idea for later then
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

SaltedFish

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10736 on: May 28, 2024, 06:05:50 PM »

The order in which commands are processed in the same frame:
1. receive commands from the player
2. receive commands from AIPlugin
3. the player's ship processes commands from step 1 in advance()
4. all entities process commands from step 2 and step 5 in their respective advance()
5. receive commands from subclasses of BaseEveryFrameCombatPlugin

Can see the effect of step 2 commands in the current frame.
Can't see the effect of commands from step 5 in the current frame, but the commands are queued immediately.
Is there something wrong with this sequence? Am I missing any important steps? Are there more subdivided steps?
« Last Edit: May 28, 2024, 06:15:12 PM by SaltedFish »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10737 on: May 29, 2024, 09:13:35 AM »

This sounds right, though I have to be honest, I did not dig into it and it's not something that's permanently at the top of my mind - usually it's not something I need to think about because things "just work", if that makes sense.

One thing that throws a wrench into this is fast-time - when non-player ships have their time sped up (e.g. phase cloak), steps 2 and 4 will happen multiple times per frame for those ships.
Logged

Audax

  • Captain
  • ****
  • Posts: 250
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10738 on: May 29, 2024, 09:49:55 AM »

Anyway to get a selected ship variant in the refit screen?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10739 on: May 29, 2024, 11:00:43 AM »

I don't think so, but: from where in the code?
Logged
Pages: 1 ... 714 715 [716] 717 718 ... 735