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 ... 327 328 [329] 330 331 ... 706

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

dgs6686

  • Ensign
  • *
  • Posts: 22
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4920 on: August 28, 2019, 01:14:51 PM »

The Skills are in starfarer.api\com\fs\starfarer\api\impl\campaign\skills.  To implement new ones, you'll need to create a directory (preferably in /scripts) and move one of the Skill java files there, change the reference in the .skill file, etc.

Thanks for the help! With a little digging and playing around I was able to get started on my some of my ideas. My first test was to try and combine 'Strike Commander' in to 'Missile Specialization', and then remove the 'Strike Commander' skill from the game. I am running in to 2 complications I was wondering if you or someone else might know how this is supposed to be done.

Firstly, It appears that the game is still reading the base-game skill info for 'Missile Specialization' and inputting the stats with my modified version (as seen in the attachment). As you can see for my test the only value I changed was 'Level 3: Missile damage' from 25% to 10%. However it is still reading the 25% from the base-game value and dumping it in extra with my modified stats.

Secondly, I can tell if I remove the 'Strike Commander' skill entry from skill_data.csv in the default sub-directory (starsector-core/data/character/skills) that it will no longer appear on the character screen as a learn-able skill. However I'm not sure how to remove this from showing from a mod standpoint. If I copy the skill_data.csv to my mod folder/data/character/skills and remove the 'Strike Commander' entry it appears to have no effect. I'm also not sure if this will prevent the AI / Officers from being able to learn this ability.

Edit: Also wanted to throw in that I tested this with harpoon MRM pod - 4x 750 damage harpoons hit a hammerhead shield for 1620 damage, which is equivalent to 2025 damage after dividing by .8 for the shield mitigation. Since harpoons deal 1/2 damage to shields, 4x 375 = 1500 * 1.35 (25 % + 10%) = 2025 so I confirmed that both the mod values and the standard values are being added.

[attachment deleted by admin]
« Last Edit: August 28, 2019, 01:29:41 PM by dgs6686 »
Logged

XDms

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4921 on: August 29, 2019, 08:58:38 AM »

Hello, i would like to add a new commodity using an existing industry (Light Industry for example)
Is that possible (without breaking stuff) or do i need to create a new industry to produce the new commodity? Because I had a look at a few mods and seems that new commodities are created from new industries
Logged

NoFoodAfterMidnight

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4922 on: August 29, 2019, 10:30:03 AM »

How do I get my new combat plugin to work? I've got a class implementing EveryFrameCombatPlugin in a .jar in a new mod, with the jar being referenced in the modinfo file. I'm not sure how to get the game to read this plugin. Up until now for stuff like this I've been overwriting things in the game's API.jar in the core folder, which isn't exactly something I should be doing going forward. Which also leads me to another question, is it possible to get a mod to overwrite a .class file in the core .jar?
Logged

Salv

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4923 on: August 29, 2019, 10:32:33 AM »

Hello, i would like to add a new commodity using an existing industry (Light Industry for example)
Is that possible (without breaking stuff) or do i need to create a new industry to produce the new commodity? Because I had a look at a few mods and seems that new commodities are created from new industries

One way to do it is by making an extension of the original industry class and adding "supply(Commodities.(your commodity), (whichever number, it's usually size minus something);" in the public void apply override. Then you can go to the industries.csv and type in your class' file path in the plugins column for the respective industry. I suppose that wouldn't break anything :p.

Edit: Btw I'm not sure whether you have introduced the new commodity into the game yet. I haven't really done that myself, and if it requires more than edits to the commodities csv I may be of little help here.

 I also have a question. Is it possible to apply the percentage of the population progress towards new size to modify a value? I want to have a number scale with it. I reckon PopulationComposition getPopulation(); may have something to do with it but I'm not sure if it's applicable. I'm not really knowledgeable about Java, so forgive my recent torrent of questions :D.
