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 ... 383 384 [385] 386 387 ... 706

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

Nerzhull_AI

  • Commander
  • ***
  • Posts: 186
  • Do you exist in your dreams?
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5760 on: November 27, 2019, 04:19:29 AM »

Are any other mods enabled? If multiple mods try to override a plugin this way the results are undefined (in practice, they depend on mod load order).
There shouldn't be, but i'll double-check. Thanks for the advice.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5761 on: November 27, 2019, 08:41:50 AM »

How can you check if a ship currently has the zero flux boost? I'd check if flux == 0 but there are some boosts that make it not actually 0.
So I haven't tested it and there isn't any documentation to confirm that it does what I think it does, but this should do the trick:
Code: java
ship.getFluxTracker().isEngineBoostActive()

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5762 on: November 27, 2019, 03:29:46 PM »

Since ammo recharging is kind of a gimmick with a lot of Shadowyards weapons I've been planning on introducing a hullmod that boosts this recharge rate; unfortunately as I started trying to implement it it became clear that straightforward mechanisms for this don't seems to be present, at least not through MutableShipStats. It's already been requested through the API request thread but doesn't seem to have been implemented yet; as such I figured I may as well ask if anyone has any suggestions for an alternate implementation.
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5763 on: November 27, 2019, 06:02:24 PM »

In the .proj files, what is the difference between the missileTypes "BOMB_WITH_SLOW" and "BOMB"?
Also how do i make the bombs not explode for the first few seconds? armingTime? or is there another tag that influences it?
Logged
Check out my ships

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5764 on: November 27, 2019, 06:12:55 PM »

Also how do i make the bombs not explode for the first few seconds? armingTime? or is there another tag that influences it?
I can attest that setting arming time makes bombs (and missiles) not explode. For example, this is the code I used to make my chainmine roller not explode ever:
Code
        missile.setArmingTime(999999f);
Logged

Ed

  • Captain
  • ****
  • Posts: 442
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5765 on: November 27, 2019, 06:50:59 PM »

Also how do i make the bombs not explode for the first few seconds? armingTime? or is there another tag that influences it?
I can attest that setting arming time makes bombs (and missiles) not explode. For example, this is the code I used to make my chainmine roller not explode ever:
Code
        missile.setArmingTime(999999f);
