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 ... 210 211 [212] 213 214 ... 706

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

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3165 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 #3166 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 #3167 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

  • Admiral
  • *****
  • Posts: 592
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3168 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
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Axisoflint

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3169 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: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3170 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 #3171 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: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3172 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 #3173 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: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3174 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 #3175 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: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3176 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

Drokkath

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

Well, at least I tried to understand it and get it working, though in vain. As far as coding goes, I am just too impatient for that and the more I fail the more I get furious to a point of doing irrational actions and outcomes.

Increasing the OP points for all ships already did the alternate easy-route trick I needed.
« Last Edit: April 26, 2017, 06:39:23 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.

coyote.j.p.m

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3178 on: April 26, 2017, 08:15:23 AM »

So has anyone been able to figure out what determines salvageable ship spawning (as in, which ships can be derelicts to potentially recover)? Do they only spawn as a result of battles or is there some plugin spawning them at random as well? I see in salvage_entity_gen_data.csv there's an entry for "wreck" but I'm not sure if that's the right thing or how it's used anyway.
Logged

coyote.j.p.m

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3179 on: April 26, 2017, 08:40:34 AM »

Ah, I think I figured it out actually. It's in the NearbyEventsEvent class, there's a chance every so often to spawn a derelict ship, which is a random variant of a random faction within 15LY (weighted based on faction-owned market size, where Pirates and Independents always get an extra size 5 market for the picker). So to increase the probability of random ship from my modded factions showing up, i just need more (and bigger) markets...
Logged
Pages: 1 ... 210 211 [212] 213 214 ... 706