Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Skills and Story Points (07/08/19)

Pages: 1 ... 210 211 [212] 213 214 ... 359

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

Tartiflette

  • Admiral
  • *****
  • Posts: 2748
  • Kickstarter is NOT a magic spring of free money!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3165 on: April 25, 2017, 06:02:06 AM »

Some of the changes in the files seem downright ***. Pointless redundancy.

Especially the tags.
A weapon already has it's type and range defined, and has a PD hint - why the hell does it need to have all those stuff repeated again in the tags?
"pd6, kinetic3, SR"

Why not read all that data from the weapon data itself?

Similar for wings.

Because it would take years to make the massive sorting program you'd need to perfectly asses the power of every single weapons only from their stats, and even then it wouldn't work because some have scripted damage.
Tags are simple, done in 5min for a whole mod, and they are user defined to avoid any issue.
Logged
 

Buttery

  • Ensign
  • *
  • Posts: 49
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3166 on: April 25, 2017, 06:02:49 AM »

You need a .faction file for ships/wings to appear in markets, yeah.
(For fighters in particular, I think the faction owning the market need some carrier variants that carry said fighters as wings defined in their .faction file, for the LPCs to appear in the store)

Actually I don't believe this is the case. My mod The Silent Armada doesn't have a new faction, or even any ships operated by existing factions, yet the fighter LPCs will still spawn in markets.

They literally should just spawn. If they don't seem to be, try dropping the tier or rarity down a few notches. When the sector generates, markets tend to stock only weapons and other equipment (fighter LPCs included) of a tech level of 0 or 1.

That seemed to fix it, thanks for the help
Logged

WKOB

  • Admiral
  • *****
  • Posts: 732
  • Odobenidine Benefactor
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3167 on: April 25, 2017, 06:04:23 AM »

Tags are simple, done in 5min for a whole mod, and they are user defined to avoid any issue.
Out of curiosity, are these tags explained somewhere or do I just need to get smart and work it out? :D
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 2748
  • Kickstarter is NOT a magic spring of free money!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3168 on: April 25, 2017, 06:13:50 AM »

Out of curiosity, are these tags explained somewhere or do I just need to get smart and work it out? :D
In case it's not self-explanatory:
energy0 is a terrible energy weapon
energy20 is a terrific one.
If a variant requires an unavailable energy17 weapon, the auto-fit will look for all the weapons with energy tag in the market and pick the best one. Same with wings except they have one rank, a one role and a tech level.
Logged
 

WKOB

  • Admiral
  • *****
  • Posts: 732
  • Odobenidine Benefactor
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3169 on: April 25, 2017, 06:16:21 AM »

Oh neat, thanks!
Logged

Drokkath

  • Captain
  • ****
  • Posts: 281
  • Xenophilic Mutant Commando
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3170 on: April 25, 2017, 07:11:41 AM »

Well, meh. No clue to my question. Guess I'll just increase ordnance points for all ships in the game for myself. At least it isn't that much of a distress, just a bit of busy work.
Logged
For I dipt in to the future, far as my gazer eye could see; Saw the vision of the world, and all the wonder that would be.

Tecrys

  • Captain
  • ****
  • Posts: 478
  • Creator of Biomancy Genetic Engineering
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3171 on: April 25, 2017, 10:04:10 AM »

Alright, I got BGE at least starting up but I had to disable some essential plugins for their unique right click system and I would need some help fixing that please.

The Plugin:
Spoiler
package data.scripts.plugins;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.ShipAPI;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.HashMap;
import java.util.Set;
import org.apache.log4j.Level;

/**
 *
 * @author Revan
 */
public class ProtectionData {
   
            public final WeakReference source;
            //public final ShipAPI source;
            final float expiration;
            static final Set protectionMap = Collections.newSetFromMap(new HashMap());
     
    public ProtectionData(float protectionDuration, ShipAPI source)
        {
            //this.hitLoc = new AnchoredEntity(target, hitLoc);
            this.source = new WeakReference(source);
            //this.source = source;
            //sets the time WHEN it will expire
            expiration = Global.getCombatEngine().getTotalElapsedTime(false)
                    + protectionDuration;
        }
           
    public static void startProtection(float protectionDuration, ShipAPI source)
        {
            //Creates a new token in the protectionMap list
            protectionMap.add(new ProtectionData(protectionDuration, source));
            Global.getLogger(ProtectionTracker.class).log(Level.INFO,"Protection Requested");
            //Applies the mutablestats to the ship
            applyProtectionStats(source);
        }
                   
