Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21); Blog post: Of Slipstreams and Sensor Ghosts (09/24/21)

Pages: 1 ... 531 532 [533] 534 535 ... 537

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

Histidine

  • Admiral
  • *****
  • Posts: 3370
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7980 on: September 24, 2021, 07:02:11 PM »

I’m also interested in where to find it in the api, since I’ve been looking for it and can’t find it.
com.fs.starfarer.api.campaign.econ.MarketAPI

Have you been looking in starfarer_api.zip? If you have an IDE and add it to source, you can jump to any API class/method by Ctrl-clicking it in the IDE (at least that's the shortcut in NetBeans, dunno if other IDEs do it differently). Also you can search for stuff in the extracted folder with Notepad++ or similar.

Quote
Now I also have a different question: After digging through the system code of some mods, it seems they either follow the vanilla style of not adding industries/conditions to their planets in said system code(mostly ORA), while other mods use ArrayLists to state clearly industries/conditions(XLU/VIC/SCY etc). I don’t really get why there are these two coding types here, is it a compatibility issue that got jury rigged to workability or just a stylistic/convenience decision that doesn’t affect much?
Think it's just a 'pick whatever you prefer' thing, although the code approach is needed if you're adding markets after game start. Also I think the config JSONs didn't exist in earlier versions of the game?

Asking for the daddy in Discord.

This doesn't work according to him as a plugin. The daddy wants to replace your script.
Daddy needs to register the plugin in code (not the settings.json). Example from my test mod:
Code
@Override
public void onGameLoad(boolean newGame) {
Global.getSector().getGenericPlugins().addPlugin(new TestCreateFleetPlugin(), true);  // second arg makes it transient
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19185
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7981 on: September 24, 2021, 07:07:02 PM »

Ah - the plugins section in settings.json is not for stuff like that, it's for things where there's one specific implementation the game will use (e.g. the officer level up plugin, or the surveying plugin), not where the game picks one of several possible implementations depending on what it's dealing with.

What you want is SectorAPI.getGenericPlugins().addPlugin().
Logged

Techpriest

  • Captain
  • ****
  • Posts: 259
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7982 on: September 24, 2021, 07:13:30 PM »

Asking for the daddy in Discord.

This doesn't work according to him as a plugin. The daddy wants to replace your script.
Daddy needs to register the plugin in code (not the settings.json). Example from my test mod:
Code
@Override
public void onGameLoad(boolean newGame) {
Global.getSector().getGenericPlugins().addPlugin(new TestCreateFleetPlugin(), true);  // second arg makes it transient
}
Ah - the plugins section in settings.json is not for stuff like that, it's for things where there's one specific implementation the game will use (e.g. the officer level up plugin, or the surveying plugin), not where the game picks one of several possible implementations depending on what it's dealing with.

What you want is SectorAPI.getGenericPlugins().addPlugin().
Ok thank u.u

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19185
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7983 on: September 24, 2021, 07:16:36 PM »

(Oh, durr, I didn't see Histidine's reply! Half asleep over here, sorry.)
Logged

JAL28

  • Commander
  • ***
  • Posts: 166
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7984 on: September 25, 2021, 08:06:59 PM »

I’m also interested in where to find it in the api, since I’ve been looking for it and can’t find it.
com.fs.starfarer.api.campaign.econ.MarketAPI

Have you been looking in starfarer_api.zip? If you have an IDE and add it to source, you can jump to any API class/method by Ctrl-clicking it in the IDE (at least that's the shortcut in NetBeans, dunno if other IDEs do it differently). Also you can search for stuff in the extracted folder with Notepad++ or similar.

Quote
Now I also have a different question: After digging through the system code of some mods, it seems they either follow the vanilla style of not adding industries/conditions to their planets in said system code(mostly ORA), while other mods use ArrayLists to state clearly industries/conditions(XLU/VIC/SCY etc). I don’t really get why there are these two coding types here, is it a compatibility issue that got jury rigged to workability or just a stylistic/convenience decision that doesn’t affect much?
Think it's just a 'pick whatever you prefer' thing, although the code approach is needed if you're adding markets after game start. Also I think the config JSONs didn't exist in earlier versions of the game?

Thanks, though I believe I have found success in coding the industries and conditions through arraylists. Another question(sorry for all the questions lo, im pretty new to modding) though, how do I override the default(vanilla) Askonia file to use my own? Currently it seems that the game is using the default Askonia file instead of the one in my mod so changes are not applying.

Edit: After temporarily removing the vanilla Askonia file and adding the new one in, the markets still don’t spawn. I’m guessing something is wrong somewhere in the code itself too.

(The code, for reference)
https://imgur.com/MxfE3Pp
« Last Edit: September 25, 2021, 09:35:02 PM by JAL28 »
Logged

shoi

  • Captain
  • ****
  • Posts: 391
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7985 on: September 26, 2021, 07:34:15 PM »

Is it possible to disable and hide/enable and show weapon mounts with a hullmod by playing with the variant or something?
Kind of like the damaged weapon mounts thing, but without a skin file?
Logged

Dazs

  • Lieutenant
  • **
  • Posts: 66
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7986 on: September 27, 2021, 04:43:10 AM »

I was wondering if there was a way to show the mining strength of each weapon and ship as you hover over them as an additional stat. I know that Nex has a list that pops up when you click on a planet and ask it to list them so those stats are out there. However that list does not seem to include some weapons and drones from other mods.

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY
« Last Edit: September 27, 2021, 07:51:00 AM by Dazs »
Logged

Techpriest

  • Captain
  • ****
  • Posts: 259
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7987 on: September 27, 2021, 12:18:53 PM »

Working with Contacts now... (shaking... developing something with milk)

If I don't want a particular contact mission to show up in the bar at all BUT not restrict it to a person_id. How would I do this? Because the person that hands out these type of contact missions can differ in procgen of my contact printer that prints out contact cards for the player to call.

SafariJohn

  • Admiral
  • *****
  • Posts: 2138
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7988 on: September 27, 2021, 05:37:54 PM »

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY

WhichMod uses a hack - it edits every mod's description files. Useful, mostly harmless, but a hack nonetheless.


Working with Contacts now... (shaking... developing something with milk)

If I don't want a particular contact mission to show up in the bar at all BUT not restrict it to a person_id. How would I do this? Because the person that hands out these type of contact missions can differ in procgen of my contact printer that prints out contact cards for the player to call.

PersonAPIs have memory that you can put a memory key in - then you just look for contacts that have that memory key.
Logged

Techpriest

  • Captain
  • ****
  • Posts: 259
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7989 on: September 27, 2021, 07:08:47 PM »

PersonAPIs have memory that you can put a memory key in - then you just look for contacts that have that memory key.

You misunderstood. I'm making a custom contact mission right now and it's spawning in bar events even though I don't want it to. >.>

Oh maybe it's something when I copied too much. Let's see... silly me. I copied it into BAR_EVENTS.csv
« Last Edit: September 27, 2021, 07:11:14 PM by Techpriest »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 2138
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7990 on: September 27, 2021, 07:25:00 PM »

Oh, lol, didn't see it was you, Techpriest, sorry :P don't mind me stating basic modding stuff at you.
Logged

Techpriest

  • Captain
  • ****
  • Posts: 259
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7991 on: September 27, 2021, 08:24:09 PM »

I wanted to make a mod that the Player Faction does not select the portrait the player has currently by thinking there would be a removePortrait similar to removeKnown[stuff].

I'm saddened to see that the FactionAPI does not contain a removePortrait nor a getPortrait that returns a set (instead of a weightrandompicker). I'd like for the player to be able to choose their set of portraits on a new game start, but then remove those portraits for their player faction portraits.

May I ask for a request for this in the next version?

Dazs

  • Lieutenant
  • **
  • Posts: 66
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7992 on: September 28, 2021, 12:41:46 AM »

It is a feature I've wanted for awhile but never asked until I came across theDragn's WhicMod and realized it was possible to show additional text on each ship and weapon regardless of what mod it comes from. TY

WhichMod uses a hack - it edits every mod's description files. Useful, mostly harmless, but a hack nonetheless.

Thank you for pointing that out SafariJohn. The more I look into it I do not think it would work anyway since there seems to be two different ways mining is handled and it is separate from the weapon and ship files.

I've been digging around various mods to see how they interact with Nexerelin’s mining mini game. I noted that some have two files in the data folder "\data\config\exerelin". The first seems to be for mining weapons (mining_weapons.csv) and the second for mining ships (mining_ships.csv).

On top of the mining_ships.csv and mining_weapons.csv files I have also learned that mining values can also be set in modSettings.json (found in \data\config) under the lines "mining_ship_strengths" and "mining_weapon_strengths". This is how Nexerelin does it in its own folders for vanilla stuff and how some mods like Scy do it.

Essentially it looks like Nexerelin originally used those csv files because I had noticed that in Nexerelin those files just say "#deprecated; use modSettings.json instead,," but 4 of the mods I checked (haven’t checked them all) still used the mining_ships.csv and mining_weapons.csv files.

This is becoming a deeper rabbit hole than I had expected lol.
« Last Edit: September 28, 2021, 12:44:56 AM by Dazs »
Logged

JAL28

  • Commander
  • ***
  • Posts: 166
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7993 on: September 28, 2021, 03:21:49 AM »

Is there a way to add "gas giant" condition to a planet(or in this case, station)? Specifically, the one that allows Plasma Dynamo to work properly. I tried "GAS_GIANT" and it doesn't exist.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19185
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7994 on: September 28, 2021, 10:56:11 AM »

Edit: After temporarily removing the vanilla Askonia file and adding the new one in, the markets still don’t spawn. I’m guessing something is wrong somewhere in the code itself too.

If it wasn't mentioned already, make sure that the folder path for your Askonia.java file is correct - same as in vanilla. Other than that, maybe try some minor changes to make sure that it works? Also, maybe goes without saying, but you need to start a new game for changes in that kind of file to apply.

Is it possible to disable and hide/enable and show weapon mounts with a hullmod by playing with the variant or something?
Kind of like the damaged weapon mounts thing, but without a skin file?

I don't think so, not without a .skin file.

I wanted to make a mod that the Player Faction does not select the portrait the player has currently by thinking there would be a removePortrait similar to removeKnown[stuff].

I'm saddened to see that the FactionAPI does not contain a removePortrait nor a getPortrait that returns a set (instead of a weightrandompicker). I'd like for the player to be able to choose their set of portraits on a new game start, but then remove those portraits for their player faction portraits.

May I ask for a request for this in the next version?

(Not the right thread for modding feature requests!) That said, the player's portrait should already be extremely unlikely to be picked for a player-faction NPC. It's still possible but it'd have to get picked like 5 times in a row.

Is there a way to add "gas giant" condition to a planet(or in this case, station)? Specifically, the one that allows Plasma Dynamo to work properly. I tried "GAS_GIANT" and it doesn't exist.

The market conditions are defined in data/campaign/market_conditions.csv
Logged
Pages: 1 ... 531 532 [533] 534 535 ... 537