« Last Edit: August 29, 2019, 11:10:29 AM by Salv »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4924 on: August 29, 2019, 11:38:57 AM »

Is it possible to add fleet skills to AI fleets?
I know that some use some fleet skills(like Officer Management) but some are not used(like Safety Procedures).
I tried to add some of fleet buffs to some factions but it don't look like it working.

Anyone can help?

IIRC, all fleetwide skills from AI fleet commanders apply to their fleets. Some don't matter (i.e. fuel consumption or supply use modifiers) but that doesn't prevent the skills from being applied.


Hello, i would like to add a new commodity using an existing industry (Light Industry for example)
Is that possible (without breaking stuff) or do i need to create a new industry to produce the new commodity? Because I had a look at a few mods and seems that new commodities are created from new industries

It's possible and should be fairly straightforward, in as much as adding industries is, anyway.

Hello, i would like to add a new commodity using an existing industry (Light Industry for example)
Is that possible (without breaking stuff) or do i need to create a new industry to produce the new commodity? Because I had a look at a few mods and seems that new commodities are created from new industries
One way to do it is by making an extension of the original industry class and adding "supply(Commodities.(your commodity), (whichever number, it's usually size minus something);" in the public void apply override. Then you can go to the industries.csv and type in your class' file path in the plugins column for the respective industry. I suppose that wouldn't break anything :p.

Right on!


How do I get my new combat plugin to work? I've got a class implementing EveryFrameCombatPlugin in a .jar in a new mod, with the jar being referenced in the modinfo file. I'm not sure how to get the game to read this plugin. Up until now for stuff like this I've been overwriting things in the game's API.jar in the core folder, which isn't exactly something I should be doing going forward. Which also leads me to another question, is it possible to get a mod to overwrite a .class file in the core .jar?

Add the plugin to your "plugins" section in settings.json; the key you use doesn't matter as long as it's unique.

You can't overwrite .class files, generally you'll need to instead change wherever that class is being used/pointed to to use the other class instead. See: various CampaignPlugin.pickXXXPlugin methods, GenericPluginManagerAPI, etc.



I also have a question. Is it possible to apply the percentage of the population progress towards new size to modify a value? I want to have a number scale with it. I reckon PopulationComposition getPopulation(); may have something to do with it but I'm not sure if it's applicable. I'm not really knowledgeable about Java, so forgive my recent torrent of questions :D.

See: Misc.getMarketSizeProgress() for how to get the growth value.

Logged

Salv

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4925 on: August 29, 2019, 12:01:09 PM »

Thank you. It was actually right under my nose and i went looking elsewhere.
Logged

Nia Tahl

  • Admiral
  • *****
  • Posts: 790
  • AI in disguise
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4926 on: August 29, 2019, 03:55:49 PM »

Is there a tag to prevent blueprints from being obtainable via raiding?
Logged
My mods: Tahlan Shipworks - ScalarTech Solutions - Trailer Moments
It's all in the presentation

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4927 on: August 29, 2019, 08:33:31 PM »

Yeah, "no_bp_drop".
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4928 on: August 30, 2019, 06:37:25 AM »

Should we change the thing where a ship being built by player while not having variants defined in default_ship_roles.json just stalls the build queue indefinitely? It's pretty confusing to users.
(Maybe let it go ahead and complete construction with no weapons)

I added it as a plugin to the plugins section, but it's getting an error about being unable to cast from modplugin to my combat plugin. I'm pretty sure it's because my plugin is a class implementing BaseEveryFrameCombatPlugin and not a class extending the ModPlugin class.

I've looked through a bunch of mods that are using classes implementing BaseEveryFrameCombatPlugins and I don't even see how they're calling the plugin. The only plugin they call is their own ModPlugin which makes no references to their combat plugins.
That error sounds like you accidentally specified your combat plugin in the mod info's mod plugin field, or vice-versa.
Logged

