Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 659 660 [661] 662 663 ... 710

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

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9900 on: May 21, 2023, 02:33:14 PM »

To add to that, it looks like an old method from the days intel was displayed / managed differently. All usages in the API are commented, and instead a real IntelInfoPlugin object is created, and added via `addMessage`. Does anything still use CommMessageAPI?

Quote
CommMessageAPI to select in intel tab, or FleetMemberAPI to select in refit tab
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9901 on: May 21, 2023, 02:52:00 PM »

How does one force a specific intel plugin to open?

Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel) only opens the intel screen. I'd use IntelUIAPI.selectItem() but I don't know how to get a intel UI instance.

I think you can just pass in an IntelInfoPlugin instead of a CommMessageAPI; the comment is old.

To add to that, it looks like an old method from the days intel was displayed / managed differently. All usages in the API are commented, and instead a real IntelInfoPlugin object is created, and added via `addMessage`. Does anything still use CommMessageAPI?

Quote
CommMessageAPI to select in intel tab, or FleetMemberAPI to select in refit tab

I'm not 100% sure; it may be used under the hood in places, but I don't think it's used anywhere in the API. Could be forgetting something though.
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9902 on: May 21, 2023, 03:54:31 PM »

How does one force a specific intel plugin to open?

Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel) only opens the intel screen. I'd use IntelUIAPI.selectItem() but I don't know how to get a intel UI instance.

I think you can just pass in an IntelInfoPlugin instead of a CommMessageAPI; the comment is old.

I actually tried that initially. It behaves highly inconsistently.

Code
    fun openIntel() {
        val handler = getHandlerWithUpdate() ?: return
        val intel = handler.manipulationIntel ?: return
        Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel)
       // Global.getSector().campaignUI.showCoreUITab(CoreUITabId.INTEL, intel)
    }

This code sometimes opens one of the RELATED intel pieces, or JUST the intel screen, or just a random intel tab. Manipulation intel, by the way, is a unique intel instance for each "handler" class. I've breakpointed it and confirmed that the local val, intel, is usually different from what actually gets opened.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9903 on: May 21, 2023, 03:59:20 PM »

Hmm - it's literally the same method that gets called when you click on a new intel item in the lower left to open up that item in the intel screen, with the intel plugin as a parameter, so I strongly suspected it does work. Not sure what you're doing differently, though.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9904 on: May 21, 2023, 06:24:13 PM »

Hi, is there a way to stop a mod from being built-in via s-mod?
Logged

TheDeviL234

  • Ensign
  • *
  • Posts: 29
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9905 on: May 21, 2023, 06:34:31 PM »

is it possible to rotate a sprite less than 90 degrees without losing detail or introducing blur? if not, then how does the game deal with ships turning in any direction?
i'm not a graphics guy and this is giving me a headache.

photoshop rotation algorithms as an example:
Spoiler

[close]

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9906 on: May 22, 2023, 04:43:52 AM »

is there a generic "when the player interacts with something in the campaign" listener?
Particularly, I'm wanting to add a skill to every fleet commander of a given faction & the FleetInflationListener doesn't seem like the right thing for the job

Hi, is there a way to stop a mod from being built-in via s-mod?
look at safety overrides' CSV line, iirc the tag is "no_build_in"
« Last Edit: May 22, 2023, 04:48:56 AM by Ruddygreat »
Logged

Dentrone

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9907 on: May 22, 2023, 06:40:09 AM »

I have no idea how to get Rugged Construction hullmod code. In csv it says com.fs.starfarer.api.impl.hullmods.RuggedConstruction
Logged

Lukas04

  • Captain
  • ****
  • Posts: 355
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9908 on: May 22, 2023, 09:11:28 AM »

I have no idea how to get Rugged Construction hullmod code. In csv it says com.fs.starfarer.api.impl.hullmods.RuggedConstruction

