Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 635 636 [637] 638 639 ... 710

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

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9540 on: January 31, 2023, 03:43:23 PM »

Is it possible to scan through and only affect the player’s colonies?
Technically yes, but I don't recommend it: that would interface poorly with Nexerelin's ability for the player to capture NPC colonies. I'd think it'd be better to simply replace everything and just have your tech-mining implementation not do anything if it's not at a player-controlled colony.
Funny how a personal project has morphed into something that needs to be able to coexist with big mods. Originally I hadn’t thought of releasing - guess that I’ll have to now.

I’ll try to get it to replace everything. If someone wants to uninstall they can revert to a prior save - I’m probably not gonna be able to do better than that since some of the base TechMining code is static functions and cannot be overridden, only rewritten.

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9541 on: January 31, 2023, 04:09:07 PM »

Anyone know of any examples of visual effects that travel around a shield from the point of impact? For example, I want two particles (or whatever) to travel in different directions around the shield from the point it is hit by a shot.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9542 on: January 31, 2023, 07:02:58 PM »

Is it possible to scan through and only affect the player’s colonies?
Technically yes, but I don't recommend it: that would interface poorly with Nexerelin's ability for the player to capture NPC colonies. I'd think it'd be better to simply replace everything and just have your tech-mining implementation not do anything if it's not at a player-controlled colony.
Funny how a personal project has morphed into something that needs to be able to coexist with big mods. Originally I hadn’t thought of releasing - guess that I’ll have to now.
Oh, hah, that does change the context a bit, yeah. If it's only meant for personal use then sure! Do whatever! For that context, you could just use Alex's original suggestion of changing industries.csv and not worry about replacing existing installations; as long as you know what's going on, it's a non-issue.
Logged
Wyvern is 100% correct about the math.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9543 on: January 31, 2023, 07:36:45 PM »

Oh, hah, that does change the context a bit, yeah. If it's only meant for personal use then sure! Do whatever! For that context, you could just use Alex's original suggestion of changing industries.csv and not worry about replacing existing installations; as long as you know what's going on, it's a non-issue.
Naw, you-all have put the suggestions my way. It’d be rude to not at least try.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9544 on: February 01, 2023, 01:45:59 AM »

How do I determine if a colony/market is within 10ly of a Coronal Hypershunt?

-edit-

Actually don%u2019t worry - checking for this isn%u2019t necessary.
« Last Edit: February 01, 2023, 09:12:26 AM by WhisperDSP »
Logged

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9545 on: February 02, 2023, 03:56:15 PM »

is there an advance or GUI drawing listener/plugin that runs after all other advance methods?
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9546 on: February 02, 2023, 04:52:20 PM »

Can a projectile have more than one onHitEffect?
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9547 on: February 02, 2023, 07:12:51 PM »

It can only have one plugin, but that plugin can have as many effects as you want.
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9548 on: February 02, 2023, 07:18:13 PM »

is there a way to somehow remove/change the "-class" part of the hull name for the specifiic ship?
so the getHullNameWithDashClass returns only the name, or some custom string instead of "-class" ?
for example, if i want to change the hound so everywhere in the ui where it shows "Hound-class"  it will instead show "Hound" or "Hound-senpai" or something equally silly
« Last Edit: February 02, 2023, 08:01:27 PM by passwalker »
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9549 on: February 03, 2023, 01:32:12 AM »

How do I write to the Starsector logfile?

The reason is in the attached image - my custom TechMining code gave me two Soil Nanites, when it should only have given one.



[attachment deleted by admin]

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9550 on: February 03, 2023, 05:19:13 AM »

How do I write to the Starsector logfile?

The reason is in the attached image - my custom TechMining code gave me two Soil Nanites, when it should only have given one.

import these 2 packages
Code
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
and put this at the top of any class that you want to use logging in (then use log.debug("your message here") to actually log something)
Code
    private static final Logger log = Global.getLogger(<your classname here>.class);

    static {
        log.setLevel(Level.ALL);
    }

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9551 on: February 03, 2023, 06:23:12 AM »