vagrant

  • Ensign
  • *
  • Posts: 29
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4929 on: August 30, 2019, 01:53:57 PM »

Does anyone have experience with using hullmods to modify aspects of ship systems?

-I'm looking to create a single, modular shipsystem that can have additional effects and bonuses based on equipped hullmods. I'm comfortable enough doing the actual modifications to the system that I want, but I have no idea how to implement them so that they are applied only when an applicable hullmod is equipped.

-Alternatively, is changing a given ship's system to another system entirely, possible with a hullmod?

Any examples I could read through or parts of the API in particular I could look at would be helpful.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4930 on: August 30, 2019, 04:14:02 PM »

Should we change the thing where a ship being built by player while not having variants defined in default_ship_roles.json just stalls the build queue indefinitely? It's pretty confusing to users.
(Maybe let it go ahead and complete construction with no weapons)

Hmm - first time I'm hearing about it! So on the one hand, it probably shouldn't get stuck (fixed), but on the other hand, that seems like an error in the mod - all ships need to have corresponding entries in default_ship_roles if they have a blueprint, otherwise they won't don't show up in fleets once the blueprint is learned.


Does anyone have experience with using hullmods to modify aspects of ship systems?

-I'm looking to create a single, modular shipsystem that can have additional effects and bonuses based on equipped hullmods. I'm comfortable enough doing the actual modifications to the system that I want, but I have no idea how to implement them so that they are applied only when an applicable hullmod is equipped.

I don't have any examples handy, but you'd want to check - in the apply hullmod effects method - whether the ship's variant has the hullmod. Something like ship.getVariant().hasHullMod(String id) or similar.

-Alternatively, is changing a given ship's system to another system entirely, possible with a hullmod?

I don't think it's possible with a hullmod.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4931 on: August 30, 2019, 07:54:47 PM »

Does anyone have experience with using hullmods to modify aspects of ship systems?

-I'm looking to create a single, modular shipsystem that can have additional effects and bonuses based on equipped hullmods. I'm comfortable enough doing the actual modifications to the system that I want, but I have no idea how to implement them so that they are applied only when an applicable hullmod is equipped.

I know Interstellar Imperium does this, you should check it out.
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4932 on: August 30, 2019, 09:08:06 PM »

Does the local resources submarket not update for hidden markets? If so, is there a way to change this that isn't "add the things yourself in an EveryFrameScript"?
Figured out my problem: local resources' getStockpileLimit() doesn't count commodity supply from flat mods. So I had to override that method in my local modification of LocalResourcesSubmarketPlugin.

New problem: How to I set a market's demand for a commodity to zero? I tried the following in EconomyUpdateListener.commodityUpdated()
Code: java
	CommodityOnMarketAPI com = market.getCommodityData(commodityId);
String modId = market.getId();

market.getDemand(com.getDemandClass()).getDemand().modifyMult(modId, 0);
com.getDemand().getDemand().modifyMult(modId, 0);
but the market's industries still generate their usual demand.

EDIT: Also, how often is EconomyUpdateListener.economyUpdated() called? I'm wondering if it's safe to use for a monthly upkeep-style cost or if I should use reportEconomyTick insead.
« Last Edit: August 30, 2019, 09:35:42 PM by Histidine »
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4933 on: August 31, 2019, 02:45:33 AM »

What exactly does    
"raidCooldownDays":1,
do?

I assume it's the minimal period between raids? All raids? How do I reduce pirate raids. They are attacking me every month.
Logged

ArnaudB

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #4934 on: August 31, 2019, 08:45:06 AM »

What exactly does    
"raidCooldownDays":1,
do?

I assume it's the minimal period between raids? All raids? How do I reduce pirate raids. They are attacking me every month.
Nothing to do with pirates raid. It's when you raid/invade/disrupt with your fleet on a world. You need to wait one full day (24 hours) before you can make another.
Logged
Pages: 1 ... 327 328 [329] 330 331 ... 706