Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 131 132 [133] 134 135 ... 710

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

Lcu

  • Commander
  • ***
  • Posts: 213
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1980 on: January 12, 2015, 01:48:36 AM »

If you want beams to miss fighters, use HITS_SHIPS_AND_ASTEROIDS

The error probably means that you've got a mismatch between the number of turretOffsets and turretAngleOffsets (or same for hardpoints). The former should be 2x the number of the latter, as the former are coordinate pairs.
Thanks Alex, but i have another question, if you want to classify a weapon as PD and target missiles, how do you do it?
Logged
Spoiler
66766766
66766766
66666766
66766766
66766766
Ctrl+F, type 6
[close]

FlashFrozen

  • Admiral
  • *****
  • Posts: 988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1981 on: January 12, 2015, 01:57:02 AM »

Should be in the weapon hints column in the weapon CSV, use a hint like PD,
Logged

Lcu

  • Commander
  • ***
  • Posts: 213
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1982 on: January 12, 2015, 04:42:09 AM »

Wait, hints could work? I never knew  ???. Thanks!
Logged
Spoiler
66766766
66766766
66666766
66766766
66766766
Ctrl+F, type 6
[close]

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1983 on: January 13, 2015, 01:19:57 AM »

I already know you can make a hullmod that repairs hull in battle (already have it)

BUT.

Is it possible to repair ARMOR?

I kinda want a self-repairing armor upgrade, but all I can get so far is hull repair. Which is not the same thing.
Logged

Deathfly

  • Modders' Vanguard
  • Commander
  • ***
  • Posts: 245
  • Murdered by T. H. Morgan
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1984 on: January 16, 2015, 11:01:10 PM »

I already know you can make a hullmod that repairs hull in battle (already have it)

BUT.

Is it possible to repair ARMOR?

I kinda want a self-repairing armor upgrade, but all I can get so far is hull repair. Which is not the same thing.

Sundog had already made a armor repair shipsystem in ICE Faction
http://fractalsoftworks.com/forum/index.php?topic=7625.0

and...well, i think you should check you add-on's integrality before releasing by install it and test it.
i mean form a mod-free Starsector copy, and the latest version of Ironclads.
Logged
A not-so-noob functional geneticist
And a free bug hunter
Code and decode almost everythings with a genomics approach.
Served in Neutrino corporation as a long-term services and supports staff.

Cyan Leader

  • Admiral
  • *****
  • Posts: 718
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1985 on: January 18, 2015, 07:16:13 AM »

How to simply disable a song change when docking? I prefer how it was prior to 65.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1986 on: January 18, 2015, 11:21:35 PM »

I already know you can make a hullmod that repairs hull in battle (already have it)

BUT.

Is it possible to repair ARMOR?

I kinda want a self-repairing armor upgrade, but all I can get so far is hull repair. Which is not the same thing.

Sundog had already made a armor repair shipsystem in ICE Faction
http://fractalsoftworks.com/forum/index.php?topic=7625.0

and...well, i think you should check you add-on's integrality before releasing by install it and test it.
i mean form a mod-free Starsector copy, and the latest version of Ironclads.

Oh yes, just what daddy wanted.

Hmm..packed ina .jar file. I have a program that lets me look into java files. I can certanly copy-paste the code from the .class file, but I do wonder if it would work as a .java file.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1987 on: January 19, 2015, 12:35:12 PM »

Spoiler
I already know you can make a hullmod that repairs hull in battle (already have it)

BUT.

Is it possible to repair ARMOR?

I kinda want a self-repairing armor upgrade, but all I can get so far is hull repair. Which is not the same thing.
Sundog had already made a armor repair shipsystem in ICE Faction
http://fractalsoftworks.com/forum/index.php?topic=7625.0

and...well, i think you should check you add-on's integrality before releasing by install it and test it.
i mean form a mod-free Starsector copy, and the latest version of Ironclads.
[close]

Oh yes, just what daddy wanted.

Hmm..packed ina .jar file. I have a program that lets me look into java files. I can certanly copy-paste the code from the .class file, but I do wonder if it would work as a .java file.

ICE's code is also available online in Sundog's Bitbucket repository. Here's the code he uses for armor repairing.

If you just want all armor on your ship to repair at a constant rate, that's actually fairly simple. Here's an example:
Code
package data.hullmods;

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

public class ExampleArmorRepairHullMod extends BaseHullMod
{
    private static final float ARMOR_REPAIRED_PER_SECOND = 5f;

    @Override
    public void advanceInCombat(ShipAPI ship, float amount)
    {
        // Grab the ship's armor grid and raw armor values
        final ArmorGridAPI armor = ship.getArmorGrid();
        final float[][] grid = armor.getGrid();

        // Calculate how much armor to repair per cell this frame
        // Armor per cell is NOT the same as the listed armor rating, so we have
        // to compensate by dividing max armor per cell by the 'actual' rating
        // This means 5 armor per second might only be ~0.3 armor per cell
        final float maxArmor = armor.getMaxArmorInCell(),
                toHeal = ARMOR_REPAIRED_PER_SECOND * amount
                * (maxArmor / armor.getArmorRating());

        // Iterate over all armor cells and add repairs to their current value
        for (int x = 0; x < grid.length; x++)
        {
            for (int y = 0; y < grid[0].length; y++)
            {
                armor.setArmorValue(x, y, Math.min(grid[x][y] + toHeal, maxArmor));
            }
        }
    }
}

If you want to repair a percentage of total armor per second instead, just change toHeal's value to toHeal = maxArmor * (ARMOR_REPAIRED_PER_SECOND / 100f) * amount.
« Last Edit: January 19, 2015, 02:46:42 PM by LazyWizard »
Logged

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1988 on: January 21, 2015, 10:54:40 PM »

Does anyone know what does
Code
	"quality":0.25,
line means in variant files? What is influenced by this value?
Logged

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 #1989 on: January 21, 2015, 11:59:28 PM »

It's exactly what it say, it is the quality of the variant: low stability worlds can't spawn high quality variants.
Logged
 

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1990 on: January 22, 2015, 12:20:07 AM »

Aha, I see. Thanks for explanation!
Logged

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1991 on: January 23, 2015, 08:31:15 PM »

Is there a way to print out arbitrary values for debugging purposes? On screen in the game or to the console, either way is fine.  I tried a couple standard things like System.out, but they're either not there or give me security exceptions.

This is my first time doing anything in Java, so apologies if I said something stupid.

edit: ah, never mind, System.out.println is there. I was trying to use out.format() and out.printf() because the value I wanted was a float, but I guess I can work with just println().
« Last Edit: January 23, 2015, 08:40:20 PM by orost »
Logged

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1992 on: January 23, 2015, 11:42:10 PM »

Is there a way to add my own indicator to the bar on the left in combat? The one that indicates things like "zero flux engine boost", shows CR, etc.
Logged

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 #1993 on: January 24, 2015, 02:09:17 AM »

Check out the Common Radar mod for how Lazy Wizzard managed it, but be warned, it's really not simple to do that!
Logged
 

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1994 on: January 24, 2015, 02:26:31 AM »

So I'd have to draw my own directly? I know OpengGL, so I guess I could, but trying to make its look fit with vanilla indicators would be a huge pain. I think I'm going to pass and hope we get an API for it at some point. Thanks.
Logged
Pages: 1 ... 131 132 [133] 134 135 ... 710