Most of the available source code can be found in starsector-core/starfarer.api.zip
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9909 on: May 22, 2023, 09:25:54 AM »

is it possible to rotate a sprite less than 90 degrees without losing detail or introducing blur? if not, then how does the game deal with ships turning in any direction?
i'm not a graphics guy and this is giving me a headache.

Right, it's not possible. Pixels on a monitor are on an aligned grid (which I guess is a simplifcation, but good enough for thinking about this) and fundamentally turning a sprite meaning math has to happen to make it look alright. But yeah, things will get at least a little blurred when that happens.

is there a generic "when the player interacts with something in the campaign" listener?
Particularly, I'm wanting to add a skill to every fleet commander of a given faction & the FleetInflationListener doesn't seem like the right thing for the job

I think a FleetInflationListener might be your best bet - it'll happen on interaction, and also on mouseover. And whenever some code forces a fleet to be inflated. But generally that seems to be what you'd want for adding a commander skill, I think?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9910 on: May 22, 2023, 11:19:12 AM »

ahhh, ty!
I thought that it'd only happen when it got force-inflated, though it makes sense that it happens on mouseover / interaction as well.

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9911 on: May 23, 2023, 06:46:00 AM »

How can I tell which skills can free lance admins have?

Also, I'm trying to display them using tooltip maker but neither addSkillPanel nor addSkillPanelOneColumn seems to work - are these methods hardcoded to just officer skills? Seems different to `printSkills` behaviour used in rules.csv.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24113
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9912 on: May 24, 2023, 04:36:30 PM »

How can I tell which skills can free lance admins have?

Also, I'm trying to display them using tooltip maker but neither addSkillPanel nor addSkillPanelOneColumn seems to work - are these methods hardcoded to just officer skills? Seems different to `printSkills` behaviour used in rules.csv.

Hmm yeah, those methods look hardcoded to print officer skills only.

For which skills: this is how they're picked in OfficerManagerEvent -

List<String> allSkillIds = Global.getSettings().getSortedSkillIds();
Code
for (String skillId : allSkillIds) {
SkillSpecAPI skill = Global.getSettings().getSkillSpec(skillId);
if (skill.hasTag(Skills.TAG_DEPRECATED)) continue;
if (skill.hasTag(Skills.TAG_PLAYER_ONLY)) continue;
if (skill.hasTag(Skills.TAG_AI_CORE_ONLY)) continue;
if (skill.isAdminSkill()) {
picker.add(skillId);
}
}
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9913 on: May 24, 2023, 08:04:34 PM »

Hi! So, I've been working on updating Mirror, and noticed that I'd missed mirroring the Assault Chaingun and the Thumper.

Unfortunately, it seems that my current code cannot correctly mirror these weapons: Modifications made to the SpriteAPI returned by WeaponAPI.getSprite() only affect the first frame of the animation, and AnimationAPI seems to only be concerned with the integer value indicating what frame is currently active, without allowing access to SpriteAPI objects for other frames.

Is there a mechanism I'm missing that would allow me to make this work correctly for animated weapons, or is that simply not doable with the current version of Starsector?


Edit: Nevermind, got this working! Hadn't noticed the existence of EveryFrameWeaponEffectPluginWithAdvanceAfter.
« Last Edit: May 25, 2023, 09:22:28 AM by Wyvern »
Logged
Wyvern is 100% correct about the math.

SteelSirokos

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9914 on: May 28, 2023, 05:41:46 PM »

This isn't exactly a modding question, but this seems like the most relevant place to ask it.

What exactly was changed with the launcher rendering code in 0.96a? I had managed to get an Adoptium release of JRE 19 (specifically Temurin-19.0.2+7) working smoothly with 0.95a, but when I set up the same exact environment in my 0.96a installation the launcher instantly crashes with nothing but a blue rectangle rendered when I run starsector.bat.


Pages: 1 ... 659 660 [661] 662 663 ... 710