    static void applyProtectionStats(ShipAPI source)
        {
            String id = "faceMeltProtection"; //id of the buff
            Global.getLogger(ProtectionTracker.class).log(Level.INFO,"Running protection apply"); //debug code

            //Apply ship stats

        source.getMutableStats().getHighExplosiveDamageTakenMult().modifyMult(id,0.001f);

        }
    static void unApplyProtectionStats(ShipAPI source)
        {
            String id = "faceMeltProtection"; //id of the buff
            Global.getLogger(ProtectionTracker.class).log(Level.INFO,"Running protection un-apply"); //debug code

            //unpply ship stats           
            source.getMutableStats().getHighExplosiveDamageTakenMult().unmodify(id);

        }
 
}
[close]

Throws this error at me:
Spoiler
18248 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error compiling [data.scripts.plugins.ProtectionData]
java.lang.RuntimeException: Error compiling [data.scripts.plugins.ProtectionData]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Problem loading class [data.scripts.plugins.ProtectionData]
   at com.fs.starfarer.loading.scripts.ScriptStore.Object(Unknown Source)
   ... 2 more
Caused by: java.lang.InstantiationException: data.scripts.plugins.ProtectionData
   at java.lang.Class.newInstance(Unknown Source)
   ... 3 more
Caused by: java.lang.NoSuchMethodException: data.scripts.plugins.ProtectionData.<init>()
   at java.lang.Class.getConstructor0(Unknown Source)
   ... 4 more
[close]
Logged
Bringing biological warfare to Stasector since 2014.
Let's say I'm the cave man type of a modder, I put the square through the triangle in kindergarten and even succeed.
Such a stupid thing to quote myself, oh well

Axisoflint

  • Ensign
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3172 on: April 25, 2017, 04:34:20 PM »

Well, meh. No clue to my question. Guess I'll just increase ordnance points for all ships in the game for myself. At least it isn't that much of a distress, just a bit of busy work.

Console commands has been updated to work with 0.8 if that helps. I've not tested anything other than the skillpoints to see what some of the newer stuff does, so ymmv.
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1455
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3173 on: April 25, 2017, 04:47:41 PM »

Well, meh. No clue to my question. Guess I'll just increase ordnance points for all ships in the game for myself. At least it isn't that much of a distress, just a bit of busy work.

If you have the ability, you could also make yourself a custom hullmod that costs negative ordnance points and install it on all your ships. That's a clean way to do it as you could do it in a mod-like format and be able to turn it on or off, or edit it, at any time without breaking the stock game. It's not the same as a percentage increase, it'd be a flat amount, but you can change the amount depending on the class (size) of the ship.

In fact, if you like, I could whip something like that up for you right now.  ;D How much more OP did you want?
« Last Edit: April 25, 2017, 04:50:55 PM by AxleMC131 »
Logged

Drokkath

  • Captain
  • ****
  • Posts: 281
  • Xenophilic Mutant Commando
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3174 on: April 25, 2017, 09:01:30 PM »

Well, meh. No clue to my question. Guess I'll just increase ordnance points for all ships in the game for myself. At least it isn't that much of a distress, just a bit of busy work.

If you have the ability, you could also make yourself a custom hullmod that costs negative ordnance points and install it on all your ships. That's a clean way to do it as you could do it in a mod-like format and be able to turn it on or off, or edit it, at any time without breaking the stock game. It's not the same as a percentage increase, it'd be a flat amount, but you can change the amount depending on the class (size) of the ship.

In fact, if you like, I could whip something like that up for you right now.  ;D How much more OP did you want?

Interesting idea, haven't thought of that before but it is still something I couldn't do even if I had the thought of it myself. Copying and altering some existing file(s) is one thing, writing something entirely from scratch that works in java is an entire different nut to crack for myself. While you are probably more than able to code scripts from scratch, I am not. I can't learn it either without losing my sanity and brute force something with insanity which of course is usually doomed to fail to a point of this:
That aside, even though I've already edited all of the ships with more OP points of about 350-650 (I over-compensate a lot to save myself from the chore of math and for ships that are like Tiandong's Wuzhang which needs about couple of hundred more OP points to install everything.),
I just can't turn down your offer either as I'm interested to see how such a hullmod file works script/gameplay-wise despite my immense struggle to learn to code in java.
« Last Edit: April 25, 2017, 09:47:20 PM by Drokkath »
Logged
For I dipt in to the future, far as my gazer eye could see; Saw the vision of the world, and all the wonder that would be.

