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)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Tuv0x

Pages: [1]
1
Mods / Re: [0.9.1a] Dynamic Tariffs 1.3
« on: May 11, 2021, 07:26:06 PM »
How does this interact with nexerelin Tariffs? (the 9 and 18%?)
Will this overide Nexerelin, or will nexerelin override this?

It shouldn't overwrite anything that Nexerelin does, at least from what other mod authors have told me when I was programming this. The mod uses a whitelist in the settings.json file, only the vanilla markets are effected.

The way the mod is set up it should work just fine with all mods, UNLESS they had changed something with the vanilla markets. Also, this mod is a utility mod, it can be removed and added whenever you want.

2
Suggestions / Re: API request thread (please read OP before posting!)
« on: December 25, 2020, 10:54:52 PM »
Re: last two posts here - please take a look at the OP! This thread is not for suggesting new features; those should go in the suggestions sub-forum. This thread is purely for "things that already exist in the core code but aren't accessible via the API".

I'm not entirely sure which part of my post is a new feature. The game already has tri-pad menus that have scrollable tabs and side menus (intel and command screens). I'm mainly asking that we can call up the drawing of the tri-pad window, as well as whatever functionality is in the actual content window.

The checkboxes (settings/help tips), and text inputs (character creation text boxes, faction creation text boxes) are also in the game, we just can't make them without doing all the LWJGL work to emulate them. I'll admit, multi-line text boxes don't exist currently, from what I can remember.

I don't mean to argue, just think I didn't communicate it properly.

3
Mods / Re: [0.9.1a] Dynamic Tariffs 1.2h
« on: December 24, 2020, 08:41:41 PM »
Nice idea. If I'm understanding it correctly, it won't work with mod-added markets unless you add the to the whitelist, correct?

Correct, there are a lot of mods that have custom markets that manage their own tariffs, this was the only safe way to implement this idea and have it compatible with anything out there. Vanilla markets are the only whitelisted markets in the stock settings.json

4
Suggestions / Re: API request thread (please read OP before posting!)
« on: December 21, 2020, 04:28:52 PM »
It would be nice to have access to more stuff in com.fs.starfarer.api.ui,

I will preface this with: I have no idea what any of the classes/methods are so this will sound super generic.
A way to create tri-pad like menus akin to the intel and command menus. Currently mod authors are utilizing the intel tab to add menu functionality to their mods.
Code: java
com.fs.starfarer.api.ui.TriPadAPI
The "would be nice" features would include:
  • Tab implementation
  • Scrollable content functionality
  • Maybe even a sidebar (Like intel has a sidebar where specific items are held)
  • Tab content could be table based like the intel tab is

For ToolTipMakerAPI:
Code: java
void addCheckbox(String id, boolean checked)
boolean getChecked(String id)
void addTextInput(String id, String placeholder)
void addTextBox(String id, String placeholder, int height) /* height could be number of lines, or pixel height I guess */
String getTextInput(java.lang.string id)

5
Modding Resources / Re: [GUIDE] Setting up Visual Studio Code to mod
« on: December 16, 2020, 07:34:45 PM »
Can you debug with VSCode?  I did SS stuff for a year without knowing how to attach and debug, if there's anything that'll save you time, it's having a real debugger attached.

VScode has built in debugging, and extensions to add debugging for specific languages. I personally haven't gotten into it myself, I'm sure eventually I'll have to.

6
Mods / Re: [0.9.1a] Dynamic Tariffs 1.0
« on: December 16, 2020, 04:05:01 PM »
Oh cool, this way I don't end up doing all my business in the Magec system to escape tariffs.

Have you thought about adding an option where commissioning with a faction reduces their tariffs on top of the opinion modifier? That seems like a more reasonable way to achieve a 0% tariff than just reaching cooperative rank.

Sounds like a good option, I like this. I'm in the middle of rewriting it to fix the current trade issue (deficits/surplus trading), I can definitely implement something like this, and make it a toggled option in the json (true:false) with how much MORE the tariff should be modified.

7
Modding Resources / Re: [GUIDE] Setting up Visual Studio Code to mod
« on: December 16, 2020, 01:05:26 PM »
Always great to see new guides on setting these things up, though at this point I'm very used to Netbeans! Thanks!

The straw that broke the camels back when it comes to NetBeans for me was getting older versions on Windows to work properly without too much fuss. In Linux I had zero issues, other than it just didn't have all the features I wanted.
It's all user preference though, if I can help someone else who loves VScode have an easier time setting it up for modding, it was all worth it.