I want to make a "goo gun". It fires projectiles that stick to a ship for ten seconds and slow it down. I'm pretty sure I can do the non-graphics stuff but I have some questions about sprites.

How do I attach a sprite to a ship and can I make it auto-remove after a certain time?
Logged

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9552 on: February 03, 2023, 10:54:13 AM »

How do I write to the Starsector logfile?

The reason is in the attached image - my custom TechMining code gave me two Soil Nanites, when it should only have given one.

import these 2 packages
Code
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
and put this at the top of any class that you want to use logging in (then use log.debug("your message here") to actually log something)
Code
    private static final Logger log = Global.getLogger(<your classname here>.class);

    static {
        log.setLevel(Level.ALL);
    }
Log4J vulnerability FTW LOL!

Thank you! :)

WhisperDSP

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9553 on: February 03, 2023, 07:37:02 PM »

Logging found the issue:
Code
598329 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: Farmland - item_soil_nanites
598329 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: FINAL RESULT - item_soil_nanites
598329 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: Final item (if any) - item_soil_nanites
598329 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: Progress bar value - 0.100000024
598330 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: Special items so far - 1
598330 [Thread-3] DEBUG data.scripts.wta_industry.wta_TechMining  - wtaLOG: Enhanced multiplier - 1.5
It was the Enhanced Multiplier (multEnhanced) in here which was the issue - having 1.5 (first techmining find + Alpha AI + SP Improvement) gives single items an x2 multiplier, I suppose in the back-end somewhere it rounds up:
Code: java
CargoAPI result = SalvageEntity.generateSalvage(random, 1f, 1f, multEnhanced, 1f, dropValue, dropRandom);
Instead I put the multipliers into the drop value groups:
Code: java
    // what planets will have left over after a couple of centuries of sporadic looting and damage from combat/environment/meteors
    d = new DropData();
    d.chances = colonySize;
    d.group = "wta_ruins_sized";
    d.value = 10000 * ruinsSize;
    d.valueMult = multEnhanced;
    dropValue.add(d);
And changed to this:
Code: java
CargoAPI result = SalvageEntity.generateSalvage(random, 1f, 1f, 1f, 1f, dropValue, dropRandom);
Thanks! :D

PS: My logging code is now set up as follows, starting with my settings.json:
Code
{
##############################################################
# Settings for Whisper's Techmining Alteration
  # Tweak at your own risk
##############################################################

  # the monthly rate at which ruins decay by size of ruins
  "wta_ruins_decayrate_scattered": 0.97,
  "wta_ruins_decayrate_widespread": 0.98,
  "wta_ruins_decayrate_expansive": 0.995,
  "wta_ruins_decayrate_vast": 0.9999,
 
  # whether to write to logfile (default false)
  "wta_logging": false,
}
And the code:
Code: java
  // when wta_logging in the settings.json is true, allow writing to logs
  public static boolean wta_logging = Global.getSettings().getBoolean("wta_logging");

  /*
   * code from Ruddygreat for logging
   */
  private static final Logger log = Global.getLogger(wta_TechMining.class);
  static {
    log.setLevel(Level.ALL);
  }
 
  // if wta_logging enabled write to starsector log
  private void wtaDebug(String message) {
    if (wta_logging) {
      log.debug(message);
    }
  }

Zsar

  • Captain
  • ****
  • Posts: 279
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9554 on: February 03, 2023, 10:17:24 PM »

In a mod, I created a player.faction file with empty "known<stuff>" fields and expected to start a new game with no blueprints. I start with all vanilla "base_bp" blueprints. Why?

... Should I report this as a bug? The vanilla player.faction file contains the "base_bp" tag in all "tags" fields, so I kind of expected it to actually do something?
Logged
Pages: 1 ... 635 636 [637] 638 639 ... 710