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: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 106 107 [108] 109 110 ... 752

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

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1605 on: May 21, 2014, 12:31:17 PM »

Thanks a lot! I guessed something like that) But what will happen if "minimum" fleet exceeds the maxFleetPoints limit?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25011
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1606 on: May 21, 2014, 12:36:54 PM »

The minimum will still be added to the fleet. Also, at least one ship will be picked, even if the minimums are all 0 and all the ship costs exceed maxFleetPoints.

Edit: Oh, also, just noticed your post count - hi, and welcome to the forum :)
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1607 on: May 21, 2014, 12:40:39 PM »

Quite clear explanation! Thanks for welcome too)
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1608 on: May 23, 2014, 06:51:44 AM »

Another question:
I try to make a total conversion mod by overriding several files in mod info.
Here's what I have:
Code
	"replace":[
"data/campaign/sim_opponents.csv",
"data/config/title_screen_variants.csv",
#"data/shipsystems/ship_systems.csv",
"data/missions/mission_list.csv",
"data/hulls/ship_data.csv",
"data/hulls/wing_data.csv",
"data/weapons/weapon_data.csv",
"data/world/factions/factions.csv",
],
If ship_systems is commented as above, I get an error:
Spoiler
Code
5355 [Thread-5] ERROR com.fs.starfarer.loading.SpecStore  - Ship system [phaseteleporter] not found in ship_systems.csv
5355 [Thread-5] ERROR com.fs.starfarer.loading.SpecStore  - Ship system [traveldrive] not found in ship_systems.csv
5392 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: Fatal: ship_systems.csv is missing systems
java.lang.RuntimeException: Fatal: ship_systems.csv is missing systems
at com.fs.starfarer.loading.SpecStore.class(Unknown Source)
at com.fs.starfarer.loading.SpecStore.new(Unknown Source)
at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.oOOO.A.?00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[close]
Where the hell is that onslaught? It is not mentioned in any of my files.
Well, I tried to override the systems file too. Even more mysterious:
Spoiler
Code
5483 [Thread-5] ERROR com.fs.starfarer.loading.SpecStore  - Ship system [phaseteleporter] not found in ship_systems.csv
5483 [Thread-5] ERROR com.fs.starfarer.loading.SpecStore  - Ship system [traveldrive] not found in ship_systems.csv
5518 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.RuntimeException: Fatal: ship_systems.csv is missing systems
java.lang.RuntimeException: Fatal: ship_systems.csv is missing systems
at com.fs.starfarer.loading.SpecStore.class(Unknown Source)
at com.fs.starfarer.loading.SpecStore.new(Unknown Source)
at com.fs.starfarer.loading.OooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.oOOO.A.?00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[close]
Of course, my file is not empty, so it should contain systems)
All works if I do not override files, but I really need a total conversion. Any ideas?
Thanks
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1609 on: May 23, 2014, 11:01:00 AM »

Alright, found the reason myself.
Code
	"totalConversion":"true",
The documentation says that
Quote
totalConversion  - If set to "true", then no other mods can be loaded alongside it.
But it seems to be a bit more, since it helped. I guess it prevented something from vanilla jar to be loaded, though I'm not sure.
It would be great if the corresponding description is updated.
Logged

Arumac

  • Lieutenant
  • **
  • Posts: 98
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1610 on: May 23, 2014, 03:47:48 PM »

Quick question, is there a mod with commented out faction files? I'd like to learn the basics of adding a faction post 6.0
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25011
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1611 on: May 24, 2014, 10:13:29 AM »

@celestis: Hmm, this is weird. The ship system related error went away when you set "totalConversion":true? Looking at the code, that seems... unlikely. Did update the mod_info documentation, btw.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1779
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1612 on: May 24, 2014, 11:54:45 AM »

Quick question, is there a mod with commented out faction files? I'd like to learn the basics of adding a faction post 6.0
Not sure what you're asking for. Commented out faction files? Plenty of mods provide examples of adding factions.

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1613 on: May 24, 2014, 12:56:31 PM »

Alright, so, since I have no idea how to proceed with this, time to put out a general call for help I guess.

I've currently got a ship system working on the upcoming Thresher-class CL which boosts all it weapons firing rates for a short period, and then inflict a malus to the ships firing rate while it's OUT; that appears to be functioning as intended though it doesn't appear to be reporting the Malus correctly.