AxleMC131

  • Admiral
  • *****
  • Posts: 1455
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3175 on: April 25, 2017, 10:16:00 PM »

You might be surprised. I've got very little actual coding experience - most of what I've learnt comes from copy-pasting from Starsector's core files and changing some values around. The total requirements for a mod that introduces such a hullmod would be:

- A mod environment (basically an overruling folder with a "mod_info" file)
- A java file for the hullmod effect stats
- A csv file (like a spreadsheet) for the installation/user interface stats
Logged

Drokkath

  • Captain
  • ****
  • Posts: 281
  • Xenophilic Mutant Commando
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3176 on: April 26, 2017, 03:25:34 AM »

You might be surprised. I've got very little actual coding experience - most of what I've learnt comes from copy-pasting from Starsector's core files and changing some values around. The total requirements for a mod that introduces such a hullmod would be:

- A mod environment (basically an overruling folder with a "mod_info" file)
- A java file for the hullmod effect stats
- A csv file (like a spreadsheet) for the installation/user interface stats

And there's my problem: Hullmod effect files in the hullmods folder are the only files I can't even make heads and tails about and so it gives me a headache of sorts and in turn I toss the damn thing proverbial away and try to find and think about a much easier solution somewhere else to get what I need.
« Last Edit: April 26, 2017, 03:35:05 AM by Drokkath »
Logged
For I dipt in to the future, far as my gazer eye could see; Saw the vision of the world, and all the wonder that would be.

AxleMC131

  • Admiral
  • *****
  • Posts: 1455
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3177 on: April 26, 2017, 03:51:47 AM »


And there's my problem: Hullmod effect files in the hullmods folder are the only files I can't even make heads and tails about and so it gives me a headache of sorts and in turn I toss the damn thing proverbial away and try to find and think about a much easier solution somewhere else to get what I need.

Yeah, they can be a little confusing. XD I suppose I kind of understand what each bit of the code means now, for most hullmods. Some are simpler than others - in fact for your situation you can create a hullmod file that doesn't actually do anything, so it can be super simple. All your doing is upping the OP count of a ship by installing a hullmod that costs negative OP.

The file itself would look like this:

Code

package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;

public class superop_upgrade extends BaseHullMod {
// Nothing to see here.
}

« Last Edit: April 26, 2017, 03:53:36 AM by AxleMC131 »
Logged

Drokkath

  • Captain
  • ****
  • Posts: 281
  • Xenophilic Mutant Commando
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3178 on: April 26, 2017, 04:55:22 AM »

Yeah, they can be a little confusing. XD I suppose I kind of understand what each bit of the code means now, for most hullmods. Some are simpler than others - in fact for your situation you can create a hullmod file that doesn't actually do anything, so it can be super simple. All your doing is upping the OP count of a ship by installing a hullmod that costs negative OP.

The file itself would look like this:

Code

package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;

public class superop_upgrade extends BaseHullMod {
// Nothing to see here.
}


Hmm.. thanks! It's vague but kind of getting the gist of it. However I still have no idea where the number value goes. To be more specific: Where would one even put it as in how, where and in what order of coding to make it work. Most likely a silly 101 java coding for dummies question but I'm not bothered by it other than I suck at it big-time.
Logged
For I dipt in to the future, far as my gazer eye could see; Saw the vision of the world, and all the wonder that would be.

AxleMC131

  • Admiral
  • *****
  • Posts: 1455
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3179 on: April 26, 2017, 05:05:49 AM »

Hmm.. thanks! It's vague but kind of getting the gist of it. However I still have no idea where the number value goes. To be more specific: Where would one even put it as in how, where and in what order of coding to make it work. Most likely a silly 101 java coding for dummies question but I'm not bothered by it other than I suck at it big-time.

Ah, that's the magic of it! Ordnance Point count is not a "Mutable Ship Stat", meaning it is not a statistic that can be tampered with directly through a hullmod.

HOWEVER if you create a hullmod (which, as in the example code, does absolutely nothing) that costs a negative quantity of Ordnance Points to install on a ship, then you have magically given your ship more ordnance.

That's where the .csv file comes in - just like the stock game, it contains user-end information, including things like the hullmod name, description, and how much OP it costs to fit on each size of ship (frigate/destroyer/cruiser/capital).
« Last Edit: April 26, 2017, 05:07:33 AM by AxleMC131 »
Logged
Pages: 1 ... 210 211 [212] 213 214 ... 359