8
Mods / Re: [0.9.1a] Dynamic Tariffs 1.0
« on: December 16, 2020, 12:55:29 PM »
While I think 0% for cooperative is going too far (why is there a black market then?) but I will definitely use it with more conservative values, 10% at best probably. Good work regardless, and thanks for making it mod friendly!

The Devil's Advocate in me wants to to say that if you wanted to keep "clean" while in a playthrough, you could earn a 0%. But like I said, the values I chose were kind of random, and imbalance is kind of inevitable based on the player's perspective.
I had lots of help from the Discord to make sure there was a solution to make this mod friendly, glad I could do so!

Thanks, Tuv0x!
Since you also added your modding guide, you might want to edit your profile signature to hyperlink to both of your contributions.

No problem!
I will go ahead and add them!

Good idea for a mod and I'm honestly surprised its not been done before now I think about it.
I do agree with Tartiflette, but chances are most players will have their own idea on what makes a good value.

Will definitely be downloading this for next time the SS itch kicks in, will give a better incentive to finally try a trader run.

I was surprised it didn't exist as well.

I might have found a small hitch for trader runs, which I will be looking further into. Basically, when going to a market and trying to find surplus/shortage, I don't know how the math is done for the prices bought/sold, so the Dynamic Tariffs might screw you over if your Tariff with the shortage market is higher than the market you are buying from.
I will see what I can do with the tooltips and see if it is something I can patch up.

9
Modding Resources / [GUIDE] Setting up Visual Studio Code to mod
« on: December 16, 2020, 02:29:57 AM »
Setting up VSCode for modding

There are a few guides here for intelliJ but I personally am a fan of VScode, I coded my first mod in NetBeans 10.0 but some of the features I'm used to in VSCode I just couldn't live without.
Also, if images aren't showing up when you click the spoilers, just reload the page, not sure what's going on there.

