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 ... 618 619 [620] 621 622 ... 706

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

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9285 on: October 21, 2022, 07:12:01 AM »

Ahh, I think I see the issue - it happens when you actually get into the combat, not just when you join the battle in the campaign screen. Checking it out!

Edit: fixed this up! It would only affect allied fleets, and I *think* it would kick out the fleet commander regardless of what ship they were in, so, a pretty significant bug at that. Thank you for the report!

I don't *think* there's a particularly clean workaround, other than, say, undoing this in some combat plugin's init() method or something similar.
I've encountered a case where the bug also occurs for the player fleet under specific circumstances. It's rare enough that I don't feel like trying to fix it (especially given the conflicts involved with multiple mods overriding FIDPI, which would be needed to avoid breaking it when player changes flagships before the engagement), but I want to check: this is also covered by the fix in next Starsector version, right?
Logged

alaricdragon

  • Commander
  • ***
  • Posts: 145
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9286 on: October 22, 2022, 02:49:12 PM »

hello once more everyone.
so i made an submarket the otherday. the idea was to use it as a 'kind of storage' for ships, but every time i add an ship to the submarket, leave them come back its gone. dose anyone know how to prevent this from happing
here is my code
Spoiler
public class AIRetrofit_Shipyard extends BaseSubmarketPlugin {
    @Override
    public void advance(float amount){
    }
    @Override
    public boolean isParticipatesInEconomy() {
        return false;
    }

    @Override
    public float getTariff() {
        return 0f;
    }

    @Override
    public boolean isFreeTransfer() {
        return true;
    }
    @Override
    public String getBuyVerb() {
        return "take";
    }

    @Override
    public String getSellVerb() {
        return "leave";
    }
    @Override
    public boolean showInCargoScreen() {
        return false;
    }
    @Override
    public boolean   isIllegalOnSubmarket(java.lang.String commodityId, SubmarketPlugin.TransferAction action){
        return false;
    }
    @Override
    public    boolean isMilitaryMarket(){
        return true;
    }
}

[close]
thanks again for all the help in the past. it has been very helpfull
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9287 on: October 22, 2022, 03:34:19 PM »

Anybody know an easy way to change the damage type of a projectiles proximity fuse to have different type to the projectile.

Not possible through the data files.


@alaricdragon: hmm, nothing jumps out as being wrong there. I'd suggest making an exact copy of StoragePlugin, making sure that works how you'd like, and then incrementally changing it - one thing at a time - until you hit on whatever it is that's causing this behavior, somehow.

Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9288 on: October 23, 2022, 06:34:57 AM »

Can a ship be hit if its bounds are a point?

EDIT: got off my lazy bum and tested: looks like no, except it can still collide with other ships' hulls.
« Last Edit: October 23, 2022, 09:42:58 AM by SafariJohn »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9289 on: October 24, 2022, 06:14:30 AM »

So e.g. TacticallyBombardColony and BaseDisruptIndustry have this:

Code: java
		addNoPenaltyFailureStages(Stage.FAILED_NO_PENALTY);
connectWithMarketDecivilized(Stage.BOMBARD, Stage.FAILED_NO_PENALTY, market);
setStageOnMarketDecivilized(Stage.FAILED_NO_PENALTY, createdAt);
connectWithHostilitiesEnded(Stage.BOMBARD, Stage.FAILED_NO_PENALTY, person, market);
setStageOnHostilitiesEnded(Stage.FAILED_NO_PENALTY, person, market);
Questions:
- Are both the connectWithHostilitiesEnded and setStageOnHostilitiesEnded calls needed, or do they do the same thing here (end the mission if the person faction is no longer hostile to the market faction)?
- Is the setStageOnMarketDecivilized call correct? Looks like it ends the mission if the issuer's market decivilizes, which I'm not sure is necessary.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9290 on: October 24, 2022, 09:58:21 AM »

The "no_drop_salvage" tag should do it.

Edit: at least, assuming a mod hasn't changed or added drop groups that don't respect that.

I'm unsure if this is the case. Just doing vanilla + my mod and the no_drop_salvage tag doesn't seem to work at least in the public version. Can still seem to recover hullmods found in random stations and ruin exploration.

no_drop works, but I would like for the fleet with the hullmods to drop them and not random stations outside.

Killian

  • Commander
  • ***
  • Posts: 114
  • I got 99 problems but a core breach ain't one.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9291 on: October 24, 2022, 10:49:18 AM »

Anyone got any good resources on making ship systems? I want to make a toggle system that, whilst active, either;

A) causes all of a ship's missile weapons to gain increased rate of fire and reload speed, and periodic ammo regeneration (think missile autoforge + fast missile racks + ballistic ammo feed)

or

B) causes all of a ship's missile weapons to gain increased velocity, tracking, etc. (similar to the ECCM package hullmod, but beefed up)