will collision with enemy ships trigger it? i want to make a projectile that spawns mines on impact, but the mines i spawn detonate instantly because they are also colliding with the target (right now my solution is to spawn them a bit before the target, but doesn't look nice)
Logged
Check out my ships

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7173
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5766 on: November 27, 2019, 10:32:33 PM »

Back to variant questions! Is there anything special that needs to be done to set a module variant? The following code throws me no errors when called, but also does no changes:
Code: java
        //get variant and clone it for changes
        ShipVariantAPI variantClone = mothership.getVariant().clone();
        if (DEBUG) LOGGER.info("Insert: VariantClone name: " + variantClone.getDisplayName());
        variantClone.setSource(VariantSource.REFIT);//needed for saving correctly

        //check master copy of new module first, so we thrown error (return) before shifting
        ShipVariantAPI newModuleClone = Global.getSettings().getVariant(moduleID);//not a clone yet
        //if null, print error message and return
        if (newModuleClone == null) {
            if (DEBUG) LOGGER.info("Couldn't find module to get a master copy! ModuleID: " + moduleID);
            return;
        }
        //make it a clone!
        newModuleClone = newModuleClone.clone();

       //now add new one
        String slotID = IDs.MSLOT_PREFIX + String.valueOf(moduleIndex);
        if (DEBUG) LOGGER.info("Insert: Exitted loop, adding new module. slotID: " + slotID);
        if (DEBUG) LOGGER.info("newModuleDlone name: " + newModuleClone.getDisplayName());
        variantClone.setModuleVariant(slotID,newModuleClone);

        //variantClone done, set it
        mothership.setVariant(variantClone, false, false);

Debug messages are coming back as they should, and I double checked that the module slots in the .ship file are named correctly (in this case 'MS_0'). If it matters, the module slots are currently empty.
Logged

craftomega

  • Captain
  • ****
  • Posts: 301
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5767 on: November 28, 2019, 12:45:14 PM »

Is there any way to reduce the amount of faction rep you lose when you attack a fleet when your transponder is off?

Also when you defeat expeditions?
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5768 on: November 28, 2019, 03:49:34 PM »

I tried adding some luxury commodities, but there seems to be a bug with the player selling them off to a different planet for a large price, but then being able to buy them for a lower price (effectively making an infinite money loop). I tried copying data from other mods that add commodities but it seems the error was not fixed. Am I missing something to prevent this?

Here is the data for the commodities - the values are copied off HMI's crystals, I believe (with minor edits).

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5769 on: November 29, 2019, 10:48:28 AM »

will collision with enemy ships trigger it?

I won't, any impact during the arming time will make it collide with the ship and bounce around.

If it matters, the module slots are currently empty.

I'm fairly sure that's the issue. Didn't dig around in the code but I seem to remember that being a requirement - well, either that, or this may be a special case of "modules in the same slot must have the same hull id when the variant in the slot is changed".  Put another way, modules aren't *that* modular; different hulls can't be plugged in at will. Either way, it's definitely worth trying it starting out with the stock variant having empty modules in the slots.


Is there any way to reduce the amount of faction rep you lose when you attack a fleet when your transponder is off?

Also when you defeat expeditions?

For the former, you could provide your own implementation of a ReputationActionResponsePlugin using CampaignPlugin.pickReputationActionResponsePlugin().

For the latter, you can modify PunitiveExpeditionIntel.REP_PENALTY in your ModPlugin.onApplicationLoad() or some such.


I tried adding some luxury commodities, but there seems to be a bug with the player selling them off to a different planet for a large price, but then being able to buy them for a lower price (effectively making an infinite money loop). I tried copying data from other mods that add commodities but it seems the error was not fixed. Am I missing something to prevent this?

Nothing looks immediately wrong, hmm. I just tried it with lobsters at several markets (with/without luxury goods demand) and there as no issue, so probably something *is* missing but I'm not sure what.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5770 on: November 29, 2019, 03:54:54 PM »

Hello is there a method to mess with the cycle date? Like maybe.. somewhere before 207...

Alex

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

See CampaignClockAPI.getCal().set(...)
Logged

Morrokain

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

Since ammo recharging is kind of a gimmick with a lot of Shadowyards weapons I've been planning on introducing a hullmod that boosts this recharge rate; unfortunately as I started trying to implement it it became clear that straightforward mechanisms for this don't seems to be present, at least not through MutableShipStats. It's already been requested through the API request thread but doesn't seem to have been implemented yet; as such I figured I may as well ask if anyone has any suggestions for an alternate implementation.

I messed with this idea a while back. Long and short of it is I don't think that value is exposed anywhere. I am nowhere even close to the best coder on this forum though. Just figured I'd say I tried and met no success.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5773 on: November 29, 2019, 10:32:11 PM »

does anyone know where i can get old starfarer releases - 0.34, 0.35 and the first alpha
blogpost download links are dead, they give me a 404 error
http://fractalsoftworks.com/tag/release/page/5/
i kinda want to look at old sprites and whatnot
to see where it all began.
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.

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5774 on: November 30, 2019, 06:57:07 AM »

No idea where you could get versions that old. Oldest one I have is 0.6.2

Since ammo recharging is kind of a gimmick with a lot of Shadowyards weapons I've been planning on introducing a hullmod that boosts this recharge rate; unfortunately as I started trying to implement it it became clear that straightforward mechanisms for this don't seems to be present, at least not through MutableShipStats. It's already been requested through the API request thread but doesn't seem to have been implemented yet; as such I figured I may as well ask if anyone has any suggestions for an alternate implementation.
Well, you could always modify ammo manually with myWeapon.setAmmo(), but that might get complicated/bug-prone depending on what you want to do.
Pages: 1 ... 383 384 [385] 386 387 ... 706