Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 386 387 [388] 389 390 ... 710

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5805 on: December 13, 2019, 06:13:39 PM »

Code
	public void onApplicationLoad() throws Exception {
                boolean hasLazyLib = Global.getSettings().getModManager().isModEnabled("lw_lazylib");
                JSONObject tips = Global.getSettings().loadJSON( "tips.json" );
                JSONArray maxTips = tips.getJSONArray("tips");
                for (int i = 0; i < maxTips.length(); i++) {
                    System.out.println(i);
                    System.out.println(maxTips.get(i));
                }
}
I'm having trouble with trying to load tips.json from the strings folder. Is there not a method to retrieve this from or am I doing something wrong? I'd like to make a mod to add certain tips when a mod like LazyLib is enabled.

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5806 on: December 14, 2019, 01:38:50 AM »

Pretty sure you need the full subpath, i.e. "data/strings/tips.json"
Logged

Mongreal

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5807 on: December 14, 2019, 03:45:50 AM »

Quote
compile this into a jar and provide that with your mod instead of having the game try to compile it on startup.

It's actually a .jar file compiled by Intellij IDEA, but I'm pretty sure it's a dumb mistake since even when the plugin is "empty" (i.e nothing actually coded inside), the game crash when loading it.
I need to do some cleanup because the rest of the mod is somewhat of a mess before sending it, I made a lot of copy for the weapons using this plugin, and I tried to achieve the same effect with different methods (using a Beam and a BeamEffect instead of EveryFrameWeaponEffect, forcing the cooldown to arbitrary values after each real fire to change the firerate but without any more success. The only luck I had was at the beginning of the cooldown method, but the firerate was somewhat randomized by the script).
Logged

bopeepatehersheep

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5808 on: December 14, 2019, 11:26:45 PM »

This isn't specifically a question about how to implement some mod idea or something of the like.