Anyways, here goes:
  • You can get vscode directly from their website or use your given package manager to download it (apt, pacman, etc.)
  • Once you have vscode installed, open it up and head over to the extensions tab
    Spoiler
    Should looks something like this
    [close]
  • Once you're there, pick up these two extensions (If it asks you to reload, go ahead and reload)
    Spoiler
    [close]
  • Now for the fun stuff: go ahead and hit Ctrl+Shift+P to bring up the command palette and type "Java", find "create Java project"  it should look like this after you click it:
    Spoiler
    [close]
  • Click "No Build Tools" to make this easier.
  • Now select a parent folder to put your project in (hint: it's about to ask you for a project name, this creates a folder with that name)
  • Name it whatever you want, it doesn't matter.
  • It's going to auto generate a project for you now, you can delete the App.java, README, and lib folder (unless you want to use them)

Now here's the very specific stuff for making this work for Starsector.

  • Starsector requires that you use Java 7 (aka jdk 1.7.0) when coding, so go pick that up from here
  • Now to make sure that the project manager is going to use Jdk1.7.0_80 to compile the .Jar go ahead and bring up the command palette with Ctrl+Shift+P.
  • Type "settings" and find "Preferences: Open Settings (JSON)"

At the very bottom paste this in.

Code
"java.configuration.runtimes": [
    {
      "name":"JavaSE-1.7",
      "path":"C:\\Program Files\\Java\\jdk1.7.0_80",
      "default":true
    }
]
NOTE: This is for Windows setups, given that jdk1.7.0_80 was installed in it's default location (64 bit), If you grabbed the 32 Bit version, it will be in C:\\Program Files (x86)... instead
If you grabbed an OpenJDK version, or just downloaded a zip, you'll have to point it to the correct directory yourself. Also, the double "\\" is intended, it's escaping the backslash, which Windows won't let die.
Linux Users: Most likely location is: /usr/lib/jvm/...
On Linux, I personally had to download the Zip and unzip it to that location.


If by default something else was there (It might use any previously installed Jdk's or installed openJDK and populated this already), delete it and replace it with this.

Okay, that's sorted.

Now how do I use this?
  • In the file explorer (Pages icon, top left), there should be a tab called "JAVA PROJECTS", open that up and make sure your project is expanded like so.
    Spoiler
    [close]
  • If you want to add libraries (starfarer.api.jar for example) click the plus sign that pops up when you mouse-over "Referenced Libraries" and find the .Jar
  • If you want to add a Class hit the plus sign that pops up next to "src." This supports names like "org.tuvox.TestMod" It will autocreate folders and the .java as well as include the correct package information in said file.
  • To build your project, when you mouse-over that panel, you will see this up top
    Spoiler
    [close]
  • Click it and uncheck everything except "bin" if you have dependencies (this ensures your dependencies don't get thrown into the compiled .Jar)
  • The default behavior for this is to just spit out the jar in the project folder, if you'd like to change that behavior click the Settings Cog all the way in the bottom left
  • Once there, type "Export Jar: Target Path" and you can change it. CAUTION: If User is selected in the top left, it will do this globally for EVERY project you work on, if you just want to change it for this Project, click Workspace.

And if you're familiar with Gradle and Git, I suggest you check out this template repo made by Jaghaimo here and use something like the Gradle Tasks extension in VScode.



10
Mods / [0.96a-RC10] Dynamic Tariffs 2.0
« on: December 16, 2020, 01:08:55 AM »
Dynamic Tariffs
Created by: Tuv0x
Download
Source

During a vanilla play-through, I decided that a 30% tariff while dealing with a faction I have good reputation with, just didn't make sense.
I figured I might as well break into the modding scene with a mod that handles this problem, not to mention it let me practice my seriously rusty Java.

DISCLAIMER:
I'm assuming there are no issues with 0.96a-RC10, this mod relies on very basic principles. If anything should come up reach out to me on Discord: tuv0x
I'll update the mod_info.json again once the release candidates slow down after a while.

What It Does:
Whenever you open a market, it modifies the tariff based on your reputation with the owning faction.
When you close a market, the modifications are removed, hence why this is a utility mod.

Compatibility:
This mod shouldn't have any issues with other mods because of the whitelist feature (which you can turn off too).
The whitelist in the settings.json are the only markets effected by this mod (currently only vanilla markets).
This was done because there are a handful of mods out there that handle markets in their own way when it comes to tariffs.
You could potentially have issues with this mod if you (or a mod) edited the default tariff in /data/campaign/econ/economy.json

Default Tariffs:
Suspicious: 30% Neutral: 25% Favorable: 20% Welcoming: 15% Friendly: 10% Cooperative: 5%
There's an extra number in the settings.json "dt_percents" array at the end (0 is default), that is just for calculations for the granular option. If you were at 100 rep and had granular on, you would end up at 0% tariff.
Commission discount: 5%
All of these values are sort of random, I haven't tested them that much.
If you don't like these edit the settings.json


Thanks
Huge thanks to the folks in discord including:
LazyWizard, stormbringer951, extremely loweffort art god, Rubin, and Jaghaimo (for the capital P in modPlugin).

Be warned:
Take account of your faction reps when doing trader runs, it can make things more tricky

Settings.json
Spoiler
dt_percents defines what tariffs should be at each level of reputation from Suspicious to Cooperative.
dt_granular if set to true (default) will offer all values in-between the set percents based on your actual reputation level. Note: if set true, if you reach 100 reputation with a faction your tariffs will be 0%.
dt_commission if enabled (default) will give you a discount when commissioned with the market's owning faction.
dt_commDiscount is how much it should discount (default is 5%)
dt_whitelist contains all of the vanilla market id's, these will be the only markets that are effected, if you wish to add some markets, just add their market id's to the list.
[close]
Changelog:
Spoiler
2.0 - Rewrote almost everything, now supports turning off the whitelist feature with "dt_usewhitelist" in the settings.json
1.4 - Updated the mod_info.json for the 0.95.1a release.
1.3 - Added Granular Tariffs (percentage tariffs in between each milestone)
1.2h - Hotfix for crashing when a market doesn't exist, added commission feature that can lower tariffs further in markets you are commissioned with.
1.1 - Reworked the code a bit. Instead of modifying on every market open/close, it now modifies all whitelisted markets when you load your save. Before you save, it removes all modifications, and after you save (if you're just quick saving) it reimplements all of the modified changes. It will also do this on the fly if your rep changes with a faction (I see you selling all those drugs on the black market).
1.0 - Release!
[close]



11
Discussions / Testing whether or not I can post *FIXED*
« on: December 16, 2020, 01:04:57 AM »
I'm having trouble posting a topic in the Modding sub for some reason. The window title is Database Error, and it just keeps telling me to try again.

I've tried 3 different browsers now.

Edit: I included some special characters that were not kosher when it comes to the Database.

Pages: [1]