Fractal Softworks Forum

Please login or register.

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

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

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7260 on: April 12, 2021, 10:20:29 AM »

Is it possible to reset a Ship using custom AI back to the base game implementation using ship.setShipAI()? I'm kinda stumped on what I would be passing in as a parameter if so
Logged

Alex

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

You can pass in the previous AI it was using, which you can retrieve using getShipAI().

Edit: to be a bit more clear, you'd want to save off the ship AI it was using before setting it to use a custom AI.
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 #7262 on: April 12, 2021, 04:31:12 PM »

Thanks for the replies!

Arrg! Turns out that I must have accidently click dragged the native directory into the graphics directory by mistake and not noticed - probably when I was deleting the log file. I moved it back to starsector-core and everything seems fine now. Phew!
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7263 on: April 12, 2021, 05:50:22 PM »

question
is it possible to change a point around which the drones from drone active system orbit?
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.

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7264 on: April 12, 2021, 05:57:28 PM »

So I tried adding a new effect to a skill (which worked in 0.9.1):
Code: java
	public static class AgentBonus implements CharacterStatsSkillEffect {
public static final int BONUS_AGENTS = 1;

@Override
public void apply(MutableCharacterStatsAPI stats, String id, float level) {
Global.getLogger(this.getClass()).info("Applying to " + id + ", " + stats.isPlayerStats());
stats.getDynamic().getStat("nex_max_agents").modifyFlat(id, BONUS_AGENTS);
}

@Override
public void unapply(MutableCharacterStatsAPI stats, String id) {
Global.getLogger(this.getClass()).info("Unapplying to " + id + ", " + stats.isPlayerStats());
stats.getDynamic().getStat("nex_max_agents").unmodify(id);
}

Result: After I learn either Officer Management or Officer Training, it absolutely spams my log with unapply messages, but the apply message is never shown:
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_training_stats_4, false
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_management_stats_3, false
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_training_stats_4, false
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_management_stats_3, false
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_training_stats_4, false
854377 [Thread-3] INFO  exerelin.campaign.skills.NexSkills$AgentBonus  - Unapplying to officer_management_stats_3, false

EDIT: the messages appear even without me learning the skill, but if I do learn it I can get a version with the log message ending in true instead of false, also printed repeatedly

I tried creating two subclasses of AgentBonus and assigning one each to Officer Training and Officer Management (rather than them sharing the superclass). That didn't help.

Am I doing something wrong?
« Last Edit: April 12, 2021, 06:02:13 PM by Histidine »
Logged

shoi

  • Admiral
  • *****
  • Posts: 658
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7265 on: April 12, 2021, 06:10:25 PM »

You can pass in the previous AI it was using, which you can retrieve using getShipAI().

Edit: to be a bit more clear, you'd want to save off the ship AI it was using before setting it to use a custom AI.

Okay, got it! Is there a way to see what key the player has bound for autopilot? I want to substitute it in a string (right now I have a status that says "Press U" for autopilot, but this won't be very helpful if it happens to have been changed... )I'm so close to getting this working exactly the way I want  :'(
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7266 on: April 12, 2021, 06:39:12 PM »

So I tried adding a new effect to a skill (which worked in 0.9.1):
...
EDIT: the messages appear even without me learning the skill, but if I do learn it I can get a version with the log message ending in true instead of false, also printed repeatedly

I tried creating two subclasses of AgentBonus and assigning one each to Officer Training and Officer Management (rather than them sharing the superclass). That didn't help.

Am I doing something wrong?

Hmm - I'm not sure - maybe something going wrong in the .skill file, like the wrong effect type? I don't think anything's changed that would prevent what you're doing from working; it's pretty much all the same stuff as far as how it's hooked up.


Okay, got it! Is there a way to see what key the player has bound for autopilot? I want to substitute it in a string (right now I have a status that says "Press U" for autopilot, but this won't be very helpful if it happens to have been changed... )I'm so close to getting this working exactly the way I want  :'(

SettingsAPI.getControlStringForEnumName("C2_TOGGLE_AUTOPILOT");

Should get you the string.
Logged

Sozzer

  • Ensign
  • *
  • Posts: 44
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7267 on: April 12, 2021, 06:45:05 PM »

Is there any way to make a custom item function as crew or marines?
I've been poking at the concept on and off for a while, but everything I've come up with just doesn't work, no matter what I do to it. I'm coming to be quite sure it's impossible, at least short of replacing every script calling for crew or marines to just call for commodities with the "crew" and "marines" tags respectively (which I don't want to do for... obvious reasons, seeing as that is TC territory), but I figure this would be the place to ask if I've overlooked something.

I realise this has been asked at least once before in this thread, but I'm hoping that some way may have been added with 0.95.
« Last Edit: April 12, 2021, 06:48:59 PM by Sozzer »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7268 on: April 12, 2021, 06:56:51 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... >.<

Setting the hull frequency to 0 in player.faction stops you from producing it?
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7269 on: April 12, 2021, 07:31:13 PM »

Found my problem, needed to make the skills not have a requiredSkillLevel > 1. Welp.

Is there any way to make a custom item function as crew or marines?
I've been poking at the concept on and off for a while, but everything I've come up with just doesn't work, no matter what I do to it. I'm coming to be quite sure it's impossible, at least short of replacing every script calling for crew or marines to just call for commodities with the "crew" and "marines" tags respectively (which I don't want to do for... obvious reasons, seeing as that is TC territory), but I figure this would be the place to ask if I've overlooked something.

I realise this has been asked at least once before in this thread, but I'm hoping that some way may have been added with 0.95.
My recollection of Alex's past posts is that this is indeed straight up impossible, the references to crew and marines are hardcoded by ID in many places.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7270 on: April 12, 2021, 08:50:38 PM »

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?
« Last Edit: April 12, 2021, 09:00:47 PM by Harmful Mechanic »
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 #7271 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: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7272 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

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7273 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: 23
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7274 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
Pages: 1 ... 483 484 [485] 486 487 ... 710