With the cost of constant hardflux generation whilst active. I'd rather it be a toggle that does things periodically rather than a one-and-done fixed-duration thing, for the potential of absolutely redlining the ship's systems with the risk of overload (and maybe actual damage??) if you push too hard.

Unfortunately the search function hasn't been very helpful thusfar, and I've not worked with java nor the starsector APIs before, so I haven't much idea on where to begin.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9292 on: October 24, 2022, 03:58:52 PM »

Can a ship be hit if its bounds are a point?

EDIT: got off my lazy bum and tested: looks like no, except it can still collide with other ships' hulls.

Don't know what you're trying to do, but: would setting the ship's collision class to CollisionClass.NONE do the job? If that's no good for some reason, you could also try moving that one bounds point several battlefield lengths away from the center of the ship :)

Also: setting the collision radius to 0 *may* bypass the bounds check; I don't actually remember 100%.


- Are both the connectWithHostilitiesEnded and setStageOnHostilitiesEnded calls needed, or do they do the same thing here (end the mission if the person faction is no longer hostile to the market faction)?

Those do seem redundant, yeah. Just one or the other should do.

- Is the setStageOnMarketDecivilized call correct? Looks like it ends the mission if the issuer's market decivilizes, which I'm not sure is necessary.

Yeah, that's the intent. Not strictly necessary indeed; not sure there's much of a difference either way.

I'm unsure if this is the case. Just doing vanilla + my mod and the no_drop_salvage tag doesn't seem to work at least in the public version. Can still seem to recover hullmods found in random stations and ruin exploration.

no_drop works, but I would like for the fleet with the hullmods to drop them and not random stations outside.

Hmm, that's odd. You're not adding any drop groups yourself, are you? Just looking at how the vanilla drop groups are set up, this tag should work specifically for hullmod specs.


Anyone got any good resources on making ship systems? I want to make a toggle system that, whilst active, either;

Copying another toggle-type ship system (such as Fortress Shield) might be a good place to start.
Logged

Killian

  • Commander
  • ***
  • Posts: 114
  • I got 99 problems but a core breach ain't one.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9293 on: October 24, 2022, 04:20:56 PM »

Anyone got any good resources on making ship systems? I want to make a toggle system that, whilst active, either;

Copying another toggle-type ship system (such as Fortress Shield) might be a good place to start.

Aha, right. I was missing that all the crunchy effects like costs and toggles are defined in the shipsystems.csv. Excellent. I think I can see how this'll work, just gotta fish through the API for the exact settings I need for the script itself.

I have most of it going now, but I don't see an easy "can cause overload" setting?
« Last Edit: October 24, 2022, 04:52:00 PM by Arcalane »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9294 on: October 24, 2022, 05:31:00 PM »

Can a ship be hit if its bounds are a point?

EDIT: got off my lazy bum and tested: looks like no, except it can still collide with other ships' hulls.

Don't know what you're trying to do, but: would setting the ship's collision class to CollisionClass.NONE do the job? If that's no good for some reason, you could also try moving that one bounds point several battlefield lengths away from the center of the ship :)

Also: setting the collision radius to 0 *may* bypass the bounds check; I don't actually remember 100%.

Just theory-crafting for a ship system that makes the ship unable to be hit. Was hypothesizing NONE might make the AI not target it and thought of point bounds. 0 collision radius is also a good idea.
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9295 on: October 24, 2022, 05:32:15 PM »

How can I access the every WeaponSpecAPI corresponding to a weapon_data.csv row containing the SYSTEM tag, wherefore Global.getSettings().getAllWeaponSpecs() excludes every such WeaponSpecAPI?

FelixG

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9296 on: October 25, 2022, 02:40:07 AM »

I haven't seen a mod around that does it, but is there a mod, or a pointer in the files, that adjusts the scaling of the bounties to keep them from ballooning completely out of hand and spawning a half dozen capital ships when you have a smaller fleet?
Logged

alaricdragon

  • Commander
  • ***
  • Posts: 145
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9297 on: October 26, 2022, 01:46:13 PM »

hello again all.
im sorry to bug you all again so soon, but i have another question:
how do i access ships stored in an submarket? I have tried
Code
cargo.getFleetData().getMembersListCopy()
but this and other methods that try to pass 'FleetMemberAPI' in submarkets always results in a crash, and I cant seem to find any other references to ships at all in the submarkets code.
again, thank you all for all the help freely given, its very nice to have help.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9298 on: October 27, 2022, 02:37:53 AM »

cargo.getMothballedShips()

(Javadoc mentions that initMothballedShips(String factionId) needs to be called first, not sure if game automatically does this already)
Logged

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9299 on: October 28, 2022, 08:24:47 AM »

common issue is we have to point out the ShipAPI.setCustomData method that actually modifies the underlying map and not a copy returned by ShipAPI.getCustomData. is it possible to make getCustomData return the original custom data map?
Logged
Pages: 1 ... 618 619 [620] 621 622 ... 706