However I want a visual effect to accompany the OUT stage, where the weapon ports emit steam as the ships weapons cool off.

The script I set up to this is as follows; as it's compiling fine I can't figure out why it isn't working, which is making fixing it a bit beyond me.

Spoiler
Code
package data.scripts.plugins;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipSystemAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.combat.WeaponAPI.WeaponSize;
import com.fs.starfarer.api.plugins.ShipSystemStatsScript.State;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
import java.util.*;
import org.lwjgl.util.vector.Vector2f;

public class OverheatSteam implements EveryFrameCombatPlugin {
    private CombatEngineAPI engine;
    private static final Map mag = new HashMap();
    private static final Map shipIDs = new HashMap();   
    private State state;
   
    static
    {
        // List those ships equipped with the "ms_overdrive" ship system
        shipIDs.put("ms_thresher", false);
    }

    static {
        mag.put(WeaponSize.SMALL, 1f);
        mag.put(WeaponSize.MEDIUM, 1.5f);
        mag.put(WeaponSize.LARGE, 2.5f);
    }

    @Override
    public void init(CombatEngineAPI engine) {
        this.engine = engine;
    }

    private final IntervalUtil interval = new IntervalUtil(0.1f, 0.1f);

    @Override
    public void advance(float amount, List events) {
        //ShipAPI ship;
        //CombatEntityAPI entity;
       
        //String spec;
       
        if (engine.isPaused()) {
            return;
        }

        interval.advance(amount);

        if (interval.intervalElapsed()) {
            float smokeSize = 0.8f + 0.4f * (float) Math.random();

            List<ShipAPI> ships = engine.getShips();

            for (ShipAPI ship : ships) {
                if (!shipIDs.containsKey(ship)) {
                    continue;
                }     
               
                ShipSystemAPI system = ship.getSystem();
               
                List<WeaponAPI> weapons = ship.getAllWeapons();

                if (system != null) {
                    if (system.isActive() && state == State.OUT) {
                        for (WeaponAPI weapon : weapons) {
                       
                            float smokeSizeValue = (Float) mag.get(weapon.getSize());

                            float velX = (float) Math.random() * 10f - 5f;
                            float velY = (float) Math.sqrt(25f - velX * velX);
                            if ((float) Math.random() >= 0.5f) {
                                velY = -velY;
                            }

                            engine.addSmokeParticle(weapon.getLocation(), new Vector2f(velX, velY), 30f * smokeSize * smokeSizeValue, 0.05f, 4f, new Color(130, 160, 130, 20));
                            engine.addSmokeParticle(weapon.getLocation(), new Vector2f(velX, velY), 15f * smokeSize * smokeSizeValue, 0.05f, 3f, new Color(180, 210, 180, 20));
                        }
                    }
                }
            }
        }
    }
}
[close]
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1614 on: May 24, 2014, 03:04:51 PM »

MShadowy: You never set your state variable. I don't think you can get the system state outside of a system stats script, though.

if (system.isActive() && !system.isOn()) should be equivalent to checking if the state is OUT, if I recall correctly.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1615 on: May 24, 2014, 03:43:41 PM »

Ah, yeah, that works perfectly.  Thanks, Lazy.
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1616 on: May 26, 2014, 08:48:20 AM »

@Alex
Quote
@celestis: Hmm, this is weird. The ship system related error went away when you set "totalConversion":true? Looking at the code, that seems... unlikely. Did update the mod_info documentation, btw.
Yep, I'm surprised too. But looking through the callstack was of no help. I only added "totalConversion" and that's all. Thanks for updating docs!
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1617 on: May 26, 2014, 09:56:50 AM »

This is a really dumb question, but how can I add a mod to the forum?) The Mods seems to be locked for adding a new topic.
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1734
  • I am going to destroy your ships
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1618 on: May 26, 2014, 10:16:32 AM »

This is a really dumb question, but how can I add a mod to the forum?) The Mods seems to be locked for adding a new topic.

You make the thread in modding, make sure you have a functional downloadable build. And then ask a moderator to move it for you.

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1619 on: May 26, 2014, 10:21:43 AM »

Ok, got it! Thanks
Logged
Pages: 1 ... 106 107 [108] 109 110 ... 752