I'm wondering why there isn't a centralized thread that discusses mod balance (I've found a few threads discussing mod balance but they're old and nobody likes necros). I mean something mostly for users to look at and find out which mods are generally considered balanced in comparison with vanilla (by forum consensus of course - not any one person's opinion) and which are considered above vanilla balance (OP) or are balanced but play drastically different than vanilla.  If something of the nature already exists I'd love to know where.

I think it would be really nice to have a prominent thread where users discussed mod balance as there are so many mods that it really makes it quite a chore to personally test mods to find which ones are balanced and which are not.

I suppose it would also be a way for modders to find feedback on their mod (albeit inconveniently since it's not in their mod thread)

I've thought about making such a thread myself but my attention span is a little spotty and I also don't know if it's even a good idea. Also, thank you modders for all the amazing mods and Alex for the game.
« Last Edit: December 14, 2019, 11:33:33 PM by bopeepatehersheep »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5809 on: December 15, 2019, 10:34:25 AM »

Hmm... I see, is there a sort of code sample I could take a look at to implement aiming a weapon and firing it? I've never actually visited this corner of the API before...

There's probably a mod that does this? Not sure exactly where to suggest looking, though.

And I have another, different question -  how does one give commands to single fighters (i.e. spawned via code using engine.getFleetManager(owner).spawnFleetMember())? I'm aware of how to give commands to bigger ships via fleetManager.getTaskManager(false), but am unsure if the same would work for commanding fighters.

Yeah, you can't do that, it wouldn't work. Unless they had a custom AI that was capable of carrying out commands.

Also, how would they behave once their ammo was depleted, if they were set as bombers? If there was a command to make them retreat, where would they go? Would their behavior be similar to fighters whose motherships had retreated? (i.e. they bunch up at your edge of the map)

I'm... not sure, actually. I think the typical drone AI would make them stick around unless the system was toggled to recall them. For drones, iirc the thinking is that this type of decision - when to recall drones vs when to leave them out - is up to the ship, not the drone.

Pretty sure you need the full subpath, i.e. "data/strings/tips.json"

Also I'm not sure how this would work as far as adding tips. At that point - at onApplicationLoad() - they're I think already loaded anyway. And even if they weren't, I don't think there's a way to dynamically remove them, is there? I could be forgetting one, though.



This isn't specifically a question about how to implement some mod idea or something of the like.

I'm wondering why there isn't a centralized thread that discusses mod balance ... I've thought about making such a thread myself but my attention span is a little spotty and I also don't know if it's even a good idea. Also, thank you modders for all the amazing mods and Alex for the game.

I don't know! But, in any case, thank you :)
Logged

BringerofBabies

  • Lieutenant
  • **
  • Posts: 98
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5810 on: December 15, 2019, 04:19:40 PM »

I think it would be really nice to have a prominent thread where users discussed mod balance as there are so many mods that it really makes it quite a chore to personally test mods to find which ones are balanced and which are not.

I suppose it would also be a way for modders to find feedback on their mod (albeit inconveniently since it's not in their mod thread)

I've thought about making such a thread myself but my attention span is a little spotty and I also don't know if it's even a good idea.

If it were focused on discussing balance of existing mods, I'd be wary of a thread like that becoming either accusatory or whiny (in the eyes of mod authors, at least). Instead, I'd suggest making a (quickly sprawling) thread about how anything and everything in vanilla is balanced, so that it can be a repository of information against which all mod authors can see balance targets in similar ships/fighters/weapons, as well as what works and doesn't work in terms of balancing particular types of things. Additionally, make it clear that mod authors are welcome to jump in with "I'm thinking of doing this - is there anything that I am missing that would make it OP/weak/not suited for the intended role?"
Of course, the major problem with a thread like that (beyond getting as many people involved/invested as possible) would be organizing the info and making it available - at some point you'd probably have to make the first post (or several, if post length is an issue) purely a table of contents for important topic summaries.
Logged

bopeepatehersheep

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5811 on: December 15, 2019, 08:30:45 PM »

If it were focused on discussing balance of existing mods, I'd be wary of a thread like that becoming either accusatory or whiny (in the eyes of mod authors, at least). .....
yah, i'd be wary of this too.  i think in the original post that it would be good to lay down guidlelines on how to discuss mod balance - such as no personal attacks on mod authors, no offensive language or rude insinuations, general civility stuff, no discussion of transgressions mod authors have committed, no drama


Instead, I'd suggest making a (quickly sprawling) thread about how anything and everything in vanilla is balanced, so that it can be a repository of information against which all mod authors can see balance targets in similar ships/fighters/weapons, as well as what works and doesn't work in terms of balancing particular types of things. Additionally, make it clear that mod authors are welcome to jump in with "I'm thinking of doing this - is there anything that I am missing that would make it OP/weak/not suited for the intended role?"
this would be nice and ideal if some consensus on what balanced is could be reached (obviously trying to retain vanilla levels of power).  there already are modding guidelines by DarkRevenant on generally how to balance a mod by shoulds, shalls and should nots.  http://fractalsoftworks.com/forum/index.php?topic=9052.0

Of course, the major problem with a thread like that (beyond getting as many people involved/invested as possible) would be organizing the info and making it available - at some point you'd probably have to make the first post (or several, if post length is an issue) purely a table of contents for important topic summaries.

i agree that the post would need structure and it would need to generate attention to even be relevant
this is primarily the reason i haven't done it.  i'm not a very neat and organized person. my passion for something is bursty and then cold.  i would feel rather bad starting something up and then abandoning it simply cuz my interest has waned for a time. i'm also not a well-known forum name so i doubt a post i make would really garner much interest unless it were actually an interesting mod (maybe i'm just cynical).
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5812 on: December 16, 2019, 12:27:59 AM »

There's almost no way to have an effective meta-discussion of mod balance without heavy moderation. It's also kind of beside the point, because the sort of people who want to hear if a mod is balanced before or instead of trying it out aren't the kind of people who have reasonable balance standards (either because they think the game should be totally different or because they don't understand it well enough yet); otherwise, they'd simply download the mod and decide for themselves.

DR's list is a good one for modders, but non-modders frequently stumble on the basics of accurately identifying how the game works and which of his rules applies when, as well as how, because they've never tried to balance anything themselves. If one of us doesn't get it, it shows in our mods. If someone else doesn't get it, it certainly doesn't stop the rest of us from hearing it shouted at us for months or years.

It's already enough of a challenge just to get people to accurately ID what comes from what mod in bug reports or to get people to read tooltips and stat cards before offering an opinion. (One thing modders discuss a fair amount among ourselves is how flashy VFX can mislead people into thinking a weapon or ship is more powerful than it, in fact, is).

So I'd just recommend the method I use; 'do I like the look of the mod enough to try it?' and, after trying it 'do I enjoy the way this mod feels?' Those two usually tell me whether or not I like what a mod does to the game before any question of balance comes into it.
Logged

Mongreal

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5813 on: December 16, 2019, 04:26:45 AM »

Another small question, while I'm trying to repair the previous script : I made a missile AI but I don't have any idea of the way I'm supposed to use it. How am I supposed to apply it on the missiles I want ?

Edit : I managed to find where I'm supposed to call the missile AI in ModPlugin, but it doesn't seems to work with this :
Code
@Override
    public PluginPick<MissileAIPlugin> pickMissileAI(MissileAPI missile, ShipAPI ship) {
        switch (missile.getProjectileSpecId()) {
            case "NRT_chaos_lrm":
                return new PluginPick (new SCQ_ChaosMissileAI(missile, ship),CampaignPlugin.PickPriority.MOD_SPECIFIC);
            default:
        }
        return null;
    }
The missile just fly straight.
« Last Edit: December 16, 2019, 07:18:00 AM by Mongreal »
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5814 on: December 16, 2019, 04:48:45 AM »

Yeah, you can't do that, it wouldn't work. Unless they had a custom AI that was capable of carrying out commands.
Ahh, looks like I'll have to put off some of my plans. Thanks for clearing that up, though! At least I know what way I need to progress!

Regarding the firing AI, I did find something that Tyrador Coalition did - giving the drones a default AI so they ignored the formation movement and, at the same time, they seemed to stop moving now when I set their top speed to 0!

Unfortunately, it seems they now also acquired 0-flux boost, which gave them some top speed despite setting it to 0. Thankfully, I was able to counter even that by simply giving them a hullmod that kept their shields permanently open. And so, after a long-winded road, I was able to arrive at my desired behavior!
Logged

Loken

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5815 on: December 16, 2019, 04:51:00 AM »

Hello, i want to request an Mod but i cant find forum rules anywhere. (hope its not forbidden)

I want to edit one number in starfarer.api.zip/com/fs/starfarer/api/impl/campaign/intel/punitive/PunitiveExpeditionIntel.java

public class PunitiveExpeditionIntel extends RaidIntel implements RaidDelegate {

   public static final String BUTTON_AVERT = "BUTTON_CHANGE_ORDERS";
   public static float REP_PENALTY = 0.05f;
WANT TO CHANGE THIS TO 0 OR 0.01

Raw edit does not work.
Someone said it can be done with this "modify PunitiveExpeditionIntel.REP_PENALTY in your ModPlugin.onApplicationLoad() or some such." but i have no idea how to actually mod.

Thanks for your attention.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5816 on: December 16, 2019, 01:23:19 PM »

I am working on a SpecialItem that is supposed to be applicable to multiple industries, and hit a dead end with the class InstallableItemPlugin.

My issue is as follows:
The constructor defined in NameInstallableItemPlugin is specific to a single industry:
Code
private IndustryClass industry;

public ItemInstallableItemPlugin(IndustryClass industry) {
this.industry = industry; }
Which prohibits addition of the item in multiple industries. Adding Industry-specific versions of InstallableItemPlugin does not work, as ItemPlugin calls a method from InstallableItemPlugin.

Is there a way around this without making a specific SpecialItem for every industry?

There is a second issue with the UI not appearing, but that might be my mistake - is there anything not immediately obvious that needs doing so the install prompt appears on the colony management screen? - My code for this does not crash, but also does not work (progress!)
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5817 on: December 16, 2019, 01:36:36 PM »

I may be mistaken, but shouldn't that work for any industry? The instantiating call will pass the specific industry its being added to through the constructor, and then the instance saves it. You can then check what type that saved industry is in later code.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5818 on: December 16, 2019, 01:50:10 PM »

That is correct, it works for every industry without a hitch, but I have to set the industry manually.
For instance, the NanoforgeInstallableItemPlugin is locked to HeavyIndustry:

Code
private HeavyIndustry industry;

public NanoforgeInstallableItemPlugin(HeavyIndustry industry) {
this.industry = industry;
}

If I try to get the Farming Industry to take a Nanoforge, it won't work cause the industry ID does not match.
Shadowy got around that limitation by making the Modular Fabricators in Shadowyards an extention of HeavyIndustry, which is not an option for me.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5819 on: December 16, 2019, 02:16:33 PM »

When I set a built-in LPC into some hulls that don't have fighter bays (outside the game) and then add converted hangar to them (in-game), the LPCs don't appear on the first (and only) fighter slot - I'm talking empty black box here- but when I try to click on them, it gives me the buzzing noise that happens when you click a built-in fighter LPC. Running a simulation on the ship does show that no fighter LPC was mounted.

Strangely enough, when I restart the game, the built-in LPCs do appear in that converted hangar slot, and everything is working as it should be. Is there a way around this issue without needing to restart?

Or, alternatively, is there a way to force-add a built-in LPC into a fighter bay via a hullmod?
« Last Edit: December 16, 2019, 02:18:24 PM by creature »
Logged
Pages: 1 ... 386 387 [388] 389 390 ... 710