Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 482 483 [484] 485 486 ... 710

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

Flacman3000

  • Commander
  • ***
  • Posts: 202
  • A man cannot put his shaft into the unknown.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7245 on: April 11, 2021, 02:02:55 AM »

assuming that i understand you correctly, you want to make a hullmod that does nothing at all, except display description to the player?
vanilla game already has such a hullmod you can look at - Shielded Cargo Holds
it does literally nothing, the only effect it has is triggered externally, in dialogue, when scanning for contraband, which works by checking whether a ship has a hullmod with a specific ID
change that ID and you have a dud
this is it's entire script:
Code
package data.hullmods;

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

public class ShieldedCargoHolds extends BaseHullMod {
// nothing to do, just a marker hullmod
}

So essentially I leave the java file alone itself I leave that code alone and I just change the id and file name to something else is that what you mean? In the hullmod data file?
Logged
Ryzen 7 2700x, 1080ti, 16GB DDR4 RAM and playing SS on a SSD - Always stay ahead because when you're ahead you're rear anatomy is open to interpretation.

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7246 on: April 11, 2021, 02:21:46 AM »

Is there anyway to use like a damagelistener to see when incoming damage will be fatal and use that to perform some operations prior to the ship actually being destroyed?
Logged

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7247 on: April 11, 2021, 06:17:51 AM »

Is there anyway to use like a damagelistener to see when incoming damage will be fatal and use that to perform some operations prior to the ship actually being destroyed?

DamageListener only reports when damage has already been applied.

Checking if a ship is reduced to low life after a hit is possible though, would this work for your purposes?
Logged

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7248 on: April 11, 2021, 06:25:35 AM »

Damn, unfortunately not. I need to switch a ships collisionclass before it's actually destroyed. Checking for low life works, but not against stuff that would kill it outright or overkill before it reaches that threshold ( getting instagibbed with a reaper at 1000 hull or something like that)
Logged

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7249 on: April 11, 2021, 07:12:06 AM »

Hmm, there is also DamageTakenModifier (which looks like it allows you to modify the target too), maybe you can use this?
Logged

theDragn

  • Captain
  • ****
  • Posts: 307
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7250 on: April 11, 2021, 08:01:00 AM »

How do the CONSERVE_4, CONSERVE_FOR_ANTI_ARMOR, and other CONSERVE_ tags actually affect AI behavior? Just wondering what the difference is between DO_NOT_CONSERVE, normal behavior, and CONSERVE is in concrete terms (if such a thing exists for the obviously very complex AI).

MrMax

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7251 on: April 11, 2021, 08:49:29 AM »

Hello, apologies if this has been asked before but is there any way to edit the effect of special items, specifically the range of the Hypershunt Tap?

Couldn't find anything in settings...
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7252 on: April 11, 2021, 04:50:50 PM »

How do the CONSERVE_4, CONSERVE_FOR_ANTI_ARMOR, and other CONSERVE_ tags actually affect AI behavior? Just wondering what the difference is between DO_NOT_CONSERVE, normal behavior, and CONSERVE is in concrete terms (if such a thing exists for the obviously very complex AI).

From my experience: (obviously no exact knowledge of the code involved here this is just what I've observed over time)

DO_NOT_CONSERVE allows the AI ship to empty the entire missile rack once a target in range is acquired. There was a small bug in 0.91a that has been corrected in 0.95a where the ship would still conserve one or two missiles but now it empties everything asap from what I see. The only thing keeping the AI from firing a missile under DO_NOT_CONSERVE is guidance/firing arcs vs the maneuverability of the target ship. So essentially it won't fire the rocket/torpedo if it doesn't think it can actually hit the target ship.

CONSERVE_ + number means the AI will operate under normal missile firing protocols until it reaches the designated number threshold and then it will be more strict with the remaining missiles. I'm not completely sure of the specifics about what triggers the AI to use a missile past the threshold except that I know a ship that is "panicked" (flanked by strong opponents - under attack by a large number of fighters, actively taking hull damage, etc) is more willing to fire them and is less picky about targets. The target ship being "vulnerable" (overloaded/high hard flux/lots of weapons disabled, etc) probably also factors in heavily here while under the CONSERVE behavior threshold.

CONSERVE treats the entire missile rack in the above way instead of setting a threshold.

CONSERVE_FOR_ANTI_ARMOR is new and I haven't tested it but I'd imagine the Breach SRM is the primary special case for it and the AI won't use the missile against shields at all - probably with a few caveats like being "panicked" just like how CONSERVE works.

Normal missile behavior seems to mean "fire if it makes sense" which roughly translates to: 1) can the target be hit? 2) Is it likely the hit will be efficient damage-type-wise? So for instance the AI ship with a Sabot under normal behavior would only fire enough sabots to win the flux war whereas an AI ship with a Sabot under CONSERVE might wait until its own flux is high or its being flanked and an AI ship with a Sabot under DO_NOT_CONSERVE just fires all the Sabots.
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2847
  • Your Friendly Forum Friend
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7253 on: April 11, 2021, 06:18:49 PM »

How do I prevent a ship from being used in my faction fleets while still allowing it to be built by my factories? Even with the ship weight at like .00001, I'm still seeing not only the ship in fleets, but multiples of them... >.<
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7254 on: April 11, 2021, 07:00:45 PM »

Uhhh, well this is strange. I'm getting:

110  [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
110  [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
141  [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:72)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:87)
   at org.lwjgl.Sys.<clinit>(Sys.java:117)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.fs.graphics.DisplayManager.Ò00000(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.detectResolutions(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.<init>(Unknown Source)
   at com.fs.starfarer.launcher.opengl.GLLauncher.createUI(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.<init>(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher.main(Unknown Source)
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Starting Starsector 0.95a-RC12 launcher
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Running in C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - OS: Windows 8.1 6.3
0    [main] INFO  com.fs.starfarer.StarfarerLauncher  - Java version: 1.7.0_79 (64-bit)

 - When trying to launch Starsector. (I launched it fine just last night without any problems.)

So I have no idea what could be causing this. I saw this thread which had something similar but the weird thing is that to my knowledge there has been 0 changes that would suddenly make this happen.

No graphics driver updates.

No windows updates.

No changes to Java.

Any ideas for what I should try? (I've restarteda couple of times and double checked that Windows Defender isn't stealing all my ram.)
Logged

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7255 on: April 12, 2021, 01:43:46 AM »

141  [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
Is your lwjgl64.dll still in the proper location? (Something like <install directory>\starsector-core\native\windows\lwjgl64.dll)
Logged

briansd9

  • Ensign
  • *
  • Posts: 47
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7256 on: April 12, 2021, 01:53:13 AM »

I would like to use some of the components in the custom production screen for a mod. Particularly interested in being able to put images in table cells, and sort the table on header click - are these possible with the current UI component APIs?
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7257 on: April 12, 2021, 02:20:58 AM »

How to check if Button in tooltipapi is clicked if it's not in an intel plugin?
Logged
My mods


bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7258 on: April 12, 2021, 05:18:31 AM »

question
making custom campaign terrain
is it possible to make AI prefer to travel over that terrain? there doesn't seem to be any positive terrain ai flag. is creation of new terrain ai flags possible?
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.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7259 on: April 12, 2021, 09:56:36 AM »

Hello, apologies if this has been asked before but is there any way to edit the effect of special items, specifically the range of the Hypershunt Tap?

Couldn't find anything in settings...

It's not in settings, but there's a variable: ItemEffectsRepo.CORONAL_TAP_LIGHT_YEARS

The best way to modify it would be via your ModPlugin's onApplicationLoad() method.


How do I prevent a ship from being used in my faction fleets while still allowing it to be built by my factories? Even with the ship weight at like .00001, I'm still seeing not only the ship in fleets, but multiples of them... >.<

Hmm - that probably means it's the only ship for that role, in some circumstances? Or the only ship that's low-enough FP at some stage of fleet generation, possibly. Would setting its hullFrequency - in the .faction file - to 0 not do the job, though?

Uhhh, well this is strange. I'm getting:

110  [main] INFO  com.fs.starfarer.settings.StarfarerSettings  - Loading settings
110  [main] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [ABSOLUTE_AND_CWD: null (data/config/settings.json)]
141  [main] ERROR com.fs.starfarer.StarfarerLauncher  - java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
...
Any ideas for what I should try? (I've restarteda couple of times and double checked that Windows Defender isn't stealing all my ram.)

Have you tried reinstalling the game? I'd also check event viewer for errors just in case something on the system is going bad.

I would like to use some of the components in the custom production screen for a mod. Particularly interested in being able to put images in table cells, and sort the table on header click - are these possible with the current UI component APIs?

I don't believe that's possible, no - at least not without some kind of "render on top of the screen" hacking, or entirely custom UI components. (The latter *is* technically possible via CustomPanelAPI etc, but it's a ton of work.)

How to check if Button in tooltipapi is clicked if it's not in an intel plugin?

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.


question
making custom campaign terrain
is it possible to make AI prefer to travel over that terrain? there doesn't seem to be any positive terrain ai flag. is creation of new terrain ai flags possible?

I don't believe so - the best you could do, I think, would be to tell the NavigationModulePlugin to strategically avoid things that make it go into this terrain. While technically I think you could pass in anything for terrain flags, the AI wouldn't be aware of any new ones. It *is* possible to write a custom AI module that would be, but that's a whole other thing...
Logged
Pages: 1 ... 482 483 [484] 485 486 ... 710