Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21)

Pages: 1 ... 484 485 [486]

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

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 360
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7275 on: April 13, 2021, 12:46:48 AM »

Fairly sure that the button won't even be clickable when it's not in an intel plugin, as by default tooltips don't process those kinds of events.
... ah, never mind that, you can call setForceProcessInput(true) so they would be.

Hmm - I don't think there's a very easy way. I think the best you could do is check for changes in its isChecked() status since that should change on each click, regardless of what kind of button it is.
Great! that's a easy way for me LOL
Logged
My mods


Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 18136
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7276 on: April 13, 2021, 08:49:53 AM »

What's the best way to block a ship or ship skin from appearing as an option for the military nanoforge production? Just HIDE_IN_CODEX isn't doing it, and I'm not seeing from tags, etc. how vanilla is blocking stuff like the Ziggurat. Is anything with rare_bp or another blueprint tag just... fair game?

If you add a "no_sell" tag that'll cover the military bar contact production contract. The "no_dealer" tag will cover the arms dealer.
Logged

Üstad

  • Lieutenant
  • **
  • Posts: 50
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7277 on: April 13, 2021, 12:07:06 PM »

How do I remove that Ziggurat thing always make me recognized by others?

How do I add a ship from an outdated mod?  I won't publish it, just want to use it myself.
Logged

Silveressa

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7278 on: April 13, 2021, 04:41:58 PM »

I'm trying to mod the pristine nano forge to remove the pollution debuff it gives to planets, which file has the actual nano forges stats?
Logged

azmodii

  • Ensign
  • *
  • Posts: 2
  • Discord: Az#5263
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7279 on: April 13, 2021, 09:35:05 PM »

Hi all,

I'm wondering if there is a way to bypass the initial "launcher" screen (you know, the one with the "Play Starsector" button).

I'm building a launcher that can update mods automatically and browse mods and install them from within the launcher, and it works well enough but it looks like the main entry process executes some code to start the game and I can't for the life of me replicate that code.

Any help would be appreciated!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 3062
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7280 on: April 14, 2021, 02:28:03 AM »

How do I remove that Ziggurat thing always make me recognized by others?

How do I add a ship from an outdated mod?  I won't publish it, just want to use it myself.
For Ziggurat, see here
(there's no way to do it in defs, since the tag is only added when the recoverable ship is created for player)

Adding a ship from an old mod (i.e. porting it to a new mod) should go about the same as adding a completely new ship to the new mod, see the wiki guide or ask on Discord if you need help with that.

I'm trying to mod the pristine nano forge to remove the pollution debuff it gives to planets, which file has the actual nano forges stats?
There's some stats stuff in ItemEffectsRepo.java, but the pollution effect is handled by the heavy industry class (HeavyIndustry.java).
Logged

CoreWolff

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7281 on: April 14, 2021, 03:36:27 AM »

Hi,

So, I have searched through the forums before asking this, they may have been asked before but I couldn't find definitive answers.

What's the correct way to calculate beam damage in an EveryFrameCombatPlugin?

if you're using advance with a float "amount", I've seen in different scripts:

beam.getDamage().computeDamageDealt(amount);
beam.getWeapon().getDamage().getDamage() * amount;
beam.getDamage().getDamage() * amount;

Or intervals and checking every 0.1f with getDerivedStats:
float interval_dmg = beam.getWeapon().getDerivedStats().getDps() / 10f;

I've seen one post earlier saying computeDamageDealt is unreliable, so don't use that. I've seen others saying the getDamage might not be taking into account skills etc either? So.... very confused!


Also, separate to the above but related, if you want to modify the damage of a beam is this the correct way to do that below? Some of the skill e.g. RangedSpecialization seem to do it this way.

DamageAPI damage = beam.getDamage();
String id = "damage_increase";
float DAMAGE_BONUS = 30f;
damage.getModifier().modifyPercent(id, DAMAGE_BONUS);


setMultiplier() also seems to manipulate the final damage but I wasn't sure of the differences there, is that meant to be related to different damage types vs armor, shields, etc?

Appreciate any answers to the above!  :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 18136
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7282 on: April 14, 2021, 08:37:46 AM »

Hi all,

I'm wondering if there is a way to bypass the initial "launcher" screen (you know, the one with the "Play Starsector" button).

I'm building a launcher that can update mods automatically and browse mods and install them from within the launcher, and it works well enough but it looks like the main entry process executes some code to start the game and I can't for the life of me replicate that code.

Any help would be appreciated!

Ah - offhand, I'm not sure if it's possible or not. These parameters to the JVM should make it skip the launcher, but I'm not sure if it'll actually work or not. That code path is ancient and hasn't been trod in many a year.

-DlaunchDirect=true -DstartRes=1280x768 -DstartFS=false -DstartSound=true

You'd also have to save all the mod-related things in the right places in the registry, along with the other settings the launcher lets you manage...

What's the correct way to calculate beam damage in an EveryFrameCombatPlugin?

beam.getDamage().computeDamageDealt(amount);

That's the one you want. The amount passed in doesn't matter; it *should* return the accumulated damage on the frames the beam does deal damage, and 0 otherwise. And it should also correctly factor in the source ship's damage modifiers.

setMultiplier() also seems to manipulate the final damage but I wasn't sure of the differences there, is that meant to be related to different damage types vs armor, shields, etc?

It accounts for 1) frames where the beam isn't dealing damage (set to zero there) and otherwise, the charge level/brightness of the beam.
Logged

Silveressa

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7283 on: April 14, 2021, 11:34:54 AM »


There's some stats stuff in ItemEffectsRepo.java, but the pollution effect is handled by the heavy industry class (HeavyIndustry.java).
[/quote]

Thanks, and which folder do I look in to find that file?
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1683
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7284 on: April 14, 2021, 12:33:54 PM »

There's some stats stuff in ItemEffectsRepo.java, but the pollution effect is handled by the heavy industry class (HeavyIndustry.java).

Thanks, and which folder do I look in to find that file?

Both are in: Starsector\starsector-core\starfarer.api.zip\com\fs\starfarer\api\impl\campaign\econ\impl
Logged

CoreWolff

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7285 on: April 14, 2021, 12:54:34 PM »


What's the correct way to calculate beam damage in an EveryFrameCombatPlugin?

beam.getDamage().computeDamageDealt(amount);

That's the one you want. The amount passed in doesn't matter; it *should* return the accumulated damage on the frames the beam does deal damage, and 0 otherwise. And it should also correctly factor in the source ship's damage modifiers.

setMultiplier() also seems to manipulate the final damage but I wasn't sure of the differences there, is that meant to be related to different damage types vs armor, shields, etc?

It accounts for 1) frames where the beam isn't dealing damage (set to zero there) and otherwise, the charge level/brightness of the beam.

Thank you, appreciate the answers!  :D
Logged

azmodii

  • Ensign
  • *
  • Posts: 2
  • Discord: Az#5263
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7286 on: April 14, 2021, 03:38:15 PM »

Hi all,

I'm wondering if there is a way to bypass the initial "launcher" screen (you know, the one with the "Play Starsector" button).

I'm building a launcher that can update mods automatically and browse mods and install them from within the launcher, and it works well enough but it looks like the main entry process executes some code to start the game and I can't for the life of me replicate that code.

Any help would be appreciated!

Ah - offhand, I'm not sure if it's possible or not. These parameters to the JVM should make it skip the launcher, but I'm not sure if it'll actually work or not. That code path is ancient and hasn't been trod in many a year.

-DlaunchDirect=true -DstartRes=1280x768 -DstartFS=false -DstartSound=true

You'd also have to save all the mod-related things in the right places in the registry, along with the other settings the launcher lets you manage...


Thanks Alex, worked like a charm! Appreciate the response
Logged

shoi

  • Captain
  • ****
  • Posts: 257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7287 on: April 15, 2021, 02:20:27 AM »

If I wanted to have an IntervalUtil used for a specific instance of a hull, what would be the best way to go about doing that? I've tried storing and retrieving one using customData tied to ships unique ID but this doesn't seem to work (i suspect because it's a hullmod script and im still setting the intervalUtil to a variable in the script, so every single ship with hullmod has access to it..) as when two ships of the same type fulfill the condition for the intervalutil to advance, it starts incrementing at 2x speed. I have a snippet below showing what i am currently doing:

Code
				engine.getCustomData().put("armaa_strikecraftRefitTime"+ship.getId(),DockingAI.getCarrierRefitRate());
engine.getCustomData().put("armaa_strikecraftIntervalUtil"+ship.getId(),new IntervalUtil(20f,20f));
float refitMod = (float)engine.getCustomData().get("armaa_strikecraftRefitTime"+ship.getId());

if(engine.getCustomData().get("armaa_strikecraftIntervalUtil"+ship.getId()) instanceof IntervalUtil)

if(BASE_REFIT == null)
BASE_REFIT =(IntervalUtil)engine.getCustomData().get("armaa_strikecraftIntervalUtil"+ship.getId());

BASE_REFIT.advance((amount*(ship.getHullLevel()*1.5f)*refitMod));
engine.getCustomData().put("armaa_strikecraftIntervalElapsed"+ship.getId(),BASE_REFIT.getElapsed());
BASE_REFIT.setElapsed((float)engine.getCustomData().get("armaa_strikecraftIntervalElapsed"+ship.getId()));
« Last Edit: April 15, 2021, 02:26:34 AM by shoi »
Logged

Haka

  • Ensign
  • *
  • Posts: 4
    • View Profile

When I set my doctrine to use my modded weapons from my own mod i'm working on them they just don't. Everything is checked, my ships populate the fleet lists, but the weapons are nowhere to be seen.

Same thing happens with auto-fit, including variants i've made that uses my custom weapons. When I use them it just ignores those slots completely despite me having the weapons in storage and listing them as being part of the variant. I can even outfit a ship with all my custom weapons and then save a new autofit variant, and when I go to assign it it will simply leave everythign blank.

On the other hand, doctrine uses the ships fine and so do the pirates after me giving them my full BP package as well.

I have no clue what I need to do to make the game actually use my weapons actually after assigning them to my doctrines/variants/load-outs
Logged
Pages: 1 ... 